dnkl/foot
41
2.0k
Fork
You've already forked foot
243

crash while resizing in notcurses-demo [view] #844

Closed
opened 2021年12月15日 00:46:11 +01:00 by dankamongmen · 6 comments
Contributor
Copy link

I was attempting to reproduce the crash seen in notcurses-demo as reported by @dnkl at https://github.com/dankamongmen/notcurses/issues/2471. I have not yet been able to do so, but I did crash foot a few times. I'll try and get you a stack trace. Here's what I have thus far:

warn: csi.c:1517: unimplemented: modifyFunctionKeys = 1
info: fcft.c:757: /usr/share/fonts/truetype/hack/Hack-Regular.ttf: size=10.00pt/
25px, dpi=181.63
info: fcft.c:757: /usr/share/fonts/truetype/hack/Hack-BoldItalic.ttf: size=10.00
pt/25px, dpi=181.63
info: fcft.c:757: /usr/share/fonts/truetype/hack/Hack-Italic.ttf: size=10.00pt/2
5px, dpi=181.63
info: fcft.c:757: /usr/share/fonts/truetype/hack/Hack-Bold.ttf: size=10.00pt/25p
x, dpi=181.63
info: terminal.c:694: cell width=15, height=30
warn: csi.c:1517: unimplemented: modifyFunctionKeys = 1
warn: sixel.c:887: destroyed sixel that now crossed history
warn: sixel.c:887: destroyed sixel that now crossed history
warn: sixel.c:887: destroyed sixel that now crossed history
warn: sixel.c:887: destroyed sixel that now crossed history
warn: sixel.c:887: destroyed sixel that now crossed history
warn: sixel.c:887: destroyed sixel that now crossed history
warn: sixel.c:887: destroyed sixel that now crossed history
warn: csi.c:1517: unimplemented: modifyFunctionKeys = 1
warn: csi.c:1517: unimplemented: modifyFunctionKeys = 1
warn: sixel.c:887: destroyed sixel that now crossed history
warn: sixel.c:887: destroyed sixel that now crossed history
warn: sixel.c:887: destroyed sixel that now crossed history
warn: sixel.c:887: destroyed sixel that now crossed history
warn: sixel.c:887: destroyed sixel that now crossed history
warn: sixel.c:887: destroyed sixel that now crossed history
warn: sixel.c:887: destroyed sixel that now crossed history
warn: sixel.c:887: destroyed sixel that now crossed history
warn: sixel.c:887: destroyed sixel that now crossed history
warn: sixel.c:887: destroyed sixel that now crossed history
warn: sixel.c:887: destroyed sixel that now crossed history
warn: sixel.c:887: destroyed sixel that now crossed history
 err: shm.c:197: BUG in buffer_release(): assertion failed: 'buffer->busy'
