bazelbuild / bazelbuild/bazel

ijar tool fails with segmentation fault while running in VSCode dev container.

Open
#25,717 4 comments 0 reactions 0 assignees View on GitHub
P3 stale team-Rules-Java type: bug
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the bug:

When running a bazel build, the fetch of an external jar and it's build fails with:

```
ERROR: /home/user/.cache/bazel/_bazel_user/10c9430dffbe74a86264a0142f3f2d37/external/_main~libmatthew_fetch~libmatthew/jar/BUILD:3:12: Extracting interface for jar external/_main~libmatthew_fetch~libmatthew/jar/downloaded.jar failed: (Segmentation fault): ijar failed: error executing JavaIjar command (from target @@_main~libmatthew_fetch~libmatthew//jar:jar) external/remote_java_tools_linux/java_tools/ijar/ijar external/_main~libmatthew_fetch~libmatthew/jar/downloaded.jar ... (remaining 3 arguments skipped)
mmap(): I/O error
```

But when I run from the command line it succeeds:

```
$ bazel-repo/external/remote_java_tools_linux/java_tools/ijar/ijar bazel-repo/external/_main~libmatthew_fetch~libmatthew/jar/downloaded.jar
$ ls bazel-repo/external/_main~libmatthew_fetch~libmatthew/jar/
BUILD downloaded-interface.jar downloaded.jar
```

I'm running this on a Windows 10 laptop, running VSCode with a dev container, the OS below is in the container.

### Which category does this issue belong to?

Java Rules

### What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

_No response_

### Which operating system are you running Bazel on?

Linux ead0f6af3b5d 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 GNU/Linux

### What is the output of `bazel info release`?

release 7.4.1-0

### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.

_No response_

### What's the output of `git remote get-url origin; git rev-parse HEAD` ?

```text

```

### If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.

_No response_

### Have you found anything relevant by searching the web?

_No response_

### Any other information, logs, or outputs that you want to share?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the bazel build from the VSCode dev container on the reported WSL2 Linux environment, comparing it with the direct ijar command on downloaded.jar. Inspect the ijar invocation and the external jar BUILD entry shown in the failure, and confirm that interface extraction completes without a segmentation fault or mmap I/O error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, linux, vscode
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.