Improve detection for `noexec` for default extraction location
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Read SQLiteJDBCLoader.extractAndLoadLibraryFile around the permission-setting calls cited in the issue, then trace how extraction failures become UnsatisfiedLinkError. Check how File.setExecutable and canExecute behave for the extracted library on Linux with a noexec temporary directory. Done when users receive actionable troubleshooting information for permission failures, including how to select an executable temporary directory.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Is your feature request related to a problem? Please describe.
When /tmp is mounted as noexec on Linux, sqlite-jdbc fails to load the native library with an error similar to the following:
java.lang.UnsatisfiedLinkError: /tmp/sqlite-...-libsqlitejdbc.so: /tmp/sqlite-...-libsqlitejdbc.so: failed to map segment from shared object
Users can fix this by not mounting /temp as noexec, or by specifying a custom java.io.tmpdir or org.sqlite.tmpdir system property value pointing to an (existing) directory with execution permission.
But just based on the UnsatisfiedLinkError above, it might not obvious to users what the cause is, or how to fix it.
See related issues:
- #97 (some of the comments there)
- #571
Describe the solution you'd like
sqlite-jdbc should try to detect noexec or other permission errors and report them properly before trying to load the native library and causing an UnsatisfiedLinkError,
or better (?) trigger an UnsatisfiedLinkError but attach additional information, such as whether permissions are correct.
Additionally it could suggest to set the java.io.tmpdir or org.sqlite.tmpdir system property value to an (existing) directory with execution permission.
Additional context
Maybe the checks in SQLiteJDBCLoader.extractAndLoadLibraryFile should be improved:
https://github.com/xerial/sqlite-jdbc/blob/2e336d9ecd40cf00e76ae71564a903e67afc163b/src/main/java/org/sqlite/SQLiteJDBCLoader.java#L207-L209
Issues with the current implementation:
- It does not check the return value of the
setReadable, ... calls - After the
setExecutablecall it should callfile.canExecute()
It seems fornoexecfile.setExecutable(true)succeeds butfile.canExecute()is stillfalseafterwards, so it could be detected like this.
However, I am not that familiar with Linux and the implementation details of java.io.File, so maybe there are cases where for example setReadable, ... fails but the library can still be loaded.
So maybe these checks should only be performed if an UnsatisfiedLinkError occurs, to provide additional troubleshooting information.
Potentially useful: https://github.com/netty/netty/pull/6707, but I am not sure if using PosixFilePermission is really needed or if using the java.io.File API suffices.
- Lenguaje dominante
- Java
- Estrellas
- 3.3k
- Forks
- 676
- Merge medio
- 1 d 15 h
- PR fusionados (30 d)
- 18
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de xerial/sqlite-jdbc
-
triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
xerial/sqlite-jdbc#1515 ·
Los mantenedores suelen responder en 1 día
-
triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
xerial/sqlite-jdbc#1514 ·
Los mantenedores suelen responder en 1 día
-
triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
xerial/sqlite-jdbc#1513 ·
Los mantenedores suelen responder en 1 día
-
triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
xerial/sqlite-jdbc#1512 ·
Los mantenedores suelen responder en 1 día
-
SIGSEGV (exit 134) in bundled `rightstr()` when the length argument is a large negative numberPosiblemente ocupada @sarthakdev143-lite la tomó hace 2 días. Abiertohelp wanted impacts:JNI
Dificultad 4/5 1-2 días Aptitud para principiantes 38/100
xerial/sqlite-jdbc#1508 ·
Los mantenedores suelen responder en 1 día
Todos los issues de xerial/sqlite-jdbc
Issues similares
-
hermes-queue
Dificultad 1/5 1-3 horas Aptitud para principiantes 85/100
chrisalunlloyd2-sudo/mindpalace#403 ·
Los mantenedores suelen responder en 1 día
-
Area/Configuration Type/Improvement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
ballerina-platform/static-code-analysis-tool#217 ·
Los mantenedores suelen responder en 1 día
-
SequenceEncoder: a value ending with a backslash swallows the tokens after it (“No state for trait”)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
vassalengine/vassal#15337 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
eclipse-dirigible/dirigible#8636 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug severity-medium XS
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
nikolas-charalambidis/facepalm-maven-plugin#291 ·
Los mantenedores suelen responder en 1 día