Andre Poenitz wrote: > > On Tue, Jul 02, 2002 at 03:09:52PM +0900, R. Lahaye wrote: > > Somehow, this may force a correct stack management, or something. > > Could you initialize the dummy array with some special value and dump the > contents before you leave the function? > Somebody is writing in there, and if we know what is written we may deduced > who is writing...
That contents is not overwritten. There must be something happening right at the moment of exiting the routine, which causes a SIGSEGV much later. If it's overwritten, it's at a moment we cannot see its contents anymore, or something like that. > what happens if you remove the 'const' from 'int const n'? > What happens if you remove the variable entirely and put the expression > directly into the for-condition? Nope, both cases still give a SIGSEGV. > Hm. This could then be some optimization bug like re-using stackframes when > it really should not. > Could you try to remove any optimization (configure with -O0 or so) > and/or look at the produced assembler code? Bingo! with "-O0" the SIGSEGV gone. With any higher optimizaton level, the SIGSEGV returns. So is it then a bug in optimization, possibly related to string? Sorry, I have idea how to investigate the assembler code. May I leave it at this? ---------------------------- BTW: there's something wrong with the configure script. When I do "configure --enable-optimization=-O0" I get in the message at the end: C Compiler: gcc C Compiler flags: -g -O2 C++ Compiler: g++ (2.95.3) C++ Compiler flags: -g -O0 -W -Wall For some reason the C compiler flags always are -O2, irrespective of the value given to the configure script; is that correct? Regards, Rob.