Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: fjh@mundook.cs.mu.OZ.AU (Fergus Henderson)
Subject: bug in shared library implementation?
Date: 1996/03/24	[thread overview]
Message-ID: <4j3g6b$s94@mulga.cs.mu.OZ.AU> (raw)

I've been building an application on an alpha-dec-osf3.2 system
using shared libraries.  The problem is that my application gets
a segmentation violation when loading in the shared libraries,
before main() is entered.

The application consists of four components, each of which are written in C,
and compiled using gcc version 2.6.3.  Three of these components are
compiled into three shared libraries, and the fourth component is the
main program which I link with these shared libraries.

When I try to debug the program using `dbx', it reports

	$ dbx string_test
	dbx: fatal error: can't continue because process state is AT SIGNAL and
	needs to be DSO

and then exits.  (What does that error message mean?)
If I try to debug the core file produced, dbx gets rather confused:

	$ dbx string_test core
	dbx version 3.11.8
	Type 'help' for help.
	Core file created by program "string_test"


	warning: load address unavailable for /home/mercury/public/mercury-latest/alpha-dec-osf3.2/lib/mercury/lib/alpha-dec-osf3.2/libgc_prof.so
	signal Segmentation fault at 
	warning: PC value 0x3ff80019ecc not valid, trying RA

	warning: RA value 0x3ff80015878 not valid, trying text start

	warning: text start 0x120000000 not valid, trying data start

	warning: Using data start as a text address -- traceback will not work
	> [., 0x140000000] 	call_pal	cflush

When I try to debug the program using `gdb', it reports

	/proc/18164: Bad file number.
	PIOCSTATUS or PIOCWSTOP failed.

before main is entered.  This is probably because the process has
already died before that point.

So the next thing I tried was setting the _RLD_ARGS variable, so that
I could debug the loading of shared libraries.  Setting _RLD_ARGS to `-v'
showed that it got as far as loading the first shared library, and then
died:

	$ _RLD_ARGS=-v ./string_test
	18345:./string_test: /sbin/loader: _RLD_ARGS = "-v"
	18345:./string_test: /sbin/loader: _RLD_ROOT = /
	18345:./string_test: /sbin/loader: mapped Main at 0x120000000
	18345:./string_test: /sbin/loader: mapped /home/mercury/public/mercury-latest/alpha-dec-osf3.2/lib/mercury/lib/reg.gc.prof/alpha-dec-osf3.2/libmercury.so at 0x3ffbff10000
	Segmentation fault - core dumped

Now the wierdest thing of all is that if I set _RLD_ARGS=-interact, it works!
Unfortunately, however, that's only true for this particular test case --
I have some other programs which are linked with the same libraries that
work only if _RLD_ARGS is *not* set to `-interact'.

The problems go away if I link statically.

The same application works fine with shared libraries on IRIX 5 and Solaris.

Does anyone have any idea what could be causing this, or how to fix it
(other than by linking statically)?  I'm totally stumped by this one.
Any hints or even guesses would be greatly appreciated.

--
Fergus Henderson             	WWW: http://www.cs.mu.oz.au/~fjh
fjh@cs.mu.oz.au              	PGP: finger fjh@128.250.37.3



                 reply	other threads:[~1996-03-24  5:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox