Operating System - HP-UX
1833730 Members
2202 Online
110063 Solutions
New Discussion

Re: -lnsl static on hpux11 cause a core dump

 
Fourdan
New Member

-lnsl static on hpux11 cause a core dump

Hi all,

When using gethostbyname() on HP-UX 11 within a statically linked application (or dynamically with dld only) the program cores.

However, compiling with nsl linked dynamically, the program works fine. Unfortunately, this doesn't seem to be an option as static linking is required as much as possible (for various reasons that I won't enumerate here)

So my question:

- Why static linking causes a core?
- Why does this used to work with hpux 10.20?
- How can I avoid this w/out using dynamic linking on hpux11?
- And finally, if this is unavoidable, could someone point me to some documenation that clearly explain why so I can report this?

Thanks in advance for your help,

Best regards,
Olivier.
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: -lnsl static on hpux11 cause a core dump

You might want to consider finding out what the real problem is.

In the script, add this code:

pid=$$
TF="${TRACE_FILE}.${pid}.dat"
export TF
/usr/contrib/bin/tusc -o $TF -f -p $pid &

This will initiate a tusc trace including forks on the process. Find out why you are getting a core. Maybe it has nothing to do with the OS upgrade.

OS's change, there are valid reasons for that.

Here is a link for tusc:

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/tusc-7.5/

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Fourdan
New Member

Re: -lnsl static on hpux11 cause a core dump

Hi Steven,

Thx for your reply. Actually, the problem seems to be known (by looking at various forum archives), but I couldn't find the fix or an explanation of why dynamic linking of nsl is required on hpux11.

As for the cause, it occurs in the nsl library as shown by the debugger.

I attach a very simple test program that exhibits the described behavour.

Cheers,
Olivier.
ranganath ramachandra
Esteemed Contributor

Re: -lnsl static on hpux11 cause a core dump

i could not reproduce this on a 11.00 machine with PHNE_20371.
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo

ranganath ramachandra
Esteemed Contributor

Re: -lnsl static on hpux11 cause a core dump

i'm sorry that should be PHNE_24909 .
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo

Fourdan
New Member

Re: -lnsl static on hpux11 cause a core dump

Hi,

Sorry, I didn't mention, I'm running 11.11.

Looks like the patch equivalent for 11.11 is PHNE_29211, most recent being PHNE_29783.

I'll give that a try :) If it fixes the issue, I'll definitely post the result on this thread.

Thanks,
Olivier.
rick jones
Honored Contributor

Re: -lnsl static on hpux11 cause a core dump

I cannot speak directly to the reason for the core, but can say this.

At time has passed, and as time continues to pass, the ability to link applications staticly will diminish.

It would be good to start taking a closer look at the unenumerated reasons and see if something can be done about them.
there is no rest for the wicked yet the virtuous have no pillows