wtftw icon indicating copy to clipboard operation
wtftw copied to clipboard

segfalt while loading config module

Open crypt17 opened this issue 6 years ago • 7 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

crypt17 avatar Oct 30 '19 02:10 crypt17

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.

Kintaro avatar Jul 07 '20 06:07 Kintaro

I ended up restructuring the code to remove the config module so.all is good here.

On Tue, 7 Jul 2020, 18:31 Simon Wollwage, [email protected] wrote:

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.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Kintaro/wtftw/issues/141#issuecomment-654631747, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJN5S44K6SYNADEJU3EMZZTR2K6MXANCNFSM4JGSJXKA .

crypt17 avatar Jul 07 '20 07:07 crypt17

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.

raphaelahrens avatar Jan 21 '21 10:01 raphaelahrens

I ended up restructuring the code so that it was not doing a dynamic reload for the config. But since I have not played with wtftw for a jong time I am not sure if I can help much.

On Thu, 21 Jan 2021, 23:22 Raphael Ahrens, [email protected] wrote:

I'm not sure if I have the same issue, but it seems to be similar. @crypt17 https://github.com/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.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Kintaro/wtftw/issues/141#issuecomment-764533826, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJN5S47AD3SAB2Z7UFK57VTS2756TANCNFSM4JGSJXKA .

crypt17 avatar Jan 21 '21 20:01 crypt17

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

raphaelahrens avatar Jan 22 '21 08:01 raphaelahrens

since there seem to be minimal updates to wtftw in the last few years I would tend to recomend looking at something else.

If you want something in rust there is penrose https://github.com/sminez/penrose.

If you don't mind another lanage then the most flexible out there is xmonad which has some nice bideos on cohfiguring it on the distrotube channel on youtube.

I am now using bspwm which has some nice tutorials on brodie robertsons channel on youtube.

On Fri, 22 Jan 2021, 21:03 Raphael Ahrens, [email protected] wrote:

@crypt17 https://github.com/crypt17 Thanks this confirms that this is the same issue. Could you share what you have done?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Kintaro/wtftw/issues/141#issuecomment-765217356, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJN5S4YNVTQ2Y5LPTEQBON3S3EWOHANCNFSM4JGSJXKA .

crypt17 avatar Jan 23 '21 05:01 crypt17

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

Kintaro avatar Jan 23 '21 07:01 Kintaro