This is the mail archive of the glibc-bugs@sourceware.org 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]

[Bug libc/25094] New: A successful dlclose() seems to clear the last dynamic link error


https://sourceware.org/bugzilla/show_bug.cgi?id=25094

            Bug ID: 25094
           Summary: A successful dlclose() seems to clear the last dynamic
                    link error
           Product: glibc
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: konrad.schwarz at siemens dot com
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

https://pubs.opengroup.org/onlinepubs/9699919799.2008edition/functions/dlerror.html
states that dlerror() shall return a string that
"describes the last error that occurred during dynamic linking processing."

This would make the following code valid, assuming symbol_table is the
result of a successful dlopen():

   if (!dlsym (symbol_table, "bogus_function_name")) {
       dlclose (symbol_table);
       return dlerror ();
   }

However, a null string is returned to the invoker.

The spec goes on to say that:

  If no dynamic linking errors have occurred since the last invocation of 
  dlerror(), dlerror() shall return NULL. Thus, invoking dlerror() a second 
  time, immediately following a prior invocation, shall result in NULL being 
  returned.

However, that case does not apply to the code above.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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