This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
array bound violation in frame.c
- To: egcs-bugs at cygnus dot com
- Subject: array bound violation in frame.c
- From: Shigeya Suzuki <shigeya at foretune dot co dot jp>
- Date: Fri, 21 Aug 1998 16:06:39 +0900
- Cc: tech at foretune dot co dot jp
When I compile and run following code snippet with purify, it cause
attached Purify error and finally dumps core. Without purify, run
without problem.
I ran this test on Solaris2.6, with egcs_ss_980819, no haifa, with
binutils-2.9.1. configuration and test result details on
http://www.foretune.co.jp/people/shigeya/egcs/snap-test/sparc-sun-sunos2.6/19980819ss/
If I specify -fsjlj-exceptions, this error goes away.
Hope this helps,
Shigeya Suzuki
------------------------------
#include <iostream.h>
sub()
{
throw "tako";
}
main()
{
try {
sub();
cout << "foo" << endl;
} catch( const char *p) {
cout << p << endl;
} catch(...){
cout << "what" << endl;
}
}
------------------------------
**** Purify instrumented ./a.out (pid 22451 at Fri Aug 21 15:32:57 1998)
* Purify 4.1 Solaris 2, Copyright (C) 1992-1997 Rational Software Corp. All rights reserved.
* For contact information type: "purify -help"
* For TTY output, use the option "-windows=no"
* Command-line: ./a.out
* Options settings: \
-collector=/usr/local/egcs/lib/gcc-lib/sparc-sun-solaris2.6/egcs-2.91.15/ld \
-cache-dir=./build -always-use-cache-dir -g++=yes -purify \
-static-checking-default=aggressive -chain-length=15 \
-purify-home=/usr/local/bin/../pure/purify-4.1-solaris2
* Welcome to Purify
* Purify licensed to XYZ
* Purify checking enabled.
**** Purify instrumented ./a.out (pid 22451) ****
ABR: Array bounds read:
* This is occurring while in:
count_fdes [frame.c]
find_fde [frame.c]
__frame_state_for [frame.c]
__throw [libgcc2.c]
sub() [ccNVPPcT.o]
main [ccNVPPcT.o]
_start [crt1.o]
* Reading 4 bytes from 0xa2fa0 in the initialized data section.
* Address 0xa2fa0 is global variable "__EH_FRAME_BEGIN__".
This is defined in a.out.
**** Purify instrumented ./a.out (pid 22451) ****
ABR: Array bounds read:
* This is occurring while in:
count_fdes [frame.c]
find_fde [frame.c]
__frame_state_for [frame.c]
__throw [libgcc2.c]
sub() [ccNVPPcT.o]
main [ccNVPPcT.o]
_start [crt1.o]
* Reading 4 bytes from 0xa2fa4 in the initialized data section.
* Address 0xa2fa4 is 4 bytes past start of global variable "__EH_FRAME_BEGIN__".
This is defined in a.out.
**** Purify instrumented ./a.out (pid 22451) ****
ABR: Array bounds read:
* This is occurring while in:
count_fdes [frame.c]
find_fde [frame.c]
__frame_state_for [frame.c]
__throw [libgcc2.c]
sub() [ccNVPPcT.o]
main [ccNVPPcT.o]
_start [crt1.o]
* Reading 4 bytes from 0xa2fa0 in the initialized data section.
* Address 0xa2fa0 is global variable "__EH_FRAME_BEGIN__".
This is defined in a.out.
**** Purify instrumented ./a.out (pid 22451) ****
ABR: Array bounds read:
* This is occurring while in:
count_fdes [frame.c]
find_fde [frame.c]
__frame_state_for [frame.c]
__throw [libgcc2.c]
sub() [ccNVPPcT.o]
main [ccNVPPcT.o]
_start [crt1.o]
* Reading 4 bytes from 0xa2fa8 in the initialized data section.
* Address 0xa2fa8 is 8 bytes past start of global variable "__EH_FRAME_BEGIN__".
This is defined in a.out.
**** Purify instrumented ./a.out (pid 22451) ****
MSE: Memory segment error:
* This is occurring while in:
count_fdes [frame.c]
find_fde [frame.c]
__frame_state_for [frame.c]
__throw [libgcc2.c]
sub() [ccNVPPcT.o]
main [ccNVPPcT.o]
_start [crt1.o]
* Accessing a memory range that crosses a memory segment boundary.
Addressing 0x707fa209 for 4 bytes ending at 0x707fa20d,
which is neither in the heap nor the main stack.
**** Purify instrumented ./a.out (pid 22451) ****
COR: Fatal core dump:
* This is occurring while in:
count_fdes [frame.c]
find_fde [frame.c]
__frame_state_for [frame.c]
__throw [libgcc2.c]
sub() [ccNVPPcT.o]
main [ccNVPPcT.o]
_start [crt1.o]
* Received signal 10 (SIGBUS - Bus Error)
* Faulting address = 0x707fa209
* Signal mask: (SIGBUS)
* Pending signals: