You are not logged in.

#1 2023-12-14 16:50:31

gajeet
Member
Registered: 2023-12-14
Posts: 8

Rofi modi scripts terminating with SIG SEGV (Address Boundary Error)

I have a rofi config file as such below:

configuration
{
	modi: "Home:~/.config/rofi/search-home.sh, Storage:~/.config/rofi/search-storage.sh"
	font: "Comic Sans MS Bold 14";
	show-icons: true;
	icon-theme: "candy-icons";
	matching: "normal";
	hover-select: false;
	me-select-entry: "";
	me-accept-entry: [ MousePrimary ];
}
@theme "~/.config/rofi/themes/search.rasi"

and here are the two bash scripts for the respective modi

Home script:

#!/bin/bash

opener="xdg-open"

if [[ -z "$1" ]]; then
    fd . --hidden $HOME 2>/dev/null | sed "s;$HOME;~;g"
else
    selection=$(echo "$1" | sed 's;\~;$HOME; ;s/ /\\ /g; s/\&/\\&/g; s/(/\\(/g; s/)/\\)/g')
    eval $opener "$selection" > /dev/null 2>&1 &
fi

Storage script:

#!/bin/bash

opener="xdg-open"

if [[ -z "$1" ]]; then
    fd . --hidden /mnt/Storage 2>/dev/null
else
    selection=$(echo "$1" | sed 's/ /\\ /g; s/\&/\\&/g; s/(/\\(/g; s/)/\\)/g')
    eval $opener "$selection" > /dev/null 2>&1 &
fi

run command:

rofi -config ~/.config/rofi/search-config.rasi -show Home -sort -sorting-method fzf -i -debug

after running the command, the issue is that when I have something in my prompt and I try to change the rofi modi using the ctrl + tab keybinding rofi gets terminated by SEGV signal

"rofi -config ~/.conf…' terminated by signal SIGSEGV (Address boundary error)"

I have tried with different prompt strings, but it always gets terminated when changing modi a few times. I am not able to figure out what is causing this memory error.
Please help
Thank you <3

Last edited by gajeet (2023-12-15 05:11:31)

Offline

#2 2023-12-14 20:45:56

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 70,466

Re: Rofi modi scripts terminating with SIG SEGV (Address Boundary Error)

Offline

#3 2023-12-15 06:14:44

gajeet
Member
Registered: 2023-12-14
Posts: 8

Re: Rofi modi scripts terminating with SIG SEGV (Address Boundary Error)

Managed to only capture this with the gdb, the laptop just freezes when it encounter the error, then I need to hard reboot using power button.

error

Last edited by gajeet (2023-12-15 08:13:46)

Offline

#4 2023-12-15 08:10:41

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 70,466

Re: Rofi modi scripts terminating with SIG SEGV (Address Boundary Error)

Please replace the oversized image w/ a link (the board has a 250x250px max rule) but w/o the backtrace, that's useless anyway.

the laptop just freezes when it encounter the error

That's not part of you OP?

then I need to hard reboot using power button.

Can you still switch to a different TTY (ctrl+alt+F2,F3,F4,…)?
https://wiki.archlinux.org/title/Keyboa … el_(SysRq) (nb. that you've to actively enable the feature)

Offline

#5 2023-12-15 12:53:30

gajeet
Member
Registered: 2023-12-14
Posts: 8

Re: Rofi modi scripts terminating with SIG SEGV (Address Boundary Error)

Yes I can access the tty3 with the keybinding, but how does it help I can't get the log of the gdb that was running in the terminal, as the system freezes I can't write that info into a file.

Offline

#6 2023-12-15 14:09:30

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 70,466

Re: Rofi modi scripts terminating with SIG SEGV (Address Boundary Error)

It means the system isn't frozen.
If you run a process in gdb it'll stall and you'll have to "continue" it first.
If that's not it, the obvious alternative would be to attach gdb to the rofi process on tty3 (so you're debugging on the console and not in the GUI session)

Offline

#7 2023-12-16 03:17:45

gajeet
Member
Registered: 2023-12-14
Posts: 8

Re: Rofi modi scripts terminating with SIG SEGV (Address Boundary Error)

But rofi is a gui application how will it run on tty?

Offline

#8 2023-12-16 08:12:15

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 70,466

Re: Rofi modi scripts terminating with SIG SEGV (Address Boundary Error)

You still run rofi on the GUI, you just attach gdb to it on the TTY.
Incidentally, I assume the only thing that happens is that rofi grabs the input, gets stalled by gdb and now you've a stalled input grab.
Try if you can replicate the crash when running rofi as "-normal-window" which will prevent the grab.

Offline

#9 2023-12-16 10:23:58

gajeet
Member
Registered: 2023-12-14
Posts: 8

