NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Fwd: [libc] dlclose gives "invalid shared object handle" without pthread combination.



Hi,

Ref:
http://www.mail-archive.com/svn-src-all%freebsd.org@localhost/msg10960.html

Log:
  Allow order of initialization of loaded shared objects to be
  altered through their .init code. This might happen if init
  vector calls dlopen on its own and that dlopen causes some not
  yet initialized object to be initialized earlier as part of that
  dlopened DAG.

  Do not reset module reference counts to zero on final fini vector
  run when process is exiting. Just add an additional parameter to
  force fini vector invocation regardless of current reference count
  value if object was not destructed yet. This allows dlclose called
  from fini vector to proceed normally instead of failing with handle
  validation error.

Query:
-------
I have one question regarding " Do not reset module reference counts
to zero on final fini vector
  run when process is exiting".

Observation:
---------------
The above issue normally happened when object is destructed and gives handle
 validation error.

I have expected this is related to dl_refcount issue when process is exiting.

Am just giving some more explanation regarding this issue:

When i tested in the my Linux environment it shows the
dl_reference count is 1 when dlopen and 0 when dlclose.
In this test when the main dlclose invokes, the reference count is decremented
to zero But still other dependent objects are present and for these objects
dl_reference count is required with one(1) to close the handle successfully


Home | Main Index | Thread Index | Old Index