g_debug as bug fixer?



I am the strangest thing with some C code I'm writing that uses glib.

I was having some issues with seg faults and/or corruption, so I
decided to try and track where it was happening by throwing a couple
of quick g_debug statements into my code.

But this had the effect of causing the error to go away. Not knowing
what I'd done that was fixing my code, but figuring I'd done
*something* I removed the g_debug's.

Back came the crashing program. So back to the g_debugs. Problem
solved. And so on. Whenever the g_debugs are there it runs, when they
are not, it fails.

Any ideas? If I can't resolve and no one has any ideas, I'll see if I
can isolate some code that replicates the issue, but what I can say
is: it's happening inside a glib unit test that uses a fixture and
seems to be happening when calling a function that allocates memory to
some struct members.

-Michael


-- 
Michael C. Libby
www.mikelibby.com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]