Aborted (core dumped)
I was attempting to reproduce the crash seen in `notcurses-demo` as reported by @dnkl at https://github.com/dankamongmen/notcurses/issues/2471. I have not yet been able to do so, but I did crash foot a few times. I'll try and get you a stack trace. Here's what I have thus far: ``` warn: csi.c:1517: unimplemented: modifyFunctionKeys = 1 info: fcft.c:757: /usr/share/fonts/truetype/hack/Hack-Regular.ttf: size=10.00pt/ 25px, dpi=181.63 info: fcft.c:757: /usr/share/fonts/truetype/hack/Hack-BoldItalic.ttf: size=10.00 pt/25px, dpi=181.63 info: fcft.c:757: /usr/share/fonts/truetype/hack/Hack-Italic.ttf: size=10.00pt/2 5px, dpi=181.63 info: fcft.c:757: /usr/share/fonts/truetype/hack/Hack-Bold.ttf: size=10.00pt/25p x, dpi=181.63 info: terminal.c:694: cell width=15, height=30 warn: csi.c:1517: unimplemented: modifyFunctionKeys = 1 warn: sixel.c:887: destroyed sixel that now crossed history warn: sixel.c:887: destroyed sixel that now crossed history warn: sixel.c:887: destroyed sixel that now crossed history warn: sixel.c:887: destroyed sixel that now crossed history warn: sixel.c:887: destroyed sixel that now crossed history warn: sixel.c:887: destroyed sixel that now crossed history warn: sixel.c:887: destroyed sixel that now crossed history warn: csi.c:1517: unimplemented: modifyFunctionKeys = 1 warn: csi.c:1517: unimplemented: modifyFunctionKeys = 1 warn: sixel.c:887: destroyed sixel that now crossed history warn: sixel.c:887: destroyed sixel that now crossed history warn: sixel.c:887: destroyed sixel that now crossed history warn: sixel.c:887: destroyed sixel that now crossed history warn: sixel.c:887: destroyed sixel that now crossed history warn: sixel.c:887: destroyed sixel that now crossed history warn: sixel.c:887: destroyed sixel that now crossed history warn: sixel.c:887: destroyed sixel that now crossed history warn: sixel.c:887: destroyed sixel that now crossed history warn: sixel.c:887: destroyed sixel that now crossed history warn: sixel.c:887: destroyed sixel that now crossed history warn: sixel.c:887: destroyed sixel that now crossed history err: shm.c:197: BUG in buffer_release(): assertion failed: 'buffer->busy' Aborted (core dumped) ```
Author
Contributor
Copy link
Thread 7 (Thread 0x7ffff5f3c640 (LWP 1116511) "foot:render:2"):
#0 0x00007ffff7aec0fa in __futex_abstimed_wait_common64 (futex_word=futex_word@
entry=0x555555671a98, expected=expected@entry=0, clockid=clockid@entry=0, abstim
e=abstime@entry=0x0, private=<optimized out>, cancel=cancel@entry=true) at ../sy
sdeps/nptl/futex-internal.c:74
#1 0x00007ffff7aec15b in __GI___futex_abstimed_wait_cancelable64 (futex_word=fu
tex_word@entry=0x555555671a98, expected=expected@entry=0, clockid=clockid@entry=
0, abstime=abstime@entry=0x0, private=<optimized out>) at ../sysdeps/nptl/futex-
internal.c:123
#2 0x00007ffff7ae844f in do_futex_wait (sem=sem@entry=0x555555671a98, abstime=0
x0, clockid=0) at sem_waitcommon.c:112
#3 0x00007ffff7ae84e8 in __new_sem_wait_slow64 (sem=0x555555671a98, abstime=0x0
, clockid=0) at sem_waitcommon.c:184
#4 0x0000555555589922 in render_worker_thread (_ctx=0x55555566efb0) at ../rende
r.c:1451
#5 0x00007ffff7adfe4a in start_thread (arg=0x7ffff5f3c640) at pthread_create.c:
478
#6 0x00007ffff7a0ab6f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:
95
Thread 6 (Thread 0x7ffff573b640 (LWP 1116509) "foot:render:1"):
#0 0x00007ffff7aec0fa in __futex_abstimed_wait_common64 (futex_word=futex_word@
entry=0x555555671a98, expected=expected@entry=0, clockid=clockid@entry=0, abstim
e=abstime@entry=0x0, private=<optimized out>, cancel=cancel@entry=true) at ../sy
sdeps/nptl/futex-internal.c:74
#1 0x00007ffff7aec15b in __GI___futex_abstimed_wait_cancelable64 (futex_word=fu
tex_word@entry=0x555555671a98, expected=expected@entry=0, clockid=clockid@entry=
0, abstime=abstime@entry=0x0, private=<optimized out>) at ../sysdeps/nptl/futex-
internal.c:123
#2 0x00007ffff7ae844f in do_futex_wait (sem=sem@entry=0x555555671a98, abstime=0
x0, clockid=0) at sem_waitcommon.c:112
#3 0x00007ffff7ae84e8 in __new_sem_wait_slow64 (sem=0x555555671a98, abstime=0x0
, clockid=0) at sem_waitcommon.c:184
#4 0x0000555555589922 in render_worker_thread (_ctx=0x555555681eb0) at ../rende
r.c:1451
#5 0x00007ffff7adfe4a in start_thread (arg=0x7ffff573b640) at pthread_create.c:
478
#6 0x00007ffff7a0ab6f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:
95
Thread 1 (Thread 0x7ffff7664900 (LWP 1116487) "foot"):
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:49
#1 0x00007ffff7934536 in __GI_abort () at abort.c:79
#2 0x00005555555ccb87 in bug (file=0x5555555e282b "shm.c", line=197, func=0x555
5555e2db8 <__func__.14> "buffer_release", fmt=0x5555555e2814 "assertion failed: 
'%s'") at ../debug.c:46
#3 0x00005555555978e1 in buffer_release (data=0x555555825000, wl_buffer=0x55555
5682c90) at ../shm.c:197
#4 0x00007ffff79089da in ?? () from /usr/lib/x86_64-linux-gnu/libffi.so.8
#5 0x00007ffff7907b21 in ?? () from /usr/lib/x86_64-linux-gnu/libffi.so.8
#6 0x00007ffff7d942d2 in ?? () from /usr/lib/x86_64-linux-gnu/libwayland-client
.so.0
#7 0x00007ffff7d9097a in ?? () from /usr/lib/x86_64-linux-gnu/libwayland-client
.so.0
#8 0x00007ffff7d9203c in wl_display_dispatch_queue_pending () from /usr/lib/x86
_64-linux-gnu/libwayland-client.so.0
#9 0x00005555555a2998 in fdm_wayl (fdm=0x55555566fca0, fd=5, events=1, data=0x5
5555566eeb0) at ../wayland.c:1163
#10 0x000055555557ad68 in fdm_poll (fdm=0x55555566fca0) at ../fdm.c:463
#11 0x000055555558443a in main (argc=0, argv=0x7fffffffddd0) at ../main.c:563
``` Thread 7 (Thread 0x7ffff5f3c640 (LWP 1116511) "foot:render:2"): #0 0x00007ffff7aec0fa in __futex_abstimed_wait_common64 (futex_word=futex_word@ entry=0x555555671a98, expected=expected@entry=0, clockid=clockid@entry=0, abstim e=abstime@entry=0x0, private=<optimized out>, cancel=cancel@entry=true) at ../sy sdeps/nptl/futex-internal.c:74 #1 0x00007ffff7aec15b in __GI___futex_abstimed_wait_cancelable64 (futex_word=fu tex_word@entry=0x555555671a98, expected=expected@entry=0, clockid=clockid@entry= 0, abstime=abstime@entry=0x0, private=<optimized out>) at ../sysdeps/nptl/futex- internal.c:123 #2 0x00007ffff7ae844f in do_futex_wait (sem=sem@entry=0x555555671a98, abstime=0 x0, clockid=0) at sem_waitcommon.c:112 #3 0x00007ffff7ae84e8 in __new_sem_wait_slow64 (sem=0x555555671a98, abstime=0x0 , clockid=0) at sem_waitcommon.c:184 #4 0x0000555555589922 in render_worker_thread (_ctx=0x55555566efb0) at ../rende r.c:1451 #5 0x00007ffff7adfe4a in start_thread (arg=0x7ffff5f3c640) at pthread_create.c: 478 #6 0x00007ffff7a0ab6f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S: 95 Thread 6 (Thread 0x7ffff573b640 (LWP 1116509) "foot:render:1"): #0 0x00007ffff7aec0fa in __futex_abstimed_wait_common64 (futex_word=futex_word@ entry=0x555555671a98, expected=expected@entry=0, clockid=clockid@entry=0, abstim e=abstime@entry=0x0, private=<optimized out>, cancel=cancel@entry=true) at ../sy sdeps/nptl/futex-internal.c:74 #1 0x00007ffff7aec15b in __GI___futex_abstimed_wait_cancelable64 (futex_word=fu tex_word@entry=0x555555671a98, expected=expected@entry=0, clockid=clockid@entry= 0, abstime=abstime@entry=0x0, private=<optimized out>) at ../sysdeps/nptl/futex- internal.c:123 #2 0x00007ffff7ae844f in do_futex_wait (sem=sem@entry=0x555555671a98, abstime=0 x0, clockid=0) at sem_waitcommon.c:112 #3 0x00007ffff7ae84e8 in __new_sem_wait_slow64 (sem=0x555555671a98, abstime=0x0 , clockid=0) at sem_waitcommon.c:184 #4 0x0000555555589922 in render_worker_thread (_ctx=0x555555681eb0) at ../rende r.c:1451 #5 0x00007ffff7adfe4a in start_thread (arg=0x7ffff573b640) at pthread_create.c: 478 #6 0x00007ffff7a0ab6f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S: 95 Thread 1 (Thread 0x7ffff7664900 (LWP 1116487) "foot"): #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:49 #1 0x00007ffff7934536 in __GI_abort () at abort.c:79 #2 0x00005555555ccb87 in bug (file=0x5555555e282b "shm.c", line=197, func=0x555 5555e2db8 <__func__.14> "buffer_release", fmt=0x5555555e2814 "assertion failed: '%s'") at ../debug.c:46 #3 0x00005555555978e1 in buffer_release (data=0x555555825000, wl_buffer=0x55555 5682c90) at ../shm.c:197 #4 0x00007ffff79089da in ?? () from /usr/lib/x86_64-linux-gnu/libffi.so.8 #5 0x00007ffff7907b21 in ?? () from /usr/lib/x86_64-linux-gnu/libffi.so.8 #6 0x00007ffff7d942d2 in ?? () from /usr/lib/x86_64-linux-gnu/libwayland-client .so.0 #7 0x00007ffff7d9097a in ?? () from /usr/lib/x86_64-linux-gnu/libwayland-client .so.0 #8 0x00007ffff7d9203c in wl_display_dispatch_queue_pending () from /usr/lib/x86 _64-linux-gnu/libwayland-client.so.0 #9 0x00005555555a2998 in fdm_wayl (fdm=0x55555566fca0, fd=5, events=1, data=0x5 5555566eeb0) at ../wayland.c:1163 #10 0x000055555557ad68 in fdm_poll (fdm=0x55555566fca0) at ../fdm.c:463 #11 0x000055555558443a in main (argc=0, argv=0x7fffffffddd0) at ../main.c:563 ```
Owner
Copy link

