Skip to content

Conversation

@pavly-gerges
Copy link
Member

This issue was introducing potential memory leaks on failure of the stack memory to accomodate the overstacked calls to the loadBinary() and cleanExtractBinary() stacks.

The issue #32. happens commonly as a result of attempting to extract an originally-shipped corrupted binary or trying to load a non-binary file, in either ways the function pointer table is broken.

@pavly-gerges pavly-gerges added enhancement New feature or request core Core API related stuff labels Mar 10, 2025
@pavly-gerges pavly-gerges added this to the 1.1.0-stable Release milestone Mar 10, 2025
@pavly-gerges
Copy link
Member Author

This is a test to the new API:

SEVERE: Cannot load the dynamic library: /media/pavl/pavl-g/Projects/jSnapLoader/snaploader-examples/libs/Linux/amd64/libjmealloc.so
java.lang.UnsatisfiedLinkError: /media/pavl/pavl-g/Projects/jSnapLoader/snaploader-examples/libs/Linux/amd64/libjmealloc.so: /media/pavl/pavl-g/Projects/jSnapLoader/snaploader-examples/libs/Linux/amd64/libjmealloc.so: file too short
        at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
        at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:331)
        at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:197)
        at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:139)
        at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2404)
        at java.base/java.lang.Runtime.load0(Runtime.java:817)
        at java.base/java.lang.System.load(System.java:2015)
        at electrostatic4j.snaploader.NativeBinaryLoader.loadBinary(NativeBinaryLoader.java:264)
        at electrostatic4j.snaploader.NativeBinaryLoader$1.onExtractionCompleted(NativeBinaryLoader.java:316)
        at electrostatic4j.snaploader.filesystem.FileExtractor.extract(FileExtractor.java:149)
        at electrostatic4j.snaploader.filesystem.ConcurrentFileExtractor.extract(ConcurrentFileExtractor.java:72)
        at electrostatic4j.snaploader.NativeBinaryLoader.cleanExtractBinary(NativeBinaryLoader.java:357)
        at electrostatic4j.snaploader.NativeBinaryLoader.loadBinary(NativeBinaryLoader.java:288)
        at electrostatic4j.snaploader.NativeBinaryLoader$1.onExtractionCompleted(NativeBinaryLoader.java:316)
        at electrostatic4j.snaploader.filesystem.FileExtractor.extract(FileExtractor.java:149)
        at electrostatic4j.snaploader.filesystem.ConcurrentFileExtractor.extract(ConcurrentFileExtractor.java:72)
        at electrostatic4j.snaploader.NativeBinaryLoader.cleanExtractBinary(NativeBinaryLoader.java:357)
        at electrostatic4j.snaploader.NativeBinaryLoader.loadBinary(NativeBinaryLoader.java:288)
        at electrostatic4j.snaploader.NativeBinaryLoader.loadLibrary(NativeBinaryLoader.java:163)
        at electrostatic4j.snaploader.examples.TestRetryExhaustionException.main(TestRetryExhaustionException.java:79)

Mar 11, 2025 7:00:30 AM electrostatic4j.snaploader.NativeBinaryLoader$1 cleanExtractBinary
SEVERE: Error while loading the binary!
electrostatic4j.snaploader.throwable.LoadingRetryExhaustionException: Library loading retries exceeded the maximum!
        at electrostatic4j.snaploader.NativeBinaryLoader.loadBinary(NativeBinaryLoader.java:284)
        at electrostatic4j.snaploader.NativeBinaryLoader$1.onExtractionCompleted(NativeBinaryLoader.java:316)
        at electrostatic4j.snaploader.filesystem.FileExtractor.extract(FileExtractor.java:149)
        at electrostatic4j.snaploader.filesystem.ConcurrentFileExtractor.extract(ConcurrentFileExtractor.java:72)
        at electrostatic4j.snaploader.NativeBinaryLoader.cleanExtractBinary(NativeBinaryLoader.java:357)
        at electrostatic4j.snaploader.NativeBinaryLoader.loadBinary(NativeBinaryLoader.java:288)
        at electrostatic4j.snaploader.NativeBinaryLoader$1.onExtractionCompleted(NativeBinaryLoader.java:316)
        at electrostatic4j.snaploader.filesystem.FileExtractor.extract(FileExtractor.java:149)
        at electrostatic4j.snaploader.filesystem.ConcurrentFileExtractor.extract(ConcurrentFileExtractor.java:72)
        at electrostatic4j.snaploader.NativeBinaryLoader.cleanExtractBinary(NativeBinaryLoader.java:357)
        at electrostatic4j.snaploader.NativeBinaryLoader.loadBinary(NativeBinaryLoader.java:288)
        at electrostatic4j.snaploader.NativeBinaryLoader.loadLibrary(NativeBinaryLoader.java:163)
        at electrostatic4j.snaploader.examples.TestRetryExhaustionException.main(TestRetryExhaustionException.java:79)


BUILD SUCCESSFUL in 2s
4 actionable tasks: 1 executed, 3 up-to-date

@pavly-gerges pavly-gerges merged commit ac75c9c into master Mar 11, 2025
6 checks passed
@pavly-gerges pavly-gerges deleted the stofe-limit-routines branch March 11, 2025 12:15
@pavly-gerges pavly-gerges changed the title Attempt to fix StackOverflowExceptions from Over Stacked Loading Retries NativeBinaryLoader: Attempt to fix StackOverflowExceptions from Over Stacked Loading Retries Mar 12, 2025
@pavly-gerges pavly-gerges changed the title NativeBinaryLoader: Attempt to fix StackOverflowExceptions from Over Stacked Loading Retries NativeBinaryLoader: attempt to fix StackOverflowExceptions from Over Stacked Loading Retries Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core API related stuff enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[StackOverFlowException] Limit the retry routines using numbers or boolean flags

2 participants