teragrep / jpr_01

Java PCRE Library
Apache License 2.0
5 stars 3 forks source link

Check if noexec is enabled before loading native libraries #28

Open StrongestNumber9 opened 3 months ago

StrongestNumber9 commented 3 months ago

Description

Check if noexec is enabled before loading native libraries

Use case or motivation behind the feature request

Getting errors like .cache/JNA/temp/jna2624433973614287324.tmp: failed to map segment from shared object: Operation not permitted

due to noexec being enabled in $HOME, stacktrace points it to being jpr_01

<snip>
  at com.sun.jna.Structure.<init>(Structure.java:204)
  at com.sun.jna.Structure.<init>(Structure.java:191)
  at com.sun.jna.Structure.<init>(Structure.java:183)
  at com.teragrep.jpr_01.JavaPcre$LibJavaPcre$OptionsStruct.<init>(JavaPcre.java:42)
  at com.teragrep.jpr_01.JavaPcre.<init>(JavaPcre.java:187)
  at com.teragrep.pth10.ast.commands.transformstatement.regex.RegexMatch.call(RegexMatch.java:70)
  at com.teragrep.pth10.ast.commands.transformstatement.regex.RegexMatch.call(RegexMatch.java:57)
<snip>

This doesn't seem to be a bug but I am also not sure how feasible it is to do a self sanity check

Additional context

https://github.com/teragrep/pth_10