public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: AIX 5.1 dlopen shared library exception handling problem
@ 2004-02-05 18:07 Coulter, Scott
  2004-02-05 19:00 ` David Edelsohn
  0 siblings, 1 reply; 9+ messages in thread
From: Coulter, Scott @ 2004-02-05 18:07 UTC (permalink / raw)
  To: David Edelsohn, Joe Buck; +Cc: gcc

Does it make sense that this behavior would show up only when loading the library
with dlopen() and not when linking to the library directly?
 
I've already built a test version of our app with only a minimal number of our classes,
trying to see whether this is another instance of the known problem with duplicate symbols.
I haven't yet identified any duplicates.  I'm now working on writing an even smaller
test without any of our app's framework in place.
 
--sdc
scott.coulter@retek.com
 

	-----Original Message----- 
	From: David Edelsohn [mailto:dje@watson.ibm.com] 
	Sent: Thu 2/5/2004 12:25 PM 
	To: Joe Buck 
	Cc: Coulter, Scott; gcc@gcc.gnu.org 
	Subject: Re: AIX 5.1 dlopen shared library exception handling problem 
	
	

	>>>>> Joe Buck writes:
	
	>> Please see existing Bugzilla bug report 13391.
	
	Joe> It doesn't look the same.  You say in that bug report that the issue is
	Joe> that collect2 becomes confused by duplicate symbols.  But in this case,
	Joe> dlopen() is being used to open the shared library, and collect2 is not
	Joe> involved.
	
	        Collect2 generated the shared library.
	
	        According to an analysis in a related bug report, it appears that
	GCC's assumption about the sorting of FDEs is getting confused by the
	address ranges of shared libraries used by AIX.  The duplicate symbols
	cause FDEs for the same symbol to appear in multiple shared libraries.
	
	David
	


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

* Re: AIX 5.1 dlopen shared library exception handling problem
  2004-02-05 18:07 AIX 5.1 dlopen shared library exception handling problem Coulter, Scott
@ 2004-02-05 19:00 ` David Edelsohn
  0 siblings, 0 replies; 9+ messages in thread
From: David Edelsohn @ 2004-02-05 19:00 UTC (permalink / raw)
  To: Coulter, Scott; +Cc: Joe Buck, gcc

>>>>> Coulter, Scott writes:

Scott> Does it make sense that this behavior would show up only when loading the library
Scott> with dlopen() and not when linking to the library directly?
 
	The problem is due to the number of libraries and where they are
loaded in memory.  Dynamic linking at startup versus dlopen() changes
that.

David

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

* RE: AIX 5.1 dlopen shared library exception handling problem
@ 2004-02-06 15:41 Coulter, Scott
  0 siblings, 0 replies; 9+ messages in thread
From: Coulter, Scott @ 2004-02-06 15:41 UTC (permalink / raw)
  To: Joerg.Richter, dje; +Cc: Joe.Buck, gcc

Many, many thanks to Joerg, and the others who responded to my question.
The patch suggested in PR13878 does indeed seem to fix my problem, both in
my small test case, and in our full application.
 
I hope we can get either this fix, or something related, into future releases of
gcc for the AIX platform.  I'm no compiler guru, but if there's any way I can help
track down the root causes of this issue, please let me know...
 
Scott Coulter
scott.coulter@retek.com
 

	-----Original Message----- 
	From: Joerg.Richter@pdv-FS.de [mailto:Joerg.Richter@pdv-FS.de] 
	Sent: Fri 2/6/2004 3:36 AM 
	To: dje@watson.ibm.com 
	Cc: Joe.Buck@synopsys.com; Coulter, Scott; gcc@gcc.gnu.org 
	Subject: Re: AIX 5.1 dlopen shared library exception handling problem 
	
	

	>       According to an analysis in a related bug report, it appears that
	> GCC's assumption about the sorting of FDEs is getting confused by the
	> address ranges of shared libraries used by AIX.  The duplicate symbols
	> cause FDEs for the same symbol to appear in multiple shared libraries.
	
	Please note that this are two different issues. Duplicate symbols in user
	code can cause uncaught exceptions. But only when they are both the first
	definition in both translation units. I think GCC uses their name to name
	the unwind table or something related. So the unwind information for one
	translation unit is lost.
	
	I tried to describe the second cause for uncaught exceptions in bug report
	13878. There are no duplicate symbols (in user code) involved. All unwind
	information is still present. But due to the fact that some fdes are shared
	between shared libraries GCC runtime doesn't find the right fde.
	
	The patch in PR13878 fixes the second issue. Not the first.
	
	
	   Joerg
	


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

* Re: AIX 5.1 dlopen shared library exception handling problem
@ 2004-02-06  8:38 Joerg.Richter
  0 siblings, 0 replies; 9+ messages in thread
From: Joerg.Richter @ 2004-02-06  8:38 UTC (permalink / raw)
  To: dje; +Cc: Joe.Buck, scott.coulter, gcc

>	According to an analysis in a related bug report, it appears that
> GCC's assumption about the sorting of FDEs is getting confused by the
> address ranges of shared libraries used by AIX.  The duplicate symbols
> cause FDEs for the same symbol to appear in multiple shared libraries.

Please note that this are two different issues. Duplicate symbols in user
code can cause uncaught exceptions. But only when they are both the first
definition in both translation units. I think GCC uses their name to name
the unwind table or something related. So the unwind information for one
translation unit is lost.

