After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 376645 - Win32: Fatal warnings abort application even if IsDebuggerPresent is true
Win32: Fatal warnings abort application even if IsDebuggerPresent is true
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: win32
unspecified
Other Windows
: Normal normal
: ---
Assigned To: gtk-win32 maintainers
gtk-win32 maintainers
Depends on:
Blocks:
 
 
Reported: 2006-11-18 13:14 UTC by Andreas Köhler
Modified: 2006-12-28 14:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Do not abort if IsDebuggerPresent is true (426 bytes, patch)
2006-11-18 13:15 UTC, Andreas Köhler
none Details | Review

Description Andreas Köhler 2006-11-18 13:14:52 UTC
Fatal warnings, i.e. all warnings if the application is started with --g-fatal-warnings, abort the application on Windows even if run in a debugger like gdb or WinDBG. If glib has debugging symbols, a breakpoint is added but abort is called nonetheless.

I would like to see glib not to abort if I start my apps in gdb and have glib with debugging symbols. The attached patch does this for me. For non-debug glibs this would mean that applications do not abort if run in gdb, too. I do not have a strong opinion about that case, feel free to change the patch to handle it differently.
Comment 1 Andreas Köhler 2006-11-18 13:15:54 UTC
Created attachment 76805 [details] [review]
Do not abort if IsDebuggerPresent is true
Comment 2 Tor Lillqvist 2006-11-18 14:16:47 UTC
I don't understand what you mean with "if glib has debugging symbols"? Nothing in the Win32 code (or your patch) checks if there are debugging symbols or not, if that would even be possible.

(The meaning of G_ENABLE_DEBUG is not whether glib has been compiled with debugging symbols or not. One can have compiled with -g in CFLAGS even if G_ENABLE_DEBUG is undefined. And correspondingly, one can have stripped away debugging symbols even if G_ENABLE_DEBUG is defined. And anyway, G_ENABLE_DEBUG doesn't affect the G_OS_WIN32 branch of the code in g_logv().)

Anyway, the patch you suggest might indeed make sense. (Although, if debugging, it isn't that hard to then just skip the abort() call when the G_BREAKPOINT() is hit.)

One cannot directly compare to what the non-Win32 code does, as there is no way for that code to know whether it is being run under a debugger or not.
Comment 3 Andreas Köhler 2006-11-18 17:16:23 UTC
OK, I have mixed up two issues and got the second incorrect... just ignore what I said about debugging symbols.
The bug stays valid though :) At least I think so, right now...

Comment 4 Tor Lillqvist 2006-12-28 14:48:06 UTC
Patch applied to HEAD:

2006-12-28  Tor Lillqvist  <tml@novell.com>

	* glib/gmessages.c (g_logv): On Win32, if we get a fatal error
	message while being debugged we break into the debugger with
	G_BREAKPOINT(). Don't call abort() if the user is foolhardy enough
	to continue after the breakpoint. The user presumably knows what
	he is doing and deserves what he gets. (#376645, Andreas Köhler)