Re: Rofi modi scripts terminating with SIG SEGV (Address Boundary Error)

Okay so this is what I did

First I ran the previously mentioned rofi command with -normal-window option and it worked fine the rofi window showed up with the prompt, then I switched to TTY and logged into my profile, and ran htop found the rofi PID, I quit the htop, and did sudo gdb -p <rofi-pid>, then I switched back to the GUI and found that my rofi window is stalled I am not able to input anything to replicate the error.

Offline

#10 2023-12-16 10:51:02

gajeet
Member
Registered: 2023-12-14
Posts: 8

Re: Rofi modi scripts terminating with SIG SEGV (Address Boundary Error)

Okay so since I was able to use the GUI when running the rofi in the normal window mode, I opened up a terminal and did what as instructed here and was able to get the trace log

trace log:

Thread 13 (Thread 0x7fffd37fe6c0 (LWP 106414) "pool"):
#0  0x00007ffff776273d in syscall () at /usr/lib/libc.so.6
#1  0x00007ffff7cb6cd3 in g_cond_wait_until () at /usr/lib/libglib-2.0.so.0
#2  0x00007ffff7c28185 in  () at /usr/lib/libglib-2.0.so.0
#3  0x00007ffff7c282e7 in g_async_queue_timeout_pop () at /usr/lib/libglib-2.0.so.0
#4  0x00007ffff7c9137e in  () at /usr/lib/libglib-2.0.so.0
#5  0x00007ffff7c8ea05 in  () at /usr/lib/libglib-2.0.so.0
#6  0x00007ffff76e09eb in  () at /usr/lib/libc.so.6
#7  0x00007ffff77647cc in  () at /usr/lib/libc.so.6

Thread 4 (Thread 0x7ffff59966c0 (LWP 106286) "gdbus"):
#0  0x00007ffff7756f6f in poll () at /usr/lib/libc.so.6
#1  0x00007ffff7cbb2b6 in  () at /usr/lib/libglib-2.0.so.0
#2  0x00007ffff7c5db97 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#3  0x00007ffff7eca19c in  () at /usr/lib/libgio-2.0.so.0
#4  0x00007ffff7c8ea05 in  () at /usr/lib/libglib-2.0.so.0
#5  0x00007ffff76e09eb in  () at /usr/lib/libc.so.6
#6  0x00007ffff77647cc in  () at /usr/lib/libc.so.6

Thread 3 (Thread 0x7ffff61976c0 (LWP 106285) "gmain"):
#0  0x00007ffff7756f6f in poll () at /usr/lib/libc.so.6
#1  0x00007ffff7cbb2b6 in  () at /usr/lib/libglib-2.0.so.0
#2  0x00007ffff7c5b162 in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#3  0x00007ffff7c5b1b2 in  () at /usr/lib/libglib-2.0.so.0
#4  0x00007ffff7c8ea05 in  () at /usr/lib/libglib-2.0.so.0
#5  0x00007ffff76e09eb in  () at /usr/lib/libc.so.6
#6  0x00007ffff77647cc in  () at /usr/lib/libc.so.6

Thread 2 (Thread 0x7ffff69986c0 (LWP 106284) "pool-spawner"):
#0  0x00007ffff776273d in syscall () at /usr/lib/libc.so.6
#1  0x00007ffff7cb62f7 in g_cond_wait () at /usr/lib/libglib-2.0.so.0
#2  0x00007ffff7c281b4 in  () at /usr/lib/libglib-2.0.so.0
#3  0x00007ffff7c90a8e in  () at /usr/lib/libglib-2.0.so.0
#4  0x00007ffff7c8ea05 in  () at /usr/lib/libglib-2.0.so.0
#5  0x00007ffff76e09eb in  () at /usr/lib/libc.so.6
#6  0x00007ffff77647cc in  () at /usr/lib/libc.so.6

Thread 1 (Thread 0x7ffff6d21d00 (LWP 106271) "rofi"):
#0  0x000055555559b920 in  ()
#1  0x000055555558207e in  ()
#2  0x00005555555a7cd0 in  ()
#3  0x000055555558de81 in  ()
#4  0x000055555558c090 in  ()
#5  0x000055555558d0da in  ()
#6  0x000055555558c090 in  ()
#7  0x000055555558d0da in  ()
#8  0x000055555558c090 in  ()
#9  0x000055555557f391 in  ()
#10 0x0000555555574797 in process_result ()
#11 0x0000555555580db6 in rofi_view_maybe_update ()
#12 0x0000555555595aa9 in  ()
#13 0x00005555555a4f93 in  ()
#14 0x00007ffff7c5cf69 in  () at /usr/lib/libglib-2.0.so.0
#15 0x00007ffff7cbb367 in  () at /usr/lib/libglib-2.0.so.0
#16 0x00007ffff7c5db97 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#17 0x000055555556d3bb in main ()

Thread 1 "rofi" received signal SIGSEGV, Segmentation fault.
0x000055555559b920 in ?? ()

Offline

#11 2023-12-16 13:09:58

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 70,466

Re: Rofi modi scripts terminating with SIG SEGV (Address Boundary Error)

found that my rofi window is stalled I am not able to input anything to replicate the error.

seth wrote:

If you run a process in gdb it'll stall and you'll have to "continue" it first.

Rofi is included in https://wiki.archlinux.org/title/Debuginfod what should give you a more readable backtrace (notably function symbols)

Offline

#12 2023-12-16 18:49:08

gajeet
Member
Registered: 2023-12-14
Posts: 8

Re: Rofi modi scripts terminating with SIG SEGV (Address Boundary Error)

Okay so here's what I found out:

#0  __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:76
#1  0x00007ffff7c7f348 in g_strdup (str=0x19 <error: Cannot access memory at address 0x19>) at ../glib/glib/gstrfuncs.c:362
        new_str = <optimized out>
        length = <optimized out>
#2  0x000055555558207e in update_callback (t=0x555558cf3830, ico=0x555558cf3250, index=1, udata=0x555558b72e80, type=0x7fffffffdcf0, full=<optimized out>) at source/view.c:1069
        add_list = 0x0
        fstate = 0
        text = <optimized out>
        state = 0x555558b72e80
#3  0x00005555555a7cd0 in update_element.constprop.0 (lv=lv@entry=0x555558cf0360, tb=tb@entry=1, index=index@entry=1, full=1) at source/widgets/listview.c:307
        type = ALT
#4  0x000055555558de81 in listview_draw (draw=0x5555555fb350, wid=0x555558cf0360) at source/widgets/listview.c:491
        i = 1
        width = <optimized out>
        element_width = <optimized out>
        d = 0
        max = <optimized out>
        lv = 0x555558cf0360
        spacing_hori = <optimized out>
        left_offset = <optimized out>
        offset = 0
        spacing_vert = 2
        top_offset = <optimized out>
        lv = 0x555558cf0360
#5  _listview_draw (wid=0x555558cf0360, draw=0x5555555fb350) at source/widgets/listview.c:513
        lv = 0x555558cf0360
#6  0x000055555558c090 in widget_draw (widget=0x555558cf0360, d=0x5555555fb350) at source/widgets/widget.c:247
        margin_top = <optimized out>
        top = <optimized out>
        radius_tl = 0
        radius_br = 0
        vspace = <optimized out>
        y1 = 0
        x1 = 0
        y2 = 500
        radius_bl = 0
        radius_tr = 0
        hspace = <optimized out>
        x2 = 652
        margin_left = <optimized out>
        margin_right = <optimized out>
        margin_bottom = <optimized out>
        left = <optimized out>
        right = <optimized out>
        bottom = <optimized out>
#7  0x000055555558d0da in widget_draw (d=<optimized out>, widget=<optimized out>) at source/widgets/widget.c:142
        child = <optimized out>
        iter = 0x555558cf24c0 = {0x555558cf0360}
        b = <optimized out>
#8  box_draw (wid=<optimized out>, draw=0x5555555fb350) at source/widgets/box.c:270
        child = <optimized out>
        iter = 0x555558cf24c0 = {0x555558cf0360}
        b = <optimized out>
#9  0x000055555558c090 in widget_draw (widget=0x555558b73660, d=0x5555555fb350) at source/widgets/widget.c:247
        margin_top = <optimized out>
        top = <optimized out>
        radius_tl = 0
        radius_br = 0
        vspace = <optimized out>
        y1 = 0
        x1 = 0
        y2 = 500
        radius_bl = 0
        radius_tr = 0
        hspace = <optimized out>
        x2 = 936
        margin_left = <optimized out>
        margin_right = <optimized out>
        margin_bottom = <optimized out>
        left = <optimized out>
        right = <optimized out>
        bottom = <optimized out>
#10 0x000055555558d0da in widget_draw (d=<optimized out>, widget=<optimized out>) at source/widgets/widget.c:142
        child = <optimized out>
        iter = 0x555558b73c70 = {0x555558b73660}
        b = <optimized out>
#11 box_draw (wid=<optimized out>, draw=0x5555555fb350) at source/widgets/box.c:270
        child = <optimized out>
        iter = 0x555558b73c70 = {0x555558b73660}
        b = <optimized out>
#12 0x000055555558c090 in widget_draw (widget=0x555558b73010, d=0x5555555fb350) at source/widgets/widget.c:247
        margin_top = <optimized out>
        top = <optimized out>
        radius_tl = 0
        radius_br = 0
        vspace = <optimized out>
        y1 = 0
        x1 = 0
        y2 = 500
        radius_bl = 0
        radius_tr = 0
        hspace = <optimized out>
        x2 = 936
        margin_left = <optimized out>
        margin_right = <optimized out>
        margin_bottom = <optimized out>
        left = <optimized out>
        right = <optimized out>
        bottom = <optimized out>
#13 0x000055555557f391 in widget_draw (d=0x5555555fb350, widget=<optimized out>) at source/widgets/widget.c:142
        d = 0x5555555fb350
#14 rofi_view_update (state=0x555558b72e80, qr=1) at source/view.c:1145
        d = 0x5555555fb350
#15 0x0000555555574797 in process_result (state=0x555558b72e80) at source/rofi.c:261
        selected_line = <optimized out>
        mretv = <optimized out>
        input = 0x555558d156c0 "Storage"
        retv = <optimized out>
        mode = <optimized out>
        sw = <optimized out>
#16 0x0000555555580db6 in rofi_view_finalize (state=<optimized out>) at source/view.c:1325
#17 rofi_view_maybe_update (state=<optimized out>) at source/view.c:1716
#18 0x0000555555595aa9 in main_loop_x11_event_handler_view (event=0x0) at source/xcb.c:1285
        state = 0x555558b72e80
        type = <optimized out>
#19 main_loop_x11_event_handler (ev=ev@entry=0x555558d0b2b0, user_data=user_data@entry=0x0) at source/xcb.c:1331
        type = <optimized out>
#20 0x00005555555a4f93 in _g_water_xcb_source_dispatch (source=<optimized out>, callback=0x5555555959e0 <main_loop_x11_event_handler>, user_data=0x0) at subprojects/libgwater/xcb/libgwater-xcb.c:97
        self = <optimized out>
        event = 0x555558d0b2b0
        ret = <optimized out>
#21 0x00007ffff7c5cf69 in g_main_dispatch (context=0x5555555fdd20) at ../glib/glib/gmain.c:3476
        dispatch = 0x5555555a4f70 <_g_water_xcb_source_dispatch>
        prev_source = 0x0
        begin_time_nsec = 8458579000142
        was_in_call = 0
        user_data = 0x0
        callback = 0x5555555959e0 <main_loop_x11_event_handler>
        cb_funcs = 0x7ffff7d4d380 <g_source_callback_funcs>
        cb_data = 0x55555560a360
        need_destroy = <optimized out>
        source = 0x5555555fee20
        current = 0x55555562f1a0
        i = 0
        __func__ = "g_main_dispatch"
#22 0x00007ffff7cbb367 in g_main_context_dispatch_unlocked (context=0x5555555fdd20) at ../glib/glib/gmain.c:4284
        max_priority = 2147483647
        timeout = 924
        some_ready = 1
        nfds = 2
        allocated_nfds = 2
        fds = 0x555555658e90
        begin_time_nsec = 8458577917094
#23 g_main_context_iterate_unlocked.isra.0 (context=0x5555555fdd20, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4349
        max_priority = 2147483647
        timeout = 924
        some_ready = 1
        nfds = 2
        allocated_nfds = 2
        fds = 0x555555658e90
        begin_time_nsec = 8458577917094
#24 0x00007ffff7c5db97 in g_main_loop_run (loop=0x5555555fde00) at ../glib/glib/gmain.c:4551
        __func__ = "g_main_loop_run"
#25 0x000055555556d3bb in main (argc=<optimized out>, argv=0x7fffffffe6d8) at source/rofi.c:1137
        path = <optimized out>
        windowid = 0x0
        theme_str = <optimized out>
        interval = 1
        kill_running = <optimized out>
        pfd = 9
        __func__ = "main"

Offline

#13 2023-12-16 18:54:13

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 70,466

Re: Rofi modi scripts terminating with SIG SEGV (Address Boundary Error)

https://github.com/davatorium/rofi/issues

#1  0x00007ffff7c7f348 in g_strdup (str=0x19 <error: Cannot access memory at address 0x19>) at ../glib/glib/gstrfuncs.c:362
        new_str = <optimized out>
        length = <optimized out>
#2  0x000055555558207e in update_callback (t=0x555558cf3830, ico=0x555558cf3250, index=1, udata=0x555558b72e80, type=0x7fffffffdcf0, full=<optimized out>) at source/view.c:1069
        add_list = 0x0
        fstate = 0
        text = <optimized out>
        state = 0x555558b72e80

the add_list nullptr looks incredibly suspicious.

Offline

#14 2023-12-17 07:18:17

gajeet
Member
Registered: 2023-12-14
Posts: 8

Re: Rofi modi scripts terminating with SIG SEGV (Address Boundary Error)

Thank you so much for helping me out I opened up a Bug issue on Git Hub.

Issue link

Offline

Board footer

Powered by FluxBB