This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++/9588: memory fault when user throws exception from terminate()


>Number:         9588
>Category:       c++
>Synopsis:       memory fault when user throws exception from terminate()
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 05 19:46:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Frank Wang
>Release:        gcc version 3.2
>Organization:
>Environment:
--enable-languages=c,c++,f77 
--prefix=/opt/cross --host=powerpc-suse-linux 
--target=powerpc64-linux 
--enable-threads=posix 
--disable-nls 
--enable-shared 
--with-headers=/usr/src/packages/BUILD/cross-ppc64-gcc-3.2/include-ppc64-glibc-2.2.5
>Description:
If user threw exception from terminate(), abort() function should be called. We used following codes to test this feathre by using 64bit g++, but got memory fault at running time
>How-To-Repeat:
Sample Source File: 
===================    
//tmp.cpp

using namespace std;
#include <exception>
struct S {
        int i;
        S() {i=1;}
};

void eh_term(void)
{
        S s;
        throw s;        
}

int main(void)
{
       set_terminate (&eh_term);

        try {
                throw 'a';      
        }
        catch (S) {
        }
        return 0;
}


Test Process:
=============
STEP1: compiling and linking

/opt/cross/bin/powerpc64-linux-g++ tmp.cpp

STEP2: run
a.out

Actual Output:
=============     
rc = 139
Error msg 
Memory fault

Expected Output:
=============== 
rc = 134
Error msg
Abort
>Fix:

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]