dvc94ch / dvc94ch/cargo-trace

syscount-probe build failure: Invalid record

Open
#18 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
40
Forks
0
PR merge metrics
No merged PRs in 30d

Description

I saw your mention of this project [here](https://github.com/iovisor/bcc/issues/1234#issuecomment-787524805) and thought I'd try it out. It doesn't build for me out of the box at `88e3e5a`.

```
$ cargo build
Compiling allprobes v0.1.0 (/home/slamb/git/crates/cargo-trace/examples/allprobes)
Compiling cargo-trace v0.1.0 (/home/slamb/git/crates/cargo-trace/cargo-trace)
Compiling syscount v0.1.0 (/home/slamb/git/crates/cargo-trace/examples/syscount)
error: failed to run custom build command for `syscount v0.1.0 (/home/slamb/git/crates/cargo-trace/examples/syscount)`

Caused by:
process didn't exit successfully: `/home/slamb/git/crates/cargo-trace/target/debug/build/syscount-e2e797b385d546a3/build-script-build` (exit status: 101)
--- stderr
Blocking waiting for file lock on package cache
Blocking waiting for file lock on package cache
Blocking waiting for file lock on package cache
Blocking waiting for file lock on package cache
Compiling syscount-probe v0.1.0 (/home/slamb/git/crates/cargo-trace/examples/syscount/probe)
warning: due to multiple output types requested, the explicitly specified output file name will be adapted for each output type

warning: ignoring --out-dir flag due to -o flag

warning: 2 warnings emitted

Finished release [optimized + debuginfo] target(s) in 0.26s
thread 'main' panicked at 'couldn't compile probes: Compile("syscount-probe", Some("couldn't process IR file: LLVMParseIRInContext failed: /home/slamb/git/crates/cargo-trace/target/debug/build/syscount-533abdd8f526e7d6/out/target/bpf/programs/syscount-probe/syscount-probe-4ac884cf8595263c.bc: error: Invalid record\n"))', examples/syscount/build.rs:12:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed
```

That's with Rust 1.53.0, fwiw, on Ubuntu 21.04 after `apt install llvm-11 clang-11` [to build `llvm-sys` properly](https://gitlab.com/taricorp/llvm-sys.rs/-/issues/16) properly. Looks like you have a checked-in `Cargo.lock` so I think all other relevant software should be exactly as in the repository. I'm not sure why it'd fail just on my setup then. I haven't diagnosed further; I don't know much about LLVM IR...

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the failure with Rust 1.53.0, Ubuntu 21.04, and the referenced commit using `cargo build`. Start with `examples/syscount/build.rs` and the `syscount-probe` build output, then investigate the LLVM IR parsing error for the generated `.bc` file. Done means the syscount probe builds successfully without the Invalid record failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.