fortify / fcli

fcli is a command-line utility for interacting with various Fortify products
https://fortify.github.io/fcli/
Other
32 stars 22 forks source link

Errors shown when running FCLI Java version on RHEL 7.9 #240

Open kadraman opened 1 year ago

kadraman commented 1 year ago

When running fcli on RHEL Linuxusing the Java distribution the following errors are shown:

Failed to load native library:jansi-2.4.0-f0a85c3b55c23dbb-libjansi.so. The native library file at /tmp/jansi-2.4.0-f0a85c3b55c23dbb-libjansi.so is not executable, make sure that the directory is mounted on a partition without the noexec flag, or set the jansi.tmpdir system property to point to a proper location.  osinfo: Linux/x86_64
java.lang.UnsatisfiedLinkError: /tmp/jansi-2.4.0-f0a85c3b55c23dbb-libjansi.so: /tmp/jansi-2.4.0-f0a85c3b55c23dbb-libjansi.so: failed to map segment from shared object: Operation not permitted

This does not stop the successful running of fcli but the error messages and confusing/annoying.

FCLI 1.10 running on RHEL 7.9

rsenden commented 6 months ago

The same/similar issue was reported recently by an fcli user, note that this only applies to fcli.jar as we currently don't initialize Jansi for the native Linux executable (Linux executable is statically linked, so dynamic loading of libraries is not supported).

This is an error message generated by the Java runtime, so not sure whether we can suppress this, for example by temporarily overriding System.out/System.err to suppress any output while initializing Jansi. Even if this is possible, we need to carefully look into this as Jansi itself also overrides System.out and System.err during initialization.

Alternatively, potentially we could skip initializing Jansi on certain platforms (like we already do for native Linux binary), or even skip initialization on any Linux platform (or removing the dynamically linked Linux library from fcli.jar). From memory, we could still use ANSI codes with picocli for example, but not using the native library has a small performance impact.