Community
cancel
Showing results for 
Search instead for 
Did you mean: 
AndrewC
New Contributor I
99 Views

rethrow causing problems - 11.1.073 Linux x64

catch(...)
{
throw std::exception("unknown");
}

Code such as above is causing a segmentation violation in part of my code ( both opt and debug code, 100% reproducible) inside the gcc exception handling runtime ( looks like when unwinding the stack).

No problems on Windows compiled version of same code or if I do not rethrow.

Anyone else?? Known issue.
0 Kudos
3 Replies
Brandon_H_Intel
Employee
99 Views

I don't see anyting currently reported like this. What version of gcc is installed (gcc --version) and what compiler options are you using? Can you provide a complete test case? Trying to do a throw std::exception("unknown") doesn't compile for me by default.
AndrewC
New Contributor I
99 Views

Hi,
The gcc version is as follows...

Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-java-awt=gtk --host=x86_64-redhat-linux
Thread model: posix
gcc version 3.4.6 20060404 (Red Hat 3.4.6-9)


Sorry about the sample code, the code that actually causes a segmentation violation in the gcc runtime is

catch(...)
{
throw;
}

I was experimenting in my code with (re) throwing another exception ( same problem though)
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 183067478624 (LWP 24854)]
0x0000003d3f20885c in _Unwind_RaiseException () from /lib64/libgcc_s.so.1


The stack is
#0 0x0000003d3f20885c in _Unwind_RaiseException () from /lib64/libgcc_s.so.1
#1 0x0000003d3f4af296 in __cxa_throw () from /usr/lib64/libstdc++.so.6

Brandon_H_Intel
Employee
99 Views

Still not working, although I don't have a system with gcc 3.4.6 exactly...

[u80498]$ cat test.cpp

#include

int foo(int x, int y)

{

int result;

try {

result = x/y;

}

catch(...)

{

throw;// std::exception("unknown");

}

}

int main() {

foo(10, 3);

return(0);

}

[u80498]$ icc -V -g test.cpp

Intel C Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1 Build 20100806 Package ID: l_cproc_p_11.1.073

Copyright (C) 1985-2010 Intel Corporation. All rights reserved.

Edison Design Group C/C++ Front End, version 3.10.1 (Aug 6 2010 19:14:21)

Copyright 1988-2007 Edison Design Group, Inc.

test.cpp(13): warning #1011: missing return statement at end of non-void function "foo"

}

^

GNU ld version 2.15.92.0.2 20040927

[u80498]$ ./a.out

Is it possible for you to send us a reproducible test case? It will be easier to understand if it's an environmental dependency or a coding one that's causing the problem. If IP is a concern, you can submit it as a private post or via our Premier Support web site at http://premier.intel.com

Reply