This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

inconsistent behavior of RT_ADD and RT_DELETE in dlopen/dlclose


hi,

It appears that the RT_ADD and RT_DELETE events generated by the glibc
(version glibc-20041021T0701 from FC3) loader do not really behave in a
consistent way. Since this part of the loader API is a bit loosely
defined (i.e., I did not find any documentation other than the source
code on what it is expected to do), I wonder whether this is the
expected behavior.

What happens
-------------

Scenario 1:
- executable A links against dynamic shared library B
- A calls dlopen/dlclose to load/unload B at runtime in its main func
The loader reports (during the execution of the main function):
- RT_ADD
- RT_CONSISTENT

Scenario 2:
- executable A does not link against dynamic shared library B
- A calls dlopen/dlclose to load/unload B at runtime in its main func
The loader reports (during the execution of the main function):
- RT_ADD
- RT_CONSISTENT
- RT_DELETE
- RT_CONSISTENT

What I expected
---------------

Scenario 1:
nothing to be reported

Scenario 2:
same as what was reported

The rationale is that in the scenario 1, since the library B has been
loaded by the loader before entering the main function, we should not
get any RT_ADD/RT_CONSISTENT event since nothing is really done by
dlopen. dlclose behaves as expected in this regard since it does not
report any event when the library is not really unloaded.

Should I report a bug ?

Mathieu
-- 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]