ncmpc icon indicating copy to clipboard operation
ncmpc copied to clipboard

bug: segfault when exiting lyrics edit

Open loosefish-scapegrace opened this issue 1 year ago • 5 comments

When exiting the text editor after pressing e on the lyrics tab, ncmpc segfaults. I have tried this on the release version 0.49 and on master.

loosefish-scapegrace avatar Aug 21 '23 23:08 loosefish-scapegrace

Post a backtrace.

MaxKellermann avatar Aug 22 '23 05:08 MaxKellermann

stacktrace from gdb:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7f9847a in unctrl_sp () from /usr/lib64/libncursesw.so.6
#0  0x00007ffff7f9847a in unctrl_sp () from /usr/lib64/libncursesw.so.6
#1  0x00007ffff7f66c06 in _nc_waddch_nosync () from /usr/lib64/libncursesw.so.6
#2  0x00007ffff7f67376 in waddnstr () from /usr/lib64/libncursesw.so.6
#3  0x00005555555728b0 in row_paint_text (style=Style::LIST, text=0x7fffffffbff0 "Any real egg has a shell as the shell an egg", selected=false, width=106, w=0x55555560ab30) at ../src/paint.hxx:59
#4  list_window_paint_row (text=0x7fffffffbff0 "Any real egg has a shell as the shell an egg", selected=false, width=106, w=0x55555560ab30) at ../src/TextListRenderer.cxx:14
#5  TextListRenderer::PaintListItem (this=<optimized out>, w=0x55555560ab30, i=<optimized out>, width=106, selected=<optimized out>) at ../src/TextListRenderer.cxx:26
#6  0x000055555557216d in ListWindow::Paint (this=this@entry=0x555555651318, renderer=...) at ../src/ListWindow.cxx:40
#7  0x00005555555897c2 in TextPage::Paint (this=this@entry=0x555555651300) at ../src/TextPage.cxx:67
#8  0x0000555555587023 in TextPage::Repaint (this=0x555555651300) at ../src/TextPage.hxx:56
#9  LyricsPage::Reload (this=0x555555651300) at ../src/LyricsPage.cxx:280
#10 LyricsPage::Reload (this=0x555555651300) at ../src/LyricsPage.cxx:275
#11 0x0000555555587228 in LyricsPage::Edit (this=this@entry=0x555555651300) at ../src/LyricsPage.cxx:392
#12 0x0000555555587858 in LyricsPage::OnCommand (this=0x555555651300, c=..., cmd=<optimized out>) at ../src/LyricsPage.cxx:438
#13 0x000055555556c228 in ScreenManager::OnCommand (this=0x7fffffffd810, c=..., seek=..., cmd=cmd@entry=Command::EDIT) at ../src/screen.cxx:215
#14 0x0000555555562d6f in do_input_event (event_loop=..., cmd=cmd@entry=Command::EDIT) at ../src/Main.cxx:215
#15 0x000055555556986a in AsyncUserInput::OnSocketReady (this=0x7fffffffda88) at ../src/event/SocketEvent.hxx:74
#16 0x000055555558d30d in EventLoop::Run (this=this@entry=0x7fffffffc6e0) at ../src/event/Loop.cxx:364
#17 0x0000555555563317 in Instance::Run (this=this@entry=0x7fffffffc6e0) at ../src/Instance.cxx:83
#18 0x0000555555562657 in main (argc=<optimized out>, argv=0x7fffffffdc08) at ../src/Main.cxx:332

loosefish-scapegrace avatar Aug 23 '23 10:08 loosefish-scapegrace

This is a crash inside libncursesw, but it could be caused by an earlier bug in ncmpc, but your backtrace has no hint on what that could be. Can you repeat the crash with valgrind? Maybe valgrind shows more insight where things went wrong initially.

MaxKellermann avatar Aug 23 '23 10:08 MaxKellermann

https://0x0.st/H9Ki.log

(i've never used valgrind so maybe this is supposed to happen, but the behaviour inside valgrind was different from gdb/just running it normally?)

loosefish-scapegrace avatar Aug 23 '23 11:08 loosefish-scapegrace

I see the problem now, your log was very helpful.

MaxKellermann avatar Aug 23 '23 11:08 MaxKellermann