Re: block with calling dlopen and dlclose

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: block with calling dlopen and dlclose

Sukender
Hi Alexander,

I found your patch was included in 4.1+ versions of Android. However I'm developing a 4.0.x app which hangs the same way Vivi described.
Am I irremediably doomed until my device goes 4.1? Or do you think there could be another solution? I tried:
- to compile my own linker (libdl.so), but found no way to make my app use it (= can't override system library, enven with LD_LIBRARY_PATH environment variable)
- to compile my own STATIC linker (would be libdl.a) to include everywhere in my app, instead of the dynamic one, but couldn't figure out how to do it. Any clue on how to modify bionic/linker/Android.mk for this?

The worst thing is that I can't be sure those solution will definitely solve my issue. Help!

Regards,

Sukender


On Wednesday, April 11, 2012 11:33:03 AM UTC+2, Alexander Weggerle wrote:
Hi Vivi,

I was seeing a similar behavior before. All the dl_xxx calls can not be called recursively. This happens for example if you use a dl_xxx function in the constructor or destructor of a library the thread will be blocked. We submitted already a patch for this to make the lock of the dl_xxx calls recursive: https://android-review.googlesource.com/#/c/32951/1

Alex

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/fsRMr8E3xrsJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: block with calling dlopen and dlclose

Alexander Weggerle
Hi Sukender,

sorry for the late reply. The solution for you would be to remove all calls to dl_xxx functions from any constructor or destructor of the libraries your application is using. The patch just allows to invoke these functions recursively. 

Hope this helps!
Alex

On Thursday, December 13, 2012 12:30:58 PM UTC+1, Sukender wrote:
I found your patch was included in 4.1+ versions of Android. However I'm developing a 4.0.x app which hangs the same way Vivi described.
Am I irremediably doomed until my device goes 4.1? Or do you think there could be another solution? I tried:
- to compile my own linker (libdl.so), but found no way to make my app use it (= can't override system library, enven with LD_LIBRARY_PATH environment variable)
- to compile my own STATIC linker (would be libdl.a) to include everywhere in my app, instead of the dynamic one, but couldn't figure out how to do it. Any clue on how to modify bionic/linker/Android.mk for this?

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/7QqmACHxc7EJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: block with calling dlopen and dlclose

dtx0
In reply to this post by Sukender
You have extra semi-colons following your macros. The semi-colon would be required if they'd been written with "do { ... } while (0)", which I recommend anyway (although it may generate less efficient code). Also, you shouldn't be using printf. Instead, use errno to catalog the error and strerr to output. Remember, printf goes to stdout and errors/ warning belong in stderr.



On Tuesday, April 10, 2012 11:27:10 PM UTC-7, vivi wrote:
Hi all!
  I find out that my exe is blocked when calling dlopen to load some
shared libraries which third-party supported.
  No return from dlopen, just like call sleep(10000...) and never wake
up.
  I also see the same phenomenon when calling dlclose.
  What kind of things can make these situations?
  Please help me!

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-ndk/-/lL9uae5MLIsJ.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.