Skip to content

Segmentfault when building fastfetch #116

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

Closed
tannal opened this issue May 6, 2024 · 5 comments
Closed

Segmentfault when building fastfetch #116

tannal opened this issue May 6, 2024 · 5 comments

Comments

@tannal
Copy link

tannal commented May 6, 2024

Setps to reproduce:
Ninja is a symbol link to n2.

git clone https://github.com/fastfetch-cli/fastfetch.git
cmake -G Ninja -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE='Debug'
ninja -C build

Stacktrace

[=-------------------------------------- ] 5/181 done, 16/174 running
Building C object CMakeFiles/libfastfetch.dir/src/modules/wifi/wifi.c.o
Building C object CMakeFiles/libfastfetch.dir/src/modules/terminalsize/terminalsize.c.o
Building C object CMakeFiles/libfastfetch.dir/src/detection/disk/disk.c.o
Building C object CMakeFiles/libfastfetch.dir/src/common/printing.c.o
Building C object CMakeFiles/libfastfetch.dir/src/detection/terminalshell/terminalshell.c.o
Building C object CMakeFiles/libfastfetch.dir/src/modules/camera/camera.c.o
Building C object CMakeFiles/libfastfetch.dir/src/modules/separator/separator.c.o
Building C object CMakeFiles/libfastfetch.dir/src/detection/displayserver/linux/wmde.c.o
...and 8 more
[New Thread 0x15552fdff700 (LWP 81130)]
[Thread 0x15552fdff700 (LWP 81098) exited]
[New Thread 0x15554f7ff700 (LWP 81132)]
[Thread 0x15554f7ff700 (LWP 81078) exited]

Thread 20 "n2" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x15552fdff700 (LWP 81130)]
0x00001555549c00d8 in realloc () from /lib64/libc.so.6
Missing separate debuginfos, use: yum debuginfo-install glibc-2.28-236.el8_9.12.x86_64 libgcc-8.5.0-20.el8.x86_64
(gdb) bt
#0  0x00001555549c00d8 in realloc () from /lib64/libc.so.6
#1  0x0000155554a422f2 in __posix_spawn_file_actions_realloc () from /lib64/libc.so.6
#2  0x0000155554a42490 in posix_spawn_file_actions_addopen () from /lib64/libc.so.6
#3  0x00005555555a6231 in n2::process_posix::PosixSpawnFileActions::addopen (self=0x15552fdfd080, fd=0, path=..., oflag=0, mode=0)
    at src/process_posix.rs:98
#4  n2::process_posix::run_command (
    cmdline="/usr/bin/cc -DFF_HAVE_EGL=1 -DFF_HAVE_GIO=1 -DFF_HAVE_GLX=1 -DFF_HAVE_OPENCL=1 -DFF_HAVE_STATX -DFF_HAVE_THREADS -DFF_HAVE_WCWIDTH -DFF_HAVE_X11=1 -DFF_HAVE_XCB=1 -DFF_HAVE_XCB_RANDR=1 -DFF_HAVE_ZLIB="..., output_cb=...) at src/process_posix.rs:169
#5  n2::task::run_task (
    cmdline="/usr/bin/cc -DFF_HAVE_EGL=1 -DFF_HAVE_GIO=1 -DFF_HAVE_GLX=1 -DFF_HAVE_OPENCL=1 -DFF_HAVE_STATX -DFF_HAVE_THREADS -DFF_HAVE_WCWIDTH -DFF_HAVE_X11=1 -DFF_HAVE_XCB=1 -DFF_HAVE_XCB_RANDR=1 -DFF_HAVE_ZLIB="..., depfile=..., rspfile=<optimized out>, last_line_cb=..., 
    parse_showincludes=<optimized out>) at src/task.rs:129
#6  n2::task::Runner::start::{{closure}} () at src/task.rs:223
#7  std::sys_common::backtrace::__rust_begin_short_backtrace (f=...)
    at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys_common/backtrace.rs:155
#8  0x0000555555583402 in core::ops::function::FnOnce::call_once{{vtable-shim}} ()
    at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/thread/mod.rs:528
#9  0x00005555555e2815 in std::sys::pal::unix::thread::Thread::new::thread_start () at library/alloc/src/boxed.rs:2020
#10 0x0000155554ef51ca in start_thread () from /lib64/libpthread.so.0
#11 0x000015555495de73 in clone () from /lib64/libc.so.6
@Colecf
Copy link
Contributor

Colecf commented May 6, 2024

This is due to a bug in the latest version of the libc crate: rust-lang/libc#3677

You can fix it by not updating n2's Cargo.lock, or by adding libc = "=0.2.153" to the Cargo.toml.

@tannal
Copy link
Author

tannal commented May 6, 2024

Thanks, it's happy now.

@tannal tannal closed this as completed May 6, 2024
@evmar
Copy link
Owner

evmar commented May 6, 2024

Just checking, the lock file we have should pin us to a working version right?

@tannal
Copy link
Author

tannal commented May 6, 2024

Probably not, I think.

n2/Cargo.lock

Line 346 in 15a580d

version = "0.2.146"

image

Edited: maybe we need to update the readme to use --locked

cargo install --git https://github.com/evmar/n2 --locked

cargo install will select the latest dependencies unless --locked is passed in.

evmar added a commit that referenced this issue May 6, 2024
Apparently `cargo install` means "install using versions I've never tested",
while `cargo install --locked` means "install using the versions I specified".

Fixes #116.
@evmar
Copy link
Owner

evmar commented May 6, 2024

Thanks, TIL and I updated the readme.

evmar added a commit that referenced this issue May 6, 2024
Apparently `cargo install` means "install using versions I've never tested",
while `cargo install --locked` means "install using the versions I specified".

Fixes #116.
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

3 participants