Menu

#2680 Crash with multiplot/wxt/yrange

None
closed-fixed
nobody
None
2024-05-28
2024-01-17
SiegeLord
No

Version: 6.0.0 patchlevel 0
Platform: Linux
Terminal: wxt

Running gnuplot -p file.gnuplot with file.gnuplot with the following contents:

set multiplot
set yrange [*:*]

$data << EOF
1 1
2 2
EOF

plot $data using 1:2 with lines
unset multiplot

And then doing a zoom via right click box causes the plot to segfault:

#0  0x00007ffff73e70d4 in  () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#1  0x00007ffff73e8614 in g_signal_emit_valist () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#2  0x00007ffff73e8863 in g_signal_emit () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#3  0x00007ffff6cd2600 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#4  0x00007ffff73d9011 in g_object_run_dispose () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#5  0x00007ffff7a456dd in wxWindow::~wxWindow() () at /lib/x86_64-linux-gnu/libwx_gtk3u_core-3.2.so.0
#6  0x00007ffff7b685e9 in wxFrameBase::DeleteAllBars() () at /lib/x86_64-linux-gnu/libwx_gtk3u_core-3.2.so.0
#7  0x00007ffff7b6b193 in wxFrameBase::~wxFrameBase() () at /lib/x86_64-linux-gnu/libwx_gtk3u_core-3.2.so.0
#8  0x00005555556aae81 in wxFrame::~wxFrame() (this=0x555555856ef0, __in_chrg=<optimized out>) at /usr/include/wx-3.2/wx/gtk/frame.h:16
#9  wxtFrame::~wxtFrame() (this=0x555555856ef0, __in_chrg=<optimized out>) at wxterminal/wxt_gui.cpp:543
#10 wxtFrame::~wxtFrame() (this=0x555555856ef0, __in_chrg=<optimized out>) at wxterminal/wxt_gui.cpp:543
#11 0x00007ffff7525a07 in wxAppConsoleBase::DeletePendingObjects() () at /lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0
#12 0x00007ffff7af5620 in wxAppBase::CleanUp() () at /lib/x86_64-linux-gnu/libwx_gtk3u_core-3.2.so.0
#13 0x00007ffff7584242 in wxEntryCleanup() () at /lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0
#14 0x00005555556a05f2 in wxt_cleanup() () at wxterminal/wxt_gui.cpp:4338
#15 0x00005555556a0be8 in wxt_cleanup () at wxterminal/wxt_gui.cpp:4321
#16 wxt_atexit() () at wxterminal/wxt_gui.cpp:4226
#17 0x000055555564788a in gp_exit_cleanup () at stdfn.c:476
#18 0x000055555564790c in gp_exit (status=status@entry=1) at stdfn.c:515
#19 0x000055555558a91e in main (argc_orig=<optimized out>, argv=0x7fffffffde18) at plot.c:597

If I break in int_error, I get this backtrace:

#0  int_error (t_num=9, str=0x5555556c3096 "all points y value undefined!") at util.c:1146
#1  0x000055555558c7c4 in axis_checked_extend_empty_range (axis=FIRST_Y_AXIS, mesg=<optimized out>) at axis.c:421
#2  0x000055555560356b in eval_plots () at plot2d.c:3927
#3  0x000055555559dac2 in plot_command () at command.c:2157
#4  0x000055555559fedc in command () at command.c:772
#5  do_line () at command.c:525
#6  0x00005555555f02cc in load_file (fp=fp@entry=0x0, name=<optimized out>, calltype=calltype@entry=6) at misc.c:394
#7  0x00005555555fc171 in replay_multiplot () at multiplot.c:679
#8  0x00005555555a0829 in do_string_replot (s=s@entry=0x5555556d0b58 "") at command.c:613
#9  0x00005555555f4493 in apply_zoom (z=<optimized out>) at mouse.c:849
#10 0x00005555555f4870 in do_zoom
    (xmin=<optimized out>, ymin=<optimized out>, x2min=<optimized out>, y2min=<optimized out>, xmax=<optimized out>, ymax=<optimized out>, x2max=<optimized out>, y2max=<optimized out>) at mouse.c:892