I tried to describe the second cause for uncaught exceptions in bug report
13878. There are no duplicate symbols (in user code) involved. All unwind
information is still present. But due to the fact that some fdes are shared
between shared libraries GCC runtime doesn't find the right fde. 

The patch in PR13878 fixes the second issue. Not the first.


   Joerg

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

* Re: AIX 5.1 dlopen shared library exception handling problem
  2004-02-05 17:25     ` David Edelsohn
@ 2004-02-05 17:34       ` Joe Buck
  0 siblings, 0 replies; 9+ messages in thread
From: Joe Buck @ 2004-02-05 17:34 UTC (permalink / raw)
  To: David Edelsohn; +Cc: Coulter, Scott, gcc

On Thu, Feb 05, 2004 at 12:25:12PM -0500, David Edelsohn wrote:
> >>>>> Joe Buck writes:
> 
> >> Please see existing Bugzilla bug report 13391.
> 
> Joe> It doesn't look the same.  You say in that bug report that the issue is
> Joe> that collect2 becomes confused by duplicate symbols.  But in this case,
> Joe> dlopen() is being used to open the shared library, and collect2 is not
> Joe> involved.
> 
> 	Collect2 generated the shared library.

Of course; next time I'll drink my coffee before sending mail.

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

* Re: AIX 5.1 dlopen shared library exception handling problem
  2004-02-05 17:22   ` Joe Buck
@ 2004-02-05 17:25     ` David Edelsohn
  2004-02-05 17:34       ` Joe Buck
  0 siblings, 1 reply; 9+ messages in thread
From: David Edelsohn @ 2004-02-05 17:25 UTC (permalink / raw)
  To: Joe Buck; +Cc: Coulter, Scott, gcc

>>>>> Joe Buck writes:

>> Please see existing Bugzilla bug report 13391.

Joe> It doesn't look the same.  You say in that bug report that the issue is
Joe> that collect2 becomes confused by duplicate symbols.  But in this case,
Joe> dlopen() is being used to open the shared library, and collect2 is not
Joe> involved.

	Collect2 generated the shared library.

	According to an analysis in a related bug report, it appears that
GCC's assumption about the sorting of FDEs is getting confused by the
address ranges of shared libraries used by AIX.  The duplicate symbols
cause FDEs for the same symbol to appear in multiple shared libraries.

David

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

* Re: AIX 5.1 dlopen shared library exception handling problem
  2004-02-05 15:16 ` David Edelsohn
@ 2004-02-05 17:22   ` Joe Buck
  2004-02-05 17:25     ` David Edelsohn
  0 siblings, 1 reply; 9+ messages in thread
From: Joe Buck @ 2004-02-05 17:22 UTC (permalink / raw)
  To: David Edelsohn; +Cc: Coulter, Scott, gcc

On Thu, Feb 05, 2004 at 10:16:19AM -0500, David Edelsohn wrote:
> 	Please see existing Bugzilla bug report 13391.

It doesn't look the same.  You say in that bug report that the issue is
that collect2 becomes confused by duplicate symbols.  But in this case,
dlopen() is being used to open the shared library, and collect2 is not
involved.

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

* Re: AIX 5.1 dlopen shared library exception handling problem
  2004-02-05 15:12 Coulter, Scott
@ 2004-02-05 15:16 ` David Edelsohn
  2004-02-05 17:22   ` Joe Buck
  0 siblings, 1 reply; 9+ messages in thread
From: David Edelsohn @ 2004-02-05 15:16 UTC (permalink / raw)
  To: Coulter, Scott; +Cc: gcc

	Please see existing Bugzilla bug report 13391.

David

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

* AIX 5.1 dlopen shared library exception handling problem
@ 2004-02-05 15:12 Coulter, Scott
  2004-02-05 15:16 ` David Edelsohn
  0 siblings, 1 reply; 9+ messages in thread
From: Coulter, Scott @ 2004-02-05 15:12 UTC (permalink / raw)
  To: gcc

On the AIX 5.1 platform, using gcc 3.3.2, and run-time loading a shared library
via dlopen( ), I find that exceptions which are thrown by the shared library and should
be caught by the executable are not, in fact, caught.  If I link in the shared library at 
build-time, but leave the rest of the code unchanged, the relevant catch block
functions as expected.
 
Also, the identical code base functions correctly on Solaris and HPUX with similar gcc builds.
 
Sorry if this is vague; I'm still working to isolate a test-case from our code that I can send along.
 
/home/coultes >gcc -v
Reading specs from /u03/rpas/scott/aix51.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=/u03/rpas/scott/aix51.gcc-3.3.2 --enable-shared --enable-threads=posix --disable-nls --enable-languages=c,c++
Thread model: aix
gcc version 3.3.2

Thanks for any help you can suggest,
Scott Coulter
scott.coulter@retek.com
 

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

end of thread, other threads:[~2004-02-06 15:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-05 18:07 AIX 5.1 dlopen shared library exception handling problem Coulter, Scott
2004-02-05 19:00 ` David Edelsohn
  -- strict thread matches above, loose matches on Subject: below --
2004-02-06 15:41 Coulter, Scott
2004-02-06  8:38 Joerg.Richter
2004-02-05 15:12 Coulter, Scott
2004-02-05 15:16 ` David Edelsohn
2004-02-05 17:22   ` Joe Buck
2004-02-05 17:25     ` David Edelsohn
2004-02-05 17:34       ` Joe Buck

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