relase breaks somthing??

Daniel Keep daniel.keep.lists at gmail.com
Tue May 1 17:11:09 PDT 2007



Bill Baxter wrote:
> BCS wrote:
>> Reply to Jarrett,
>>
>>> "BCS" <ao at pathlink.com> wrote in message
>>> news:ce0a33439d808c95a0759e2a784 at news.digitalmars.com...
>>>
>>>> I have a program that compiles and runs fine unless I give it the
>>>> release flag. Then it dies with a seg-v. Are there any known issues
>>>> along this line?
>>>>
>>> POST CODE.
>>>
>>
>> I can't, it's for work.
>>
>> Mostly I'm asking if anyone known of somthing to look for.
>>
>> When I find the problem, I'll post a minimal case.
>>
>>
> 
> Look for doing something in a precondition that is required for correct
> operation of your program.  (Maybe a check you perform actually causes
> an object to initialize its state or something).
> 
> --bb

I had the reverse problem once: my program would seg-v if I threw -debug.

I think I eventually nailed it down by using writeflns to determine
where abouts the crash was happening (actually before main() got
called), then slowly removing debug {}, in {}, out {} and invariant {}
code until it stopped.

Turned out I was asserting a property of an object whose reference was
null; silly me.

The other thing you can do is load the program up into ddbg (if you're
on Windows; otherwise, try another debugger) and see if it will tell you
where you're segfaulting.

	-- Daniel

-- 
int getRandomNumber()
{
    return 4; // chosen by fair dice roll.
              // guaranteed to be random.
}

http://xkcd.com/

v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D
i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP  http://hackerkey.com/


More information about the Digitalmars-d-bugs mailing list