Description
While building rust sources (in Yocto distro for custom target - i686-poky-linux-gnu), when the 'p384' crate compiling we are getting 'signal: 11, SIGSEGV: invalid memory reference' error. This issue is occurring when build is for 32-bit architecture machines with DEBUG enabled.
Initially it was seen with LLVM version: 16.0.5 and we could reproduce the issue with LLVM version: 17.0.4.
Below is the error text with LLVM version: 17.0.4:
error: rustc interrupted by SIGSEGV, printing backtrace
/home/skokkonda/00_Work/12360/mini/recipe-sysroot-native/usr/bin/../lib/librustc_driver-af0ab23c1eb07079.so(+0x9ea726)[0x7ff413b9f726]
/home/skokkonda/00_Work/12360/poky/build/tmp/sysroots-uninative/x86_64-linux/lib/libc.so.6(+0x391f0)[0x7ff412de91f0]
/home/skokkonda/00_Work/12360/mini/recipe-sysroot-native/usr/bin/../lib/librustc_driver-af0ab23c1eb07079.so(+0x2e15dbe)[0x7ff415fcadbe]
/home/skokkonda/00_Work/12360/mini/recipe-sysroot-native/usr/bin/../lib/librustc_driver-af0ab23c1eb07079.so(+0x2e15f01)[0x7ff415fcaf01]
/home/skokkonda/00_Work/12360/mini/recipe-sysroot-native/usr/bin/../lib/librustc_driver-af0ab23c1eb07079.so(+0x2e15fb6)[0x7ff415fcafb6]
/home/skokkonda/00_Work/12360/mini/recipe-sysroot-native/usr/bin/../lib/librustc_driver-af0ab23c1eb07079.so(+0x2e7d7d9)[0x7ff4160327d9]
/home/skokkonda/00_Work/12360/mini/recipe-sysroot-native/usr/bin/../lib/librustc_driver-af0ab23c1eb07079.so(+0x2cdccf9)[0x7ff415e91cf9]
/home/skokkonda/00_Work/12360/mini/recipe-sysroot-native/usr/bin/../lib/librustc_driver-af0ab23c1eb07079.so(+0x2c64abe)[0x7ff415e19abe]
/home/skokkonda/00_Work/12360/mini/recipe-sysroot-native/usr/bin/../lib/librustc_driver-af0ab23c1eb07079.so(+0x2cda7c4)[0x7ff415e8f7c4]
/home/skokkonda/00_Work/12360/mini/recipe-sysroot-native/usr/bin/../lib/librustc_driver-af0ab23c1eb07079.so(+0x1afe8b3)[0x7ff414cb38b3]
/home/skokkonda/00_Work/12360/mini/recipe-sysroot-native/usr/bin/../lib/librustc_driver-af0ab23c1eb07079.so(+0x1b2300b)[0x7ff414cd800b]
### cycle encountered after 11 frames with period 12
/home/skokkonda/00_Work/12360/mini/recipe-sysroot-native/usr/bin/../lib/librustc_driver-af0ab23c1eb07079.so(+0x1b23bc8)[0x7ff414cd8bc8]
/home/skokkonda/00_Work/12360/mini/recipe-sysroot-native/usr/bin/../lib/librustc_driver-af0ab23c1eb07079.so(+0x1b23bc8)[0x7ff414cd8bc8]
/home/skokkonda/00_Work/12360/mini/recipe-sysroot-native/usr/bin/../lib/librustc_driver-af0ab23c1eb07079.so(+0x1b23bc8)[0x7ff414cd8bc8]
/home/skokkonda/00_Work/12360/mini/recipe-sysroot-native/usr/bin/../lib/librustc_driver-af0ab23c1eb07079.so(+0x1b23bc8)[0x7ff414cd8bc8]
/home/skokkonda/00_Work/12360/mini/recipe-sysroot-native/usr/bin/../lib/librustc_driver-af0ab23c1eb07079.so(+0x1b23bc8)[0x7ff414cd8bc8]
/home/skokkonda/00_Work/12360/mini/recipe-sysroot-native/usr/bin/../lib/librustc_driver-af0ab23c1eb07079.so(+0x1b23bc8)[0x7ff414cd8bc8]
/home/skokkonda/00_Work/12360/mini/recipe-sysroot-native/usr/bin/../lib/librustc_driver-af0ab23c1eb07079.so(+0x1b23bc8)[0x7ff414cd8bc8]
/home/skokkonda/00_Work/12360/mini/recipe-sysroot-native/usr/bin/../lib/librustc_driver-af0ab23c1eb07079.so(+0x1b23bc8)[0x7ff414cd8bc8]
/home/skokkonda/00_Work/12360/mini/recipe-sysroot-native/usr/bin/../lib/librustc_driver-af0ab23c1eb07079.so(+0x1b23bc8)[0x7ff414cd8bc8]
/home/skokkonda/00_Work/12360/mini/recipe-sysroot-native/usr/bin/../lib/librustc_driver-af0ab23c1eb07079.so(+0x1b23bc8)[0x7ff414cd8bc8]
/home/skokkonda/00_Work/12360/mini/recipe-sysroot-native/usr/bin/../lib/librustc_driver-af0ab23c1eb07079.so(+0x1b23bc8)[0x7ff414cd8bc8]
/home/skokkonda/00_Work/12360/mini/recipe-sysroot-native/usr/bin/../lib/librustc_driver-af0ab23c1eb07079.so(+0x1b23bc8)[0x7ff414cd8bc8]
### recursed 20 times
/home/skokkonda/00_Work/12360/mini/recipe-sysroot-native/usr/bin/../lib/librustc_driver-af0ab23c1eb07079.so(+0x1b23bc8)[0x7ff414cd8bc8]
/home/skokkonda/00_Work/12360/mini/recipe-sysroot-native/usr/bin/../lib/librustc_driver-af0ab23c1eb07079.so(+0x1b23bc8)[0x7ff414cd8bc8]
/home/skokkonda/00_Work/12360/mini/recipe-sysroot-native/usr/bin/../lib/librustc_driver-af0ab23c1eb07079.so(+0x1b23bc8)[0x7ff414cd8bc8]
/home/skokkonda/00_Work/12360/mini/recipe-sysroot-native/usr/bin/../lib/librustc_driver-af0ab23c1eb07079.so(+0x1b23bc8)[0x7ff414cd8bc8]
/home/skokkonda/00_Work/12360/mini/recipe-sysroot-native/usr/bin/../lib/librustc_driver-af0ab23c1eb07079.so(+0x1b23bc8)[0x7ff414cd8bc8]
rust version info:
rustc 1.74.1 (a28077b28 2023-12-04) (built from a source tarball)
binary: rustc
commit-hash: a28077b28a02b92985b3a3faecf92813155f1ea1
commit-date: 2023-12-04
host: x86_64-unknown-linux-gnu
release: 1.74.1
LLVM version: 17.0.4
This we've discussed in rust community - rust-lang/rust#113612 (comment) and, we suspect that the issue is from llvm function - llvm::AsmPrinter::emitDwarfDIE(llvm::DIE const&) const
The gbd back trace is here - rust-lang/rust#113612 (comment)
The attached 'p384.zip' contains the llvm-ir file.
p384.zip