Skimming through glib/gmessages.c gives me the very strong impression that G_LOG_FLAG_RECURSION
is set if g_logv()
needs to log an error itself.
Consider running out of memory; when a memory allocation attempt fails, the program will try to log the memory allocation failure, and probably exit. When the logging routine attempts to allocate memory to log the message, it is probably going to fail. So, the logging routines keep track of how 'deep' they have been called, and switch memory allocation strategy (they allocate on the stack instead of on the heap), if it is a recursive logging call.
Anytime the logging routines get an error message and would want to log the error, something really bad is going on, so it makes sense to try to log with another mechanism and then exit.
So you're probably just seeing a far-off symptom of the real problem. You could use ltrace(1)
to try to spot the problem, or you could enable core dumps (ulimit -c unlimited
) and try to find the call chain that causes the program to crash using gdb's bt
command.