Is one of the win32 versions compiled in debug mode #2953

issue neilneyman opened this issue on August 29, 2013
  1. neilneyman commented at 7:30 PM on August 29, 2013: none

    Saw this report:

    http://bitcoin.stackexchange.com/questions/12997/assertion-failed-when-i-try-to-open-bitcoin-wallet

    I could be wrong because I'm not that well versed in makefiles but unless this is overridden by something else, it looks like in makefile.mingw has starting at line 47:

    DEBUGFLAGS=-g CFLAGS=-mthreads -O2 -w -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)

    Doesn't the -g enable assertions? I think it shouldn't be enabled for the prod release.

  2. luke-jr commented at 7:32 PM on August 29, 2013: member

    No, assert is just a function. It's always "enabled".

    -g tells the compiler to generate debugging symbols.

  3. sipa commented at 7:33 PM on August 29, 2013: member

    It's a macro, actually, and compiling with -DNDEBUG disables them. We only have cheap assertions and leave them enabled all the time. Frequently crashing is preferrable to ending up in an unknown state.

  4. sipa commented at 7:34 PM on August 29, 2013: member

    Also, the Windows release binaries are built using makefile.linux-mingw.

  5. neilneyman commented at 7:37 PM on August 29, 2013: none

    OK, I understand. Would it make more sense to, er, "crash gracefully" rather than presenting an assert message to the end-user though? @luke-jr the "assert.h" file (gnu for example) has code like this: #ifdef NDEBUG #define assert(EX) #else #define assert(EX) (void)((EX) || (assert (#EX, __FILE, LINE),0)) #endif

    so if you #define NDEBUG somewhere in your code it basically makes the assert macro do nothing. It's meant to disable debugging mode. I was unclear on whether the -g option also did this but it does not.

  6. neilneyman closed this on Aug 29, 2013

  7. laanwj commented at 5:56 AM on August 30, 2013: member

    Yes, a crash handler that sent the data to the developers would be more useful. The problem is that bitcoin is kind of sensitive in this regard and we can't just send a memory dump etc as it may contain private keys or other sensitive data. See also #2551.

  8. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 21:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me