Re: SegFault with -fstack-check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6 Jul 2003, Sean Bruno wrote:

> I have been troubleshooting an issue with a multi-threaded application
> port from Solaris X86 to Linux.
> 
> It was randomly dumping core on "main" or other random parts of code.
> 
> After hacking on the issue for about a week, I decided to write a little
> hello world program and compile it with the same options as my
> application.  Lo-and-behold it cored in the same manner, randomly and
> confusingly.  
> 
> I then began to pare off flags and includes and libraries until, as if
> by magic, it began to work!
> 
> It turned out that there is an existing issue all the way back to RH 7.2
> with the compile option "-fstack-check"  Here is my sample prog:
> 
> int main()
> {
>                                 printf ("Hello World\n");
>                                 return(0);
> }
> 
> 
> compile with:  gcc -fstack-check -o test
> 
> Run the output program up to 10 times.  It should core dump at least
> once...Is this a bug in the kernel, compiler or standard libs?
 
I'm running Debian/Woody.
summer@xxxxxx:~/test$ gcc -fstack-check -o test fstack-check.c
summer@xxxxxx:~/test$ ./test
Hello World
summer@xxxxxx:~/test$ ./test
Hello World
summer@xxxxxx:~/test$ ./test
Hello World
summer@xxxxxx:~/test$ ./test
Hello World
summer@xxxxxx:~/test$ ./test
Hello World
summer@xxxxxx:~/test$ ./test
Hello World
summer@xxxxxx:~/test$ ./test
Hello World
summer@xxxxxx:~/test$ ./test
Hello World
summer@xxxxxx:~/test$ ./test
Hello World
summer@xxxxxx:~/test$ ./test
Hello World
summer@xxxxxx:~/test$ ./test
Hello World
summer@xxxxxx:~/test$ ./test
Hello World
summer@xxxxxx:~/test$ ./test
Hello World
summer@xxxxxx:~/test$ ./test
Hello World
summer@xxxxxx:~/test$ ./test
Hello World
summer@xxxxxx:~/test$ ./test
Hello World
summer@xxxxxx:~/test$ ./test
Hello World
summer@xxxxxx:~/test$ gcc --version
2.95.4
summer@xxxxxx:~/test$
THis is okay too:
summer@xxxxxx:~/test$ gcc-3.0 --version
3.0.4
summer@xxxxxx:~/test$
My glibc:
summer@xxxxxx:~/test$ ldd --version
ldd (GNU libc) 2.2.5
Copyright (C) 2002 Free Software Foundation, Inc.

However, ...
[summer@xxxxxx test]$ gcc -fstack-check -o test fstack-check.c
[summer@xxxxxx test]$ ./test
Hello World
[summer@xxxxxx test]$ ./test
Hello World
[summer@xxxxxx test]$ ./test
Hello World
[summer@xxxxxx test]$ ./test
Hello World
[summer@xxxxxx test]$ ./test
Segmentation fault
[summer@xxxxxx test]$ ./test
Segmentation fault
[summer@xxxxxx test]$ ./test
Segmentation fault
[summer@xxxxxx test]$ ./test
Segmentation fault
[summer@xxxxxx test]$ ./test
Hello World
[summer@xxxxxx test]$ gcc --version
2.96
[summer@xxxxxx test]$ ldd --version
ldd (GNU libc) 2.2.5
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
[summer@xxxxxx test]$
Magpie is running Clark Connect release 0.9.1 which is basically Red Hat
Linux release 7.3 (Valhalla)


-- 
Please, reply only to the list.

Join the "Linux Support by Small Businesses" list at
http://mail.computerdatasafe.com.au/mailman/listinfo/lssb



_______________________________________________
Redhat-devel-list mailing list
Redhat-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/redhat-devel-list

[Index of Archives]     [Kernel Newbies]     [Red Hat General]     [Fedora]     [Red Hat Install]     [Linux Kernel Development]     [Yosemite News]

  Powered by Linux