Skip to content

jSerialComm sets signals to be ignored which are reserved for the JVM risking its integrity #612

@kneisslm

Description

@kneisslm

Observed behavior

At least on Linux jSerialComm sets several signals to be ignored. This is unsupported behaviour for some signals because these are required by the JVM for their own purposes.

The current behaviour is flagged by the JVM when using the check:jni diagnostic option.

Expected behavior

jSerialComm only modifies signal handlers that are strictly necessary for its operation without interfering with other libraries or the JVM itself. If signal handlers are modified, the JVM mechanisms for doing so should be used.

Steps to reproduce

Watch signal handlers using strace or /proc//status.

Observe that once jSerialComm initializes several signal handers are set to SIG_IGN, including for example SIGUSR2.

Code location is https://github.com/Fazecast/jSerialComm/blob/master/src/main/c/Posix/SerialPort_Posix.c#L336

See also

https://docs.oracle.com/en/java/javase/17/troubleshoot/handle-signals-and-exceptions.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions