Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

faketime causes indefinite hangs in some complex runtimes, like firefox and Sun Java JDK/JRE #373

Open
dkg opened this issue Mar 9, 2022 · 0 comments

Comments

@dkg
Copy link
Collaborator

dkg commented Mar 9, 2022

This might be an unfixable issue given the structure of faketime and the way that some runtimes behave, but i wanted to note it as an outstanding concern for people who come to the faketime bugtracker because they ran into this.

This was first reported in https://bugs.debian.org/753461 , where there is a fair bit of useful commentary.

over there, @wolfcw said:

In this case, the observed behavior is quite typical for applications 
which load system libraries (including time-related functions) 
themselves at run-time. It basically means that the LD_PRELOAD mechanism 
is somewhat bypassed by the application, which loads the real (not the 
faking) library again after the linker has loaded the faking library. 
Strange things (such as slow reactions with few-seconds-offsets or 
endless hangs with larger offsets) occur when the application is 
multi-threaded and one thread sees a faked time while another one uses 
the real system time, and both try to synchronize.

If that's the case with iceweasel (idk for sure atm), there's nothing 
libfaketime can do because that's a limitation of the LD_PRELOAD 
mechanism. This is what makes faketime unusable with a few complex 
runtime environments, such as the Sun Java JDK/JRE, and there currently 
are no stable solutions known except for making the application 
explicitly libfaketime-aware. That said, unless we figure out that this 
is a libfaketime-internal bug and not a LD_PRELOAD limitation, there's 
little hope that it can be changed anytime soon. I'd actually be very 
happy about any suggestions on what to change about libfaketime to make 
it work with such applications.

If there are more ideas about how to characterize the environments where it won't work, or suggestions about possible detection, avoidance or workarounds please note them here.

@dkg dkg changed the title faketime causes indefinite hangs in some complex runtimes, like firefox faketime causes indefinite hangs in some complex runtimes, like firefox and Sun Java JDK/JRE Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants