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

failed to map segment from shared object when /tmp is mounted with noexec #240

Open
gssbzn opened this issue Jan 31, 2020 · 2 comments
Open

Comments

@gssbzn
Copy link

gssbzn commented Jan 31, 2020

Currently if you mount the /tmp folder with the noexec option you get

/tmp/snappy-1.1.4-6321baa3-1a72-41b6-bbbc-2b1a642bc8c8-libsnappyjava.so: /tmp/snappy-1.1.4-6321baa3-1a72-41b6-bbbc-2b1a642bc8c8-libsnappyjava.so: failed to map segment from shared object: Operation not permitted
--
at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)

This is true even with the sample code from the README

package test;

import java.io.IOException;
import org.xerial.snappy.Snappy;

/**
 * Snappy example
 *
 */
public class App
{
    public static void main( String[] args ) throws IOException {
        String input = "Hello snappy-java! Snappy-java is a JNI-based wrapper of "
                + "Snappy, a fast compresser/decompresser.";
        byte[] compressed = Snappy.compress(input.getBytes("UTF-8"));
        byte[] uncompressed = Snappy.uncompress(compressed);

        String result = new String(uncompressed, "UTF-8");
        System.out.println(result);
    }
}

Is this expected and should be documented?
Or is there something that can be done to prevent requiring the exec option for tmp

@aleksei-iliushchenko-zocdoc

You can use org.xerial.snappy.tempdir option to define another temp folder. Link

@gssbzn
Copy link
Author

gssbzn commented Mar 16, 2020

@aleksei-iliushchenko-zocdoc yes, that's what we did at the end just wanted to confirm that in fact this is expected and that if you want to use noexec in the default falder then you should use your own tmp dir with exec permissions

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