public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13878] New: Uncaught exception on AIX with shared libraries
@ 2004-01-27  8:31 joerg dot richter at pdv-fs dot de
  2004-01-31  0:43 ` [Bug c++/13878] " dhazeghi at yahoo dot com
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: joerg dot richter at pdv-fs dot de @ 2004-01-27  8:31 UTC (permalink / raw)
  To: gcc-bugs

> g++ -v
Reading specs from /tools/pkg/gcc/3.3.2/lib/gcc-lib/powerpc-ibm-
aix5.1.0.0/3.3.2/specs
Configured with: ../gcc-3.3.2/configure --prefix=/tools/pkg/gcc/3.3.2 --with-
ld=/bin/ld --with-as=/bin/as --enable-languages=c,c++,f77
Thread model: aix
gcc version 3.3.2


Under some circumstances the GCC runtime environment is unable to find the 
right handler for an exception. I spend some days producing a small testcase. 
With no success. So I debugged the exception handling. 
I found out that one assumption made in the source does not hold for my program:

(from gcc/unwind-dw2-fde.c)
  /* Linear search through the classified objects, to find the one
     containing the pc.  Note that pc_begin is sorted descending, and
     we expect objects to be non-overlapping.  */

Actually the objects are overlapping. Somehow nearly all libraries share some 
fdes (Frame Descriptor Elements) in the shared memory segment (0xd). There is 
no problem when you have process local shared libraries (segment 0x2). They are 
still overlapping (at the end of the pc range). But the list seen_objects is 
sorted by pc_begin and the right object will be found.

But it is a problem when some shared objects start behind the shared fdes. 
(With behind I mean with a greater pc). Then some libraries have the same 
pc_begin (overlapping at the front) and _Unwind_Find_FDE can find the wrong 
object. 

I made the following workaround to handle this case too. Just search the list 
of seen_objects until search_object finds a fde. This works for me. But I think 
that the real bug lies somewhere else. Perhaps someone with more AIX or 
exception handling experience can say more to it.


*** gcc-3.2.1/gcc/unwind-dw2-fde.c	Mon Jan 21 14:08:31 2002
--- gcc-3.2.1-dbg/gcc/unwind-dw2-fde.c	Wed Jan 21 08:57:10 2004
***************
*** 985,991 ****
  	f = search_object (ob, pc);
  	if (f)
  	  goto fini;
- 	break;
        }
  
    /* Classify and search the objects we've not yet processed.  */
--- 985,990 ----

-- 
           Summary: Uncaught exception on AIX with shared libraries
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: joerg dot richter at pdv-fs dot de
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: powerpc-ibm-aix5.1.0.0
  GCC host triplet: powerpc-ibm-aix5.1.0.0
GCC target triplet: powerpc-ibm-aix5.1.0.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13878


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

end of thread, other threads:[~2005-05-31 12:22 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-27  8:31 [Bug c++/13878] New: Uncaught exception on AIX with shared libraries joerg dot richter at pdv-fs dot de
2004-01-31  0:43 ` [Bug c++/13878] " dhazeghi at yahoo dot com
2004-02-01  2:52 ` dje at watson dot ibm dot com
2004-02-01 10:26 ` joerg dot richter at pdv-fs dot de
2004-02-21 19:12 ` greed at pobox dot com
2004-03-01 21:01 ` smethells at llnl dot gov
2004-03-03 20:52 ` ajd at gentrack dot com
2004-03-03 22:50 ` dje at gcc dot gnu dot org
2004-03-03 22:51 ` dje at gcc dot gnu dot org
2004-03-03 22:54 ` dje at watson dot ibm dot com
2004-03-06 20:55 ` dje at gcc dot gnu dot org
2004-03-06 23:31 ` pinskia at gcc dot gnu dot org
2004-03-07 22:37 ` dje at gcc dot gnu dot org
2005-05-31 12:54 ` nagaraj_hayyal at satyam dot com

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).