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

Segementation Fault When Reading File With Java App #2001

Closed
jeloba opened this issue Oct 9, 2023 · 3 comments · Fixed by #2003
Closed

Segementation Fault When Reading File With Java App #2001

jeloba opened this issue Oct 9, 2023 · 3 comments · Fixed by #2003
Assignees
Labels
bug Something isn't working

Comments

@jeloba
Copy link

jeloba commented Oct 9, 2023

Bug Description

Reading a file in a Java app (running in a VS Code debugger) triggers a segmentation fault:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f33526e66aa, pid=127287, tid=127295
#
# JRE version: OpenJDK Runtime Environment (17.0.8.1+1) (build 17.0.8.1+1-Ubuntu-0ubuntu122.04)
# Java VM: OpenJDK 64-Bit Server VM (17.0.8.1+1-Ubuntu-0ubuntu122.04, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# C  [libc.so.6+0xe66aa]  readdir64+0x2a
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# hs_err_pid127287.log
#
# If you would like to submit a bug report, please visit:
#   Unknown
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

The config in use contains the following stanza:

{
    "feature": {
        "fs": {
          "mode": "read",
          "read_only": [ "/etc/*" ]
        }
    }
}

Steps to Reproduce

  1. configure and enable mirrord
  2. start a debugging session

Backtrace

Current thread (0x00007f3344046e10):  JavaThread "main" [_thread_in_native, id=127295, stack(0x00007f3350f00000,0x00007f3351000000)]

Stack: [0x00007f3350f00000,0x00007f3351000000],  sp=0x00007f3350ffdfd0,  free space=1015k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libc.so.6+0xe66aa]  readdir64+0x2a

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  sun.nio.fs.UnixNativeDispatcher.readdir(J)[B+0 java.base@17.0.8.1
j  sun.nio.fs.UnixDirectoryStream$UnixDirectoryIterator.readNextEntry()Ljava/nio/file/Path;+52 java.base@17.0.8.1
j  sun.nio.fs.UnixDirectoryStream$UnixDirectoryIterator.hasNext()Z+16 java.base@17.0.8.1
j  java.nio.file.FileTreeWalker.next()Ljava/nio/file/FileTreeWalker$Event;+37 java.base@17.0.8.1
j  java.nio.file.Files.walkFileTree(Ljava/nio/file/Path;Ljava/util/Set;ILjava/nio/file/FileVisitor;)Ljava/nio/file/Path;+255 java.base@17.0.8.1
j  java.nio.file.Files.walkFileTree(Ljava/nio/file/Path;Ljava/nio/file/FileVisitor;)Ljava/nio/file/Path;+11 java.base@17.0.8.1
[...more]

Relevant Logs

No response

Your operating system and version

Ubuntu 22.04.3 LTS

Local process

Java debugger in VS Code

Local process version

No response

Additional Info

For additional context:

  • The location that is accessed is provided by the Vault agent. So it's not located on the main file system.
  • Listing all files in "/" returns results form the local system.
  • Listing all files in "/etc" causes a crash.
@jeloba jeloba added the bug Something isn't working label Oct 9, 2023
@Razz4780 Razz4780 self-assigned this Oct 10, 2023
@Razz4780
Copy link
Contributor

We found the source of the bug and fixed it in #2003
All should work with the next release :)

@eyalb181
Copy link
Member

@jeloba Hey, just letting you know version 3.72.0 of the mirrord binary is now out and contains the fix. Update happens automatically on the VS Code extension. Please let us know if the issue recurs!

@jeloba
Copy link
Author

jeloba commented Oct 13, 2023

I gave it a try and the issue is resolved. Thanks @Razz4780 and @eyalb181 !

@MartinEmrich MartinEmrich mentioned this issue Oct 18, 2023
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants