casaroli opened a new pull request, #3691:
URL: https://github.com/apache/nuttx-apps/pull/3691

   ## Summary
   
   `dlopen()` of an already loaded library used to fail, so nothing exercised 
what happens when two callers hold the same object.
   
   This opens the library a second time, checks the same handle comes back, 
closes one of the two handles and checks the library is still usable through 
the other.
   
   ## Testing
   
   Paired with apache/nuttx#19639; without that change the second `dlopen()` 
returns `NULL` and this test reports it.
   
   Run on `lm3s6965-ek` under QEMU with `CONFIG_EXAMPLES_SOTEST`, `CONFIG_ELF`, 
`CONFIG_LIBC_ELF` and `CONFIG_LIBC_DLFCN`.
   
   Without apache/nuttx#19639:
   
   ```
   ERROR: dlopen(/mnt/sotest/romfs/sotest) failed on an already loaded library
   ```
   
   With it:
   
   ```
   testfunc3: Let's talk again very soon
      caller: Yes, don't be a stranger!
   testfunc1: Hello, everyone!
      caller: Yes, don't be a stranger!
   module_uninitialize
   ```
   
   The repeated `testfunc1` is the library still working after one of the two 
handles was closed, and `module_uninitialize` is it unloading once the last one 
went.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to