News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

SIGSEGV only while debug

Started by MoonKid, March 29, 2007, 09:21:53 PM

Previous topic - Next topic

MoonKid

I got a program that runs (F9) normal without any errors.
But If I start it with a a debug (F8) it recieves a SIGSEGV.

<err>
Program received signal SIGSEGV, Segmentation fault.
In RpcRaiseException () (C:\WINDOWS\system32\rpcrt4.dll)
</err>

I do not know what it is. Any idea?

I am using the nightlys with gcc under WinXPSP2.

thomas

This is a "feature".

Windows sends signals, exceptions, and whatever during normal operation, for example during drag-and-drop, file selection dialogs, RPC, and some other actions. The debugger catches them, and shows them (not knowing that they are "normal").
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

MoonKid

Ok, but a Segmentation fault is something wrong, isn't it?

thomas

Possibly, but not necessarily. Try dragging a file over Code::Blocks when it runs in the debugger, it will segfault, too.

Most of the time (99%), if it crashes in "normal" mode but runs fine in the debugger, you forgot to zero-initialise a variable. The debugger initialises all variables, thus the bug is hidden.

Most of the time (99%), if it runs fine in "normal" mode but crashes only in the debugger, it's plain normal.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

MoonKid

Quote from: thomas on March 29, 2007, 10:17:00 PM
Possibly, but not necessarily. Try dragging a file over Code::Blocks when it runs in the debugger, it will segfault, too.

My application just crashes on startup before I see any window/dialog!

I checked some older versions in my svn. There is the same behavior.
I checke some older versions of code::blocks (from 1.february). There is the same behavior.
I am driving crazy! ;)

Quote from: thomas on March 29, 2007, 10:17:00 PM
Most of the time (99%), if it runs fine in "normal" mode but crashes only in the debugger, it's plain normal.

It is normal, ok! But I need to debug my application?
How can I do this?

MoonKid

Hm... I just restarted my WinXP. That's all.
I do not shutdown my system. I did a supend-to-disk for two weeks.

byo

If debugger gets some possible SEGFAULT which is normal due to situations Thomas described, after recieving such signal you should simply select continue and it will work. If it's really a bug, it will rethrow SEGFAULT.

BYO

cyplo

same problem with 5th May 2007 build on windows XP ; gdb 6.5 with cygwin environ
there is infinite number of sigsevs after clicking continue
all refer to ntdll.dll
cyplo