#11 0x00005555555fa0c0 in event_buttonpress (ge=<optimized out>) at mouse.c:2186
#12 do_event (ge=<optimized out>) at mouse.c:2546
#13 0x00005555556a8487 in wxt_process_one_event (event=0x7fffffffd220) at wxterminal/wxt_gui.cpp:3892
#14 wxt_exec_event(int, int, int, int, int, wxWindowID) (type=<optimized out>, mx=63400, my=22000, par1=<optimized out>, par2=<optimized out>, id=<optimized out>) at wxterminal/wxt_gui.cpp:3953
#15 0x00007ffff762efe6 in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () at /lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0
#16 0x00007ffff762f56b in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) () at /lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0
#17 0x00007ffff7630b8d in wxEvtHandler::TryHereOnly(wxEvent&) () at /lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0
#18 0x00007ffff7630c0f in wxEvtHandler::ProcessEventLocally(wxEvent&) () at /lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0
#19 0x00007ffff7630d29 in wxEvtHandler::ProcessEvent(wxEvent&) () at /lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0
#20 0x00007ffff763218b in wxEvtHandler::SafelyProcessEvent(wxEvent&) () at /lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0
#21 0x00007ffff7a48ab8 in  () at /lib/x86_64-linux-gnu/libwx_gtk3u_core-3.2.so.0
#22 0x00007ffff6d10b77 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#23 0x00007ffff73cad2f in g_closure_invoke () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#24 0x00007ffff73e6c36 in  () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#25 0x00007ffff73e8026 in g_signal_emit_valist () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#26 0x00007ffff73e8863 in g_signal_emit () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#27 0x00007ffff6cd9724 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#28 0x00007ffff6b7c680 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#29 0x00007ffff6b7d52a in gtk_main_do_event () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#30 0x00007ffff685d743 in  () at /lib/x86_64-linux-gnu/libgdk-3.so.0
#31 0x00007ffff6894f56 in  () at /lib/x86_64-linux-gnu/libgdk-3.so.0
#32 0x00007ffff72d1d3b in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#33 0x00007ffff7327258 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#34 0x00007ffff72d12b3 in g_main_loop_run () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#35 0x00007ffff6b73cfd in gtk_main () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#36 0x00007ffff7a20805 in wxGUIEventLoop::DoRun() () at /lib/x86_64-linux-gnu/libwx_gtk3u_core-3.2.so.0
#37 0x00007ffff754c4c1 in wxEventLoopBase::Run() () at /lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0
#38 0x00007ffff752a32a in wxAppConsoleBase::MainLoop() () at /lib/x86_64-linux-gnu/libwx_baseu-3.2.so.0
#39 0x00005555556a0c5b in wxt_atexit() () at wxterminal/wxt_gui.cpp:4298
#40 0x000055555564788a in gp_exit_cleanup () at stdfn.c:476
#41 0x000055555558a5a5 in main (argc_orig=<optimized out>, argv=<optimized out>) at plot.c:717

Discussion

  • Ethan Merritt

    Ethan Merritt - 2024-01-25

    From what I have been able to determine, there is a deeper issue here that the wxt terminal has for some time now been very fragile in the presence of errors. I will add a new tracker issue that describes the problem in more detail, but in a nutshell the issue is that various mouse events can generate a call back into the core code. This is commonly a "replot" or "refresh", but given that you can bind a hotkey to any command sequence you like it could really be anything. If the command sequence then exits via int_error(), the program does a LONGJMP back to the main command line loop rather than continuing with the failed code. The wxt terminal does not survive this LONGJMP. More specifically I think this changed in the transition from wxgtk2.8 -> wxgtk3.0. gtk3 uses a different threading model.

    The specific example you give triggers int_error() from the zoom code, and this in turn corrupts the wxt state. I have tried to ameliorate this by modifying the pan/zoom implementation so that it is much less likely to trigger int_error(). This does not in any way fix the underlying wxt problem but it should greatly reduce the number of ways you can hit it. IMHO it improves the zooming behavior for all terminals, not just wxt.

    Meanwhile I have opened a new tracker for the larger problem:
    https://sourceforge.net/p/gnuplot/bugs/2683/

     
  • Ethan Merritt

    Ethan Merritt - 2024-01-30

    I think this is handled by the new exception handler for the wxt terminal. See Bug 2683 https://sourceforge.net/p/gnuplot/bugs/2683/

     
  • Ethan Merritt

    Ethan Merritt - 2024-01-30
    • status: open --> pending-fixed
    • Group: -->
    • Priority: -->
     
  • Ethan Merritt

    Ethan Merritt - 2024-05-28
    • Status: pending-fixed --> closed-fixed
     

Log in to post a comment.