Kintaro / wtftw

Window Tiling For The Win. A tiling window manager written in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

segfalt while loading config module

crypt17 opened this issue · comments

I am getting a crash in this code block in wtftw/core/src/config.rs

It seems to be in the first line as I have gotten output from debug! just before result().

Any thoughts

    if let Ok(lib) = DynamicLibrary::open(Some(&Path::new(&libname.unwrap().unwrap().path().as_os_str().to_str().unwrap()))) {
        unsafe {
            if let Ok(symbol) = lib.symbol("configure") {
                let result = mem::transmute::<*mut u8, extern fn(&mut WindowManager,
                                                    &dyn WindowSystem,
                                                    &mut Config)>(symbol);

                self.internal.library = Some(lib);
                result(m, w, self);
            } else {
                error!("Error loading config module")
            }
        }
    }

Oct 30 14:58:18 crow kernel: [71420.391043] wtftw[30277]: segfault at 557992ebae08 ip 00007f51e45d4dee sp 00007ffce4888270 error 7 in libconfig.so[7f51e41c5000+5b7000]
Oct 30 14:58:18 crow kernel: [71420.391056] Code: 89 48 08 58 c3 0f 1f 80 00 00 00 00 48 83 ec 18 48 89 3c 24 48 89 74 24 08 89 54 24 10 48 8b 04 24 48 8b 4c 24 08 8b 54 24 10 <48> 89 08 89 50 08 48 83 c4 18 c3 0f 1f 80 00 00 00 00 48 83 ec 10

I upgraded all dependencies and fixed some stuff. For me locally it works now. Feel free to try again.
And sorry for the really long delay. I was bound up in work.

I'm not sure if I have the same issue, but it seems to be similar. @crypt17 maybe you can elaborate on what you did to fix this.

When I put the example config ´config/config.rs´ into ~/.wtftw/src/lib.rs and then run DISPLAY=:1 cargo run in wtftw/ it compiles the config lib and the fails with a segmentation fault.

There seems to be an issue with the dynamic library which is created for the configuration.
I found this threat on SO https://stackoverflow.com/questions/26602353/rust-segfault-when-executing-specific-line-of-code-from-a-dynamically-loaded-li, which describes a similar problem.

When I execute wtftw with RUSTFLAGS="-C prefer-dynamic" cargo run all works fine.

I have rustc version 1.43.1 and the OS is Ubuntu 20.04.

Again I'm unsure if this is the same issue, so it might make sense to move it to a new issue.

@crypt17 Thanks this confirms that this is the same issue. Could you share what you have done?

It should work now. Sorry for the lack of updates, this project is at most in maintenance mode.