public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/2578: Stack array bounds read/write error when throwing an exception
@ 2001-04-18  6:46 rfborges
  0 siblings, 0 replies; 2+ messages in thread
From: rfborges @ 2001-04-18  6:46 UTC (permalink / raw)
  To: gcc-gnats

>Number:         2578
>Category:       c++
>Synopsis:       Stack array bounds read/write error when throwing an exception
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 18 06:46:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     rfborges@lucent.com
>Release:        gcc version 2.95.3 20010315 (release)
>Organization:
>Environment:
system type: sparc-sun-solaris2.6
commands issued for build:
> ../gcc-2.95.3/configure --prefix=/work/sdg/usr/gcc-2.95.3 --with-local-prefix=/work/sdg/usr --with-gxx-includ
e-dir=/work/sdg/usr/include/g++ --enable-threads
> make bootstrap
> make install
>Description:
Command issued for compilation: g++ -Wall a.cpp
No warnings are reported.

Purify detects a wrong stack access caused by throw.
According to what I've investigated, the error
actually occurs at the end of catch.
Below is the Purify report.

****  Purify instrumented a.out (pid 21599)  ****
SBR: Stack array bounds read (14 times):
  * This is occurring while in:
        copy_reg       [libgcc2.c]
        throw_helper   [libgcc2.c]
        __throw        [libgcc2.c]
        f()            [ccGVTaSc.o]
        main           [ccGVTaSc.o]
        _start         [crt1.o]
  * Reading 4 bytes from 0xeffff288.
  * Frame pointer 0xeffff288
  * Address 0xeffff288 is        0 bytes above stack pointer in function main.

****  Purify instrumented a.out (pid 21599)  ****
SBW: Stack array bounds write (14 times):
  * This is occurring while in:
        copy_reg       [libgcc2.c]
        throw_helper   [libgcc2.c]
        __throw        [libgcc2.c]
        f()            [ccGVTaSc.o]
        main           [ccGVTaSc.o]
        _start         [crt1.o]
  * Writing 4 bytes to 0xeffff218.
  * Frame pointer 0xeffff218
  * Address 0xeffff218 is        0 bytes above stack pointer in function f().
>How-To-Repeat:
void f()
{
   throw 1;
}

int main()
{
   try 
   {
      f();
   }
   catch (...)
   {
   }
   return 0;
}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: c++/2578: Stack array bounds read/write error when throwing an exception
@ 2001-08-12 13:54 rodrigc
  0 siblings, 0 replies; 2+ messages in thread
From: rodrigc @ 2001-08-12 13:54 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, rfborges, rodrigc, nathan

Synopsis: Stack array bounds read/write error when throwing an exception

State-Changed-From-To: feedback->closed
State-Changed-By: rodrigc
State-Changed-When: Sun Aug 12 13:54:02 2001
State-Changed-Why:
    Feedback not supplied.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=2578&database=gcc


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-08-12 13:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-18  6:46 c++/2578: Stack array bounds read/write error when throwing an exception rfborges
2001-08-12 13:54 rodrigc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).