1833051 Members
2349 Online
110049 Solutions
New Discussion

64bit dlclose crashing.

 
Abhay M
New Member

64bit dlclose crashing.

Hi,
I am building 64bit application in which following
is scenario.

from a.out, f.sl is dlopened.
from f.sl, g.sl is dlopened.
f.sl is run-time linked with g.sl.

When f.sl tries to dlclose g.sl, program
says segmentation fault(core dumped).

in folloing ways libraries are built.

cc +DD64 -c *.c
ld -b f.o -ldl -o libf.sl
ld -b -L . -lf -ldl -o libg.sl
ld main.o -lc -ldl

Things are working fine with 32 bit application using shl_load/shl_unload.
Please enlighten me what is going wrong?
Thanx in advance.
-Abhay M.
5 REPLIES 5
Steve Steel
Honored Contributor

Re: 64bit dlclose crashing.

Hi

Check your patch level and the values of
Parameter: maxssiz
Parameter: maxssiz_64bit

In the kernel

This could be a memory leak.

Which OS version are you using.


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
ranganath ramachandra
Esteemed Contributor

Re: 64bit dlclose crashing.

in the second link line you say:
ld -b -L . -lf -ldl -o libg.sl

this doesnt build libg.sl - because of an initial assumption that the linker driver makes about the link being a 32-bit one)- but you cant make it build qith that link line even if you call /usr/ccs/lbin/ld64 directly. so is your libg.sl really built ?

do you know for sure that it is dlclose that is causing the crash ?

i dont see a problem with the following case:
----
cat > 1.c << \!
foo ()
{
bar () ;
}
!
cat > 2.c << \!
#include
#include
bar ()
{
printf ("hello world\n");
}
baz ()
{
void *dl = dlopen ("lib1.sl",RTLD_LAZY);
if (dl == NULL)
puts(dlerror());
void (*foo)() = dlsym (dl,"foo");
if (foo == NULL)
puts(dlerror());
else
(*foo)();
dlclose(dl);
}
!
cat > 3.c << \!
#include
#include
main () {
void *dl = dlopen ("lib2.sl",RTLD_LAZY);
if (dl == NULL)
puts(dlerror());
void (*baz)() = dlsym (dl,"baz");
if (baz == NULL)
puts(dlerror());
(*baz)();
dlclose(dl);
}
!
\rm lib[12].sl [123].o a.out
cc -g -c +DD64 +z [123].c
ld -b 2.o -o lib2.sl -ldl
ld -b 1.o -ldl -L. -l2 -o lib1.sl
ld 3.o -lc -ldl
./a.out
----
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo

Abhay M
New Member

Re: 64bit dlclose crashing.

Hi Ranganath, thanx for reply.

but things u put are also not
working on OS 11.11 and 11.0.
On which platform, you r building?

ranganath ramachandra
Esteemed Contributor

Re: 64bit dlclose crashing.

i confirmed that the test case that i gave you works on both 11.00 and 11.11. please make sure that you have the latest linker/loader patches installed (PHSS_28434 for 11.00 and PHSS_28436 for 11.11). while the patch numbers are different, the linker/loader does not differ much between 11.00 and 11.11.

"what /usr/ccs/lbin/ld64" gives me
92453-07 linker command s800.sgs ld PA64 B.11.36 PBO 030403
so make sure you have at least B.11.33
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo

ranganath ramachandra
Esteemed Contributor

Re: 64bit dlclose crashing.

are you still seeing the problem ? which version of dld are you using ?
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo