foot coredumps/SIGSEGV occasionally in foot/grid.c #552

Closed
opened 5 months ago by sochotnicky · 13 comments

I have experienced an occasional foot coredump. Top of the traceback from gdb is as follows:

#0  0x0000562a600eb5e4 in ensure_row_has_extra_data (row=row@entry=0x0) at ../foot/grid.c:684
No locals.
#1  grid_row_add_uri_range (row=row@entry=0x0, range=...) at ../foot/grid.c:691
No locals.
#2  0x0000562a600f6819 in term_osc8_close (term=term@entry=0x562a6176f040) at ../foot/terminal.c:3127
        end_col = 126
        row = 0x0
        range = {start = 0, end = 126, id = 347040475148719253, uri = 0x562a6178b540 "https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wdeprecated-declarations"}
        start = {col = <optimized out>, row = <optimized out>}
        end = {col = 13, row = 0}
        r = 2048
        start_col = 0
#3  0x0000562a600fee48 in osc_uri (string=<optimized out>, term=0x562a6176f040) at ../foot/osc.c:490
        params = <optimized out>
        params_end = 0x562a617c9892 ""
        ctx = 0x562a617c9892 ""
        uri = 0x562a617c9893 ""
        id = 3943155470736684728
        params = <optimized out>
        params_end = <optimized out>
        uri = <optimized out>
        id = <optimized out>
        ctx = <optimized out>
        key_value = <optimized out>
        key = <optimized out>
        operator = <optimized out>
        value = <optimized out>
#4  osc_dispatch (term=term@entry=0x562a6176f040) at ../foot/osc.c:678
        color = 1635555474
        param = <optimized out>
        data_ofs = <optimized out>
        string = <optimized out>
#5  0x0000562a600fa092 in action_osc_end (c=<optimized out>, term=0x562a6176f040) at ../foot/vt.c:514
No locals.
#6  action_osc_end (c=7 '\a', term=0x562a6176f040) at ../foot/vt.c:509
No locals.
#7  state_osc_string_switch (data=<optimized out>, term=0x562a6176f040) at ../foot/vt.c:1020
No locals.
#8  vt_from_slave (term=term@entry=0x562a6176f040, 
    data=data@entry=0x7ffd676242c0 "\033[01m\033[Kqmc_group.cpp:123:29:\033[m\033[K \033[01;35m\033[Kwarning: \033[m\033[K‘\033[01m\033[KQTextStream& QTextStreamFunctions::endl(QTextStream&)\033[m\033[K’ is deprecated: Use Qt::endl [\033[01;35m\033[K\033]8;;https://gcc.gnu.org"..., len=<optimized out>) at ../foot/vt.c:1304
        i = 0
        current_state = <optimized out>
        p = 0x7ffd676243ea "\a\033[m\033[K]\r\n  123 |  cout << \"ERROR \" << sts << \033[01;35m\033[Kendl\033[m\033[K << terminator;\r\n      |", ' ' <repeats 29 times>, "\033[01;35m\033[K^~~~\033[m\033[K\r\nIn file included from \033[01m\033[K/usr/include/qt5/QtCore/QTe"...
#9  0x0000562a600f12b0 in fdm_ptmx (fdm=0x562a61745fd0, fd=6, events=<optimized out>, data=0x562a6176f040) at ../foot/terminal.c:255
        i = 0
        term = 0x562a6176f040
        pollin = <optimized out>
        pollout = <optimized out>
        hup = false
        buf = "\033[01m\033[Kqmc_group.cpp:123:29:\033[m\033[K \033[01;35m\033[Kwarning: \033[m\033[K‘\033[01m\033[KQTextStream& QTextStreamFunctions::endl(QTextStream&)\033[m\033[K’ is deprecated: Use Qt::endl [\033[01;35m\033[K\033]8;;https://gcc.gnu.org/onl"...
        count = <optimized out>
        max_iterations = 10
#10 0x0000562a600d500b in fdm_poll (fdm=fdm@entry=0x562a61745fd0) at ../foot/fdm.c:459
        fd = <optimized out>
        i = 0

If needed I can provide coredump as well.

Not sure what other information might be necessary so just some basic component versions:

  • sway 1.6
  • wlroots 0.13.0
  • mesa 20.3.5
  • kernel 5.12.6 (intel + nouveau drivers - each driving separate monitor)

If any other specific info would help figure out the cause - let me know and I'll try and provide it

I have experienced an occasional foot coredump. Top of the traceback from gdb is as follows: ``` #0 0x0000562a600eb5e4 in ensure_row_has_extra_data (row=row@entry=0x0) at ../foot/grid.c:684 No locals. #1 grid_row_add_uri_range (row=row@entry=0x0, range=...) at ../foot/grid.c:691 No locals. #2 0x0000562a600f6819 in term_osc8_close (term=term@entry=0x562a6176f040) at ../foot/terminal.c:3127 end_col = 126 row = 0x0 range = {start = 0, end = 126, id = 347040475148719253, uri = 0x562a6178b540 "https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wdeprecated-declarations"} start = {col = <optimized out>, row = <optimized out>} end = {col = 13, row = 0} r = 2048 start_col = 0 #3 0x0000562a600fee48 in osc_uri (string=<optimized out>, term=0x562a6176f040) at ../foot/osc.c:490 params = <optimized out> params_end = 0x562a617c9892 "" ctx = 0x562a617c9892 "" uri = 0x562a617c9893 "" id = 3943155470736684728 params = <optimized out> params_end = <optimized out> uri = <optimized out> id = <optimized out> ctx = <optimized out> key_value = <optimized out> key = <optimized out> operator = <optimized out> value = <optimized out> #4 osc_dispatch (term=term@entry=0x562a6176f040) at ../foot/osc.c:678 color = 1635555474 param = <optimized out> data_ofs = <optimized out> string = <optimized out> #5 0x0000562a600fa092 in action_osc_end (c=<optimized out>, term=0x562a6176f040) at ../foot/vt.c:514 No locals. #6 action_osc_end (c=7 '\a', term=0x562a6176f040) at ../foot/vt.c:509 No locals. #7 state_osc_string_switch (data=<optimized out>, term=0x562a6176f040) at ../foot/vt.c:1020 No locals. #8 vt_from_slave (term=term@entry=0x562a6176f040, data=data@entry=0x7ffd676242c0 "\033[01m\033[Kqmc_group.cpp:123:29:\033[m\033[K \033[01;35m\033[Kwarning: \033[m\033[K‘\033[01m\033[KQTextStream& QTextStreamFunctions::endl(QTextStream&)\033[m\033[K’ is deprecated: Use Qt::endl [\033[01;35m\033[K\033]8;;https://gcc.gnu.org"..., len=<optimized out>) at ../foot/vt.c:1304 i = 0 current_state = <optimized out> p = 0x7ffd676243ea "\a\033[m\033[K]\r\n 123 | cout << \"ERROR \" << sts << \033[01;35m\033[Kendl\033[m\033[K << terminator;\r\n |", ' ' <repeats 29 times>, "\033[01;35m\033[K^~~~\033[m\033[K\r\nIn file included from \033[01m\033[K/usr/include/qt5/QtCore/QTe"... #9 0x0000562a600f12b0 in fdm_ptmx (fdm=0x562a61745fd0, fd=6, events=<optimized out>, data=0x562a6176f040) at ../foot/terminal.c:255 i = 0 term = 0x562a6176f040 pollin = <optimized out> pollout = <optimized out> hup = false buf = "\033[01m\033[Kqmc_group.cpp:123:29:\033[m\033[K \033[01;35m\033[Kwarning: \033[m\033[K‘\033[01m\033[KQTextStream& QTextStreamFunctions::endl(QTextStream&)\033[m\033[K’ is deprecated: Use Qt::endl [\033[01;35m\033[K\033]8;;https://gcc.gnu.org/onl"... count = <optimized out> max_iterations = 10 #10 0x0000562a600d500b in fdm_poll (fdm=fdm@entry=0x562a61745fd0) at ../foot/fdm.c:459 fd = <optimized out> i = 0 ``` If needed I can provide coredump as well. Not sure what other information might be necessary so just some basic component versions: * sway 1.6 * wlroots 0.13.0 * mesa 20.3.5 * kernel 5.12.6 (intel + nouveau drivers - each driving separate monitor) If any other specific info would help figure out the cause - let me know and I'll try and provide it
Owner

Which version of foot is this? I remember doing some OSC-8 changes fairly recently. So depending on what version you are running, they may either fix the problem, or be the cause :)

Which version of foot is this? I remember doing some OSC-8 changes fairly recently. So depending on what version you are running, they may either fix the problem, or be the cause :)
dnkl added the
bug
label 5 months ago
Owner

Oh, since it may not be obvious... the crash occurs when we're trying to "close" an OSC-8 URL. In other words, a "hyperlink".

Oh, since it may not be obvious... the crash occurs when we're trying to "close" an OSC-8 URL. In other words, a "hyperlink".
Owner

r = 2048

Uh oh... how much scrollback have you configured?

> r = 2048 Uh oh... how much scrollback have you configured?
Poster

Lol, of course I include all kinds of info except version of foot itself - 1.7.2. My config is as follows no change in scrollback config:

term = xterm-256color 
font = Source Code Pro:size=12
dpi-aware = no
bell = notify
notify = sway_mark_urgent.py
workers = 4
selection-target = both

[scrollback]
indicator-format = percentage

[key-bindings]
primary-paste = None
clipboard-paste = Shift+Insert

# Solarized dark
[cursor]
color= 002b36 93a1a1

[colors]
background=              002b36
foreground=              839496
regular0=                073642
regular1=                dc322f
regular2=                859900
regular3=                b58900
regular4=                268bd2
regular5=                d33682
regular6=                2aa198
regular7=                eee8d5
bright0=                 002b36
bright1=                 cb4b16
bright2=                 586e75
bright3=                 657b83
bright4=                 839496
bright5=                 6c71c4
bright6=                 93a1a1
bright7=                 fdf6e3
Lol, of course I include all kinds of info except version of foot itself - 1.7.2. My config is as follows no change in scrollback config: ``` term = xterm-256color font = Source Code Pro:size=12 dpi-aware = no bell = notify notify = sway_mark_urgent.py workers = 4 selection-target = both [scrollback] indicator-format = percentage [key-bindings] primary-paste = None clipboard-paste = Shift+Insert # Solarized dark [cursor] color= 002b36 93a1a1 [colors] background= 002b36 foreground= 839496 regular0= 073642 regular1= dc322f regular2= 859900 regular3= b58900 regular4= 268bd2 regular5= d33682 regular6= 2aa198 regular7= eee8d5 bright0= 002b36 bright1= cb4b16 bright2= 586e75 bright3= 657b83 bright4= 839496 bright5= 6c71c4 bright6= 93a1a1 bright7= fdf6e3 ```
Owner

Can you test #553? I'm fairly sure it fixes this.

I've mostly tested OSC-8 URLs with ls --hyperlink=auto, which usually don't cross multiple rows...

It was fairly easy to reproduce when I figured out it had to do with this; just shrink the window to the smallest size possible, then run while true; do ls --hyperlink=always; done. Boom! :)

Thanks for the report!

Can you test https://codeberg.org/dnkl/foot/pulls/553? I'm fairly sure it fixes this. I've mostly tested OSC-8 URLs with `ls --hyperlink=auto`, which usually don't cross multiple rows... It was fairly easy to reproduce when I figured out it had to do with this; just shrink the window to the smallest size possible, then run `while true; do ls --hyperlink=always; done`. Boom! :) Thanks for the report!
Poster

Well I can't apply the patch on 0.7.2 branch cleanly so I'll have to build/install from master - might get to that in a bit. Thanks for the quick patch though.

As a side note - I wanted to confirm I can reproduce before applying the patch. And the while loop brought down first foot, then whole sway session :-)

Well I can't apply the patch on 0.7.2 branch cleanly so I'll have to build/install from master - might get to that in a bit. Thanks for the quick patch though. As a side note - I wanted to confirm I can reproduce before applying the patch. And the while loop brought down first foot, then whole sway session :-)
Owner

And the while loop brought down first foot, then whole sway session :-)

Ouch... :/

> And the while loop brought down first foot, then whole sway session :-) Ouch... :/
Poster

OK, on master with the patch from the #553 applied - and I can't reproduce anymore. I can try to disable the patch and retry to confirm master's affected the same way...

OK, on master with the patch from the #553 applied - and I can't reproduce anymore. I can try to disable the patch and retry to confirm master's affected the same way...
Poster

Oh, yeah - after I disabled the patch the while loop almost immediately crashes foot (fortunately left sway intact this time).

Kudos for the quick resolution & reproducer for verification!

Oh, yeah - after I disabled the patch the while loop almost immediately crashes foot (fortunately left sway intact this time). Kudos for the quick resolution & reproducer for verification!
dnkl closed this issue 5 months ago
dnkl referenced this issue from a commit 5 months ago
Owner

(fortunately left sway intact this time).

Fortunate indeed 🤣

Kudos for the quick resolution & reproducer for verification!

You're welcome, and thanks for testing the patch!

> (fortunately left sway intact this time). Fortunate indeed 🤣 > Kudos for the quick resolution & reproducer for verification! You're welcome, and thanks for testing the patch!
Poster

I'll add this bug (and you personally) to a list of examples why/how Open source can be absolutely awesome :-)

I'll add this bug (and you personally) to a list of examples why/how Open source can be absolutely awesome :-)
Owner

On one condition: I get to read it ;)

On one condition: I get to read it ;)
Poster

You know - I was partially joking, but you are right. There's tons of articles talking about opensource communities being hard to participate in and in some cases less-than-welcoming. So I think it's only fair to even things out and share some great experiences I've had with communities and maintainers/developers who go out of their way to make the experience great even for "code non-contributing members" (i.e bugreporters and the like).

I'll let you know once it's out there...

You know - I was partially joking, but you are right. There's tons of articles talking about opensource communities being hard to participate in and in some cases less-than-welcoming. So I think it's only fair to even things out and share some great experiences I've had with communities and maintainers/developers who go out of their way to make the experience great even for "code non-contributing members" (i.e bugreporters and the like). I'll let you know once it's out there...
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.