Eye for an eye, huh? :D

This is an interresting bug... buffer->busy is set by foot before handing it over to the compositor for rendering. buffer_release() is called by the compositor when it's done with it.

Thus, the failing assertion you're hitting basically says "the compositor gave us back this buffer, but we have no memory of ever handing it over to the compositor".

Pretty sure it is a bug in foot somewhere, but your compositor of choice may be an important factor. I.e. which compositor are you running?

Eye for an eye, huh? :D This is an interresting bug... `buffer->busy` is set by foot before handing it over to the compositor for rendering. `buffer_release()` is called by the compositor when it's done with it. Thus, the failing assertion you're hitting basically says "the compositor gave us back this buffer, but we have no memory of ever handing it over to the compositor". Pretty sure it _is_ a bug in foot somewhere, but your compositor of choice may be an important factor. I.e. which compositor are you running?
Author
Contributor
Copy link

Pretty sure it is a bug in foot somewhere, but your compositor of choice may be an important factor. I.e. which compositor are you running?

weston 9.0.0

> Pretty sure it _is_ a bug in foot somewhere, but your compositor of choice may be an important factor. I.e. which compositor are you running? weston 9.0.0
Owner
Copy link

Are you running weston nested inside X, or directly from a VT? Weston will be using different backends, and that will affect how/when it releases buffers.

