delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/06/21/08:01:43

From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Strange behavior of compiler.
Date: 21 Jun 2001 09:46:43 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 38
Message-ID: <9gsfq3$g9a$1@nets3.rz.RWTH-Aachen.DE>
References: <3b31a377 DOT 174815003 AT news DOT primus DOT ca> <3b31a893 DOT 176123084 AT news DOT primus DOT ca> <3b31a94c DOT 176308036 AT news DOT primus DOT ca>
NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 993116803 16682 137.226.32.75 (21 Jun 2001 09:46:43 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 21 Jun 2001 09:46:43 GMT
Originator: broeker@
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Graaagh the Mighty <invalid AT erehwon DOT invalid> wrote:
> On Thu, 21 Jun 2001 07:58:54 GMT, invalid AT erehwon DOT invalid (Graaagh the
> Mighty) sat on a tribble, which squeaked:

>>I have more information. On a hunch I looked at the changes. There was
>>a bug in one of the debugging bits I added that would in fact have
>>jumped into never-never land 

A bug in a *printf* that would *jump* somewhere? Sorry, but you'll
have to explain what that's supposed to mean. No printf in the world
jumps anywhere, like that.

>> -- *if* "bar" had ever been reached. 

What makes you so sure it hasn't?  Did you try this in the debugger,
stepping through what *exactly* happened?

>> So
>>why weren't the call frame traceback EIPs more like:
>>
>>  0x01fc0000   0x1fc0000
>>  0x00f00ba7   _bar+42, line 666 of bwlsm.c
>>  0x0000178b   _main+275, line 195 of bwlsm.c
>>  0x00057b7a   ___crt1_startup+174

You're in undefined-behaviour-land, already. Which means there's no
reason for or against anything, any more --- things just happen the
way they happen.

One possible explanation: if 'bar' contains a jump (assembly jmp or C
function call) into never-never-land, the crash will happen before a
proper stack frame has been set up for the new 'function', which may
*very* easily mean that the stackframe unwinding machinery can't see
that this call was not coming from 'main', but from 'bar'.

-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019