Segmentation fault on stack overflow even with -Ct !
Original Reporter info from Mantis: UdoG
-
Reporter name: Udo Giacomozzi
Original Reporter info from Mantis: UdoG
- Reporter name: Udo Giacomozzi
Description:
When a program causes a stack overflow it raises an "Unknown Run-Time error : 202" exception which can be safely catched, fine.
When the same error happens a second time, the program crashes with Segmentation fault.
See attached test case.
Note stack checking (-Ct) is on!
I guess either the stack gets corrupt on stack overflow or exception handling is buggy.
I'd be glad if there is some workaround for this problem as it occasionally crashes (full program exit!) a multithreaded server application.
Additional information:
I compile the program with:
fpc-2.2.2/bin/ppc386 -Ct stacktest.pp
I get this output on various machines:
---------------------------------------------
Starting single-thread test in about 1 second.
Testing stack, please wait...
Exception after 241664 bytes: Unknown Run-Time error : 202
Testing stack, please wait...
Segmentation fault
---------------------------------------------
gdb is unable to produce a meaningful backtrace:
---------------------------------------------
(gdb) bt
#0 0x08048221 in ?? ()
Cannot access memory at address 0xbf7fffd0
---------------------------------------------
Tested with:
Debian 3.1, Kernel 2.6.8-3-686, AMD Sempron
Debian 4.0, Kernel 2.6.18-6-686-bigmem, AMD Athlon 64 X2
Red Hat Ent. 3 (Taroon), Kernel 2.4.21-4.ELsmp, Intel Xeon
Mantis conversion info:
- Mantis ID: 12942
- Version: 2.2.2
- Fixed in version: 2.4.0
- Fixed in revision: 12528 (#b73ed158)
- Monitored by: » UdoG (Udo Giacomozzi)
- Target version: 2.4.0