I haven't been able to trigger the crash in a Wayland-nested weston. I'm having trouble getting weston to run from a VT at the moment, and would be nice to know if I should spend more time on that problem or not...

Are you running weston nested inside X, or directly from a VT? Weston will be using different backends, and that will affect how/when it releases buffers. I haven't been able to trigger the crash in a Wayland-nested weston. I'm having trouble getting weston to run from a VT at the moment, and would be nice to know if I should spend more time on that problem or not...
Owner
Copy link

Btw, I assume you are running a debug build? We disable assertions by default in release builds.

There are quite a few assertions in the hot path that we really don't want in release builds.

(fwiw: in debug builds, the sixel code is riddled with, not only assertions, but calls to verification functions that loop all sixels and verify the consistency of the internal state - slow).

Btw, I assume you are running a debug build? We disable assertions by default in release builds. There are quite a few assertions in the hot path that we really don't want in release builds. (fwiw: in debug builds, the sixel code is riddled with, not only assertions, but calls to verification functions that loop all sixels and verify the consistency of the internal state - _slow_).
Author
Contributor
Copy link

Are you running weston nested inside X, or directly from a VT? Weston will be using different backends, and that will affect how/when it releases buffers.

I haven't been able to trigger the crash in a Wayland-nested weston. I'm having trouble getting weston to run from a VT at the moment, and would be nice to know if I should spend more time on that problem or not...

nested inside X (i.e. I have X running and run weston from inside it).

> Are you running weston nested inside X, or directly from a VT? Weston will be using different backends, and that will affect how/when it releases buffers. > > I haven't been able to trigger the crash in a Wayland-nested weston. I'm having trouble getting weston to run from a VT at the moment, and would be nice to know if I should spend more time on that problem or not... nested inside X (i.e. I have X running and run weston from inside it).
Sign in to join this conversation.
No Branch/Tag specified
master
osc-5522
sixel-heap-buffer-overflow
releases/1.27
releases/1.26
releases/1.25
releases/1.24
multi-cursor
releases/1.23
pixman-16f-2
releases/1.22
releases/1.21
releases/1.20
releases/1.19
releases/1.18
releases/1.17
releases/1.16
releases/1.15
releases/1.14
releases/1.13
releases/1.12
releases/1.11
releases/1.10
releases/1.9
releases/1.8
releases/1.7
releases/1.6
releases/1.5
releases/1.4
releases/1.3
releases/1.2
releases/1.1
releases/1.0
1.27.0
1.26.1
1.26.0
1.25.0
1.24.0
1.23.1
1.23.0
1.22.3
1.22.2
1.22.1
1.22.0
1.21.0
1.20.2
1.20.1
1.20.0
1.19.0
1.18.1
1.18.0
1.17.2
1.17.1
1.17.0
1.16.2
1.16.1
1.16.0
1.15.3
1.15.2
1.15.1
1.15.0
1.14.0
1.13.1
1.13.0
1.12.1
1.12.0
1.11.0
1.10.3
1.10.2
1.10.1
1.10.0
1.9.2
1.9.1
1.9.0
1.8.2
1.8.1
1.8.0
1.7.2
1.7.1
1.7.0
1.6.4
1.6.3
1.6.2
1.6.1
1.6.0
1.5.4
1.5.3
1.5.2
1.5.1
1.5.0
1.4.4
1.4.3
1.4.2
1.4.1
1.4.0
1.3.0
1.2.3
1.2.2
1.2.1
1.2.0
1.1.0
1.0.0
0.9.0
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dnkl/foot#844
Reference in a new issue
dnkl/foot
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?