Operating System - HP-UX
1833415 Members
3557 Online
110052 Solutions
New Discussion

Re: How to suppress warning from the dynamic loader?

 

How to suppress warning from the dynamic loader?


Someone in our group would like to supress warning messages from the dynamic loader, dld.sl.
Can that be done? How?
Maybe an environment variable that can be set?
He knows he can create a stub for his own routine which is not found, but would like to do something simpler

I did "man dld.sl" and looked at DIAGNOSTICS and did not see anything mentioned.

Thanks.

This the mail he sent me:

I have a program that does dlopen on shared library, case when dlopen fails and library is not found is handled. However when I run the executable I get following warning message from the loader

/usr/lib/dld.sl: Can't find path for shared library debug.sl
/usr/lib/dld.sl: No such file or directory

Is there a reason for this warning? and is there an easy way to suppress the warning?

5 REPLIES 5
Biswajit Tripathy
Honored Contributor

Re: How to suppress warning from the dynamic loader?

You are getting the error because dld.sl can't
find your shared lib. If you don't like the warning,
just check in your code if the file exists and then
call dlopen() if it does.

- Biswajit
:-)

Re: How to suppress warning from the dynamic loader?


As I mentioned in the original post, the software handles the case of "library not found" and understands dld.sl can't find the library.

If possible he would prefer to not change the code and deal with checkins for a product close to release. That group is trying to minimize code changes and thinks that if an environment variable exists to suppress the warning, that would be easier for them.

Is there such a method?

Thanks.



rick jones
Honored Contributor

Re: How to suppress warning from the dynamic loader?

But indeed, that error message is saying that the dlopen call is trying to find a shared library called debug.sl and not finding it. Perhaps that is not directly the library being dlopened - it may be listed as a dependency.

If the dependency is not real, then somewhere along the way someone needs to stop linking against that library and that will make the messages go away.

Perhaps it is still real, and someone has "forgotten" to remove some debug code close to release?

I'll get rapidly out of my networking-grounded depth here, but there may be some options on the style of binding - demand or at time of load or somesuch that may affect when debug.sl is sought.

Doing some chatr or ldd against the executable and/or libraries may find where the dependency on debug.sl exists. Also check the manpages for dlopen, chatr, and ldd.

In broad handwaving terms, supressing warning messages is rather like trying to sweep something under the rug. It may suffice for a little while, but later you have an even bigger mess to clean-up. Or if you prefer another analogy :) it is like starting a ticking timb-bomb.
there is no rest for the wicked yet the virtuous have no pillows

Re: How to suppress warning from the dynamic loader?


Rick,
Thanks for the reply.
I will pass it on.
Howard

Re: How to suppress warning from the dynamic loader?



The person knew the error message was occuring because the code uses shl_load
with the BIND_VERBOSE option and they did not want to go through the involved quality assurance process of changing code close to shipment rather adding an environment variable to a script.

Thanks again.