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

Java processes with libfaketime do not stop when getting SIGTERM #447

Open
eriknellessen opened this issue Dec 12, 2023 · 2 comments
Open

Comments

@eriknellessen
Copy link

When using the current Java 11 version (OpenJDK 11.0.21) in Ubuntu 22.04 and libfaketime 0.9.7-3ubuntu1, java processes do not stop anymore when getting the SIGTERM signal. I tried the following combinations (all in docker containers):

  • Ubuntu 22.04, OpenJDK 11.0.21, libfaketime 0.9.7-3ubuntu1 => The problem exists
  • Ubuntu 20.04, OpenJDK 11.0.21, libfaketime 0.9.7-3ubuntu1 => The problem exists
  • Ubuntu 22.04, OpenJDK 11.0.18, libfaketime 0.9.7-3ubuntu1 => The problem does not exist
  • Ubuntu 22.04, OpenJDK 1.8.0_392, libfaketime 0.9.7-3ubuntu1 => The problem does not exist
  • Ubuntu 20.04, OpenJDK 1.8.0_392, libfaketime 0.9.7-3ubuntu1 => The problem does not exist

When taking a look at the process threads, I could see a lot of SIGTERM handlers:
sigterm_libfaketime

This issue might look similar to this already existing issue: #428
But it is not the same problem. We are not using the faketime binary, but the mechanism with the configuration file /etc/ld.so.preload. The other issue is not about java programs, but a problem that generally occurs when using the faketime binary.

@wolfcw
Copy link
Owner

wolfcw commented Dec 12, 2023

Are you preloading libfaketime.so or libfaketimeMT.so? If the latter, could you try compiling without -DPTHREAD_SINGLETHREADED_TIME in the Makefile and check whether that makes any difference?

libfaketime itself does not establish any signal handlers and thus couldn't get locked up in any of them. Are there any changes in OpenJDK's SIGTERM handler between the two versions?

@eriknellessen
Copy link
Author

We are preloading libfaketime.so (it is called libfaketime.so.1 in Ubuntu).
I could not find any hints about the SIGTERM handler in the release notes of OpenJDK 11.0.19, OpenJDK 11.0.20 and OpenJDK 11.0.21. I should add that I am not an expert concerning the OpenJDK release notes, so it is possible that I missed something.
Today I tried the following combination:

  • Ubuntu 22.04, OpenJDK 11.0.21, libfaketime 0.9.10-2.1 => The problem does not exist

So to me it seems like the problem is fixed somewhere between versions 0.9.7-3ubuntu1 and 0.9.10-2.1. Unfortunately, 0.9.10-2.1 causes performance issues in combination with OpenJDK 11.0.21 (see issue #425), so we still cannot use this version in our setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants