afify/sfm

Can't open sfm in DWM

viyoriya opened this issue · 11 comments

  1. I did try to open sfm in st using "st -e sfm" got an error - child terminated due to signal 11

  2. from dwm I couldn't open the sfm and found error in dmesg

dwm config
static const char *sfmcmd[] = { "st","-e","sfm", NULL };

dmesg :
[ 2191.463223] sfm[12387]: segfault at 55c692b3a044 ip 000055c6928d0e5e sp 00007ffcfe4138f0 error 4 in sfm[55c6928cf000+5000]
[ 2228.099152] sfm[12567]: segfault at 56022a04c044 ip 00005602297f2e5e sp 00007ffceb439f60 error 4 in sfm[5602297f1000+5000]

$ coredumpctl info
PID: 107363 (sfm)
UID: 1000
GID: 1000
Signal: 11 (SEGV)
Timestamp: Thu 2021-08-05 13:54:14 BST (3h 15min ago)
Command Line: sfm
Executable: /usr/local/bin/sfm
Control Group: /user.slice/user-1000.slice/session-1.scope
Unit: session-1.scope
Slice: user-1000.slice
Session: 1
Owner UID: 1000
Storage: /var/lib/systemd/coredump/core.sfm.1000.67236f5e79e74e349e45ad8d57fb1103.107363.1628168054000000.zst (present)
Disk Size: 26.7K
Message: Process 107363 (sfm) of user 1000 dumped core.

            Found module linux-vdso.so.1 with build-id: 67a240aff4f3f650a6de241a4cf5a0a6148d7fac
            Found module ld-linux-x86-64.so.2 with build-id: 040cc3dd10461562f177df39e3be2f3704258c3c
            Found module libc.so.6 with build-id: 4b406737057708c0e4c642345a703c47a61c73dc
            Found module libpthread.so.0 with build-id: 07c8f95b4f3251d08550217ad8a1f31066229996
            Found module sfm with build-id: 7c9f4d52cde0a8b47c3bce0612a1dc7eb0e6326c
            Stack trace of thread 107363:
            #0  0x000055805b694e5e n/a (sfm + 0x5e5e)
            #1  0x000055805b69548c n/a (sfm + 0x648c)
            #2  0x000055805b6935f7 n/a (sfm + 0x45f7)
            #3  0x00007f31a41d2b25 __libc_start_main (libc.so.6 + 0x27b25)
            #4  0x000055805b69371e n/a (sfm + 0x471e)
afify commented

@viyoriya please try to open inside st

Sorry for the delay in reply . It works perfectly in st . The problem is opening from dwm key binding .

  1. I did tested "st -e sfm" in st terminal to open an child process with sfm I got an error .
  2. Added a keybinding in dwm nothing happens and found coredumps .

Note:
Nice & cool project and perfect color choices Thanks (I am not a c programmer else I would have fixed it).

It works fine for me though.

screen-capture.mp4

I copied your variable thingy
static const char *sfmcmd[] = { "st","-e","sfm", NULL };

and assigned it to Mod + s.

Spawns st running sfm perfectly fine.

I did check the termbox.c and added TERM (st-256color) , keys and func . Still same error.
After 10 to 12 fast shortcut keypressing its opening some times faster 5 keypress sfm opening :( .

@zion1004 cygwin is added in termbox.c so it will work in my case st-256color is not added

sample.mp4

I think i solved the issue.

Just replace termbox.c termbox.h utf8.c that is here with the same files from https://github.com/termbox/termbox

and recompile sfm

at least that solved the issue for me.

Before that, I got the same problems you had in my arch machine.

afify commented

@viyoriya can you check #22

@zion1004 That's a nice find. Thanks I can open sfm using keypress and st -e sfm too.

@afify I did replace files as per @zion1004 comment and it works. Thanks.

@afify So, do st users have to get termbox separately to make spawing st with sfm work or will the termbox in this repo be changed with the one here https://github.com/termbox/termbox ?

afify commented

@zion1004 i use st dwm in many machines and didn't face this issue (linux & BSD), i'll check when i'm available.