#1401 changes needed in order to support wxWidgets 3.0

closed-fixed
nobody
None
5
2015-03-26
2014-05-12
Anonymous
No

hi, if the recent cvs version is complied with wxwidgets 3.0 installed on the computer, the resulting binary crashed with the first plot to the wxt terminal. (Crash report is appended.)
This happens regardless of wxwidgets 2.8 also being installed or not. Only after removing the 3.0 package can i make a working build with wxt.

Is wxwidgets 3.0 supposed to work?

1 Attachments

Discussion

1 2 > >> (Page 1 of 2)
  • Ethan Merritt
    Ethan Merritt
    2014-05-12

    I do not recall any reports of either success or failure with wxwidgets3.0

    So I guess you get to be the guinea pig :-)

     
  • Please write your OS.
    On windows 7, gnuplot can be worked with wxwidgets3.0.

     
  • Ethan Merritt
    Ethan Merritt
    2014-05-14

    This seems to be a bug report of the same crash, or at least a very similar one, without involvment of wxwidgets3

      https://bugs.mageia.org/show_bug.cgi?id=13024
    

    I could not reproduce that one on my Mageia systems, so I really don't know where to start looking for a cause.

     
  • Karl Ratzsch
    Karl Ratzsch
    2014-05-15

    System was Xubuntu 14.04.
    Should i try if gnuplot465 does the same?

     
    • Ethan Merritt
      Ethan Merritt
      2014-05-15

      It would be helpful if you can pin down the source of the problem using whatever gnuplot version you like. I suspect it is a wx system configuration issue rather than a gnuplot source code issue, but I could be wrong.

       
  • For me, gnuplot also crashes with wxWidgets 3.0 (Debian unstable, amd64). Here, the wxWidgets version can be choosen via update-alternatives:

    $ ls -lh /etc/alternatives/wx-config 
    lrwxrwxrwx 1 root root 52 Mai 13 10:03 /etc/alternatives/wx-config -> /usr/lib/x86_64-linux-gnu/wx/config/gtk2-unicode-3.0
    

    It compiles fine, but crashes with a similar report:

    cbersch@sadge:~/src/gnuplot-wxt-3.0b$ src/gnuplot -e "set terminal wxt; plot x"
    ../src/gtk/dcclient.cpp(2041): assert "m_window" failed in DoGetSize(): GetSize() doesn't work without window [in thread 7f22d6c07700]
    
    Call stack:
    [00] wxOnAssert(char const*, int, char const*, char const*, wchar_t const*)
    [01] wxClientDCImpl::DoGetSize(int*, int*) const
    [02] wxBufferedDC::UnMask()                  
    [03] ~wxDC                                      /usr/include/wx-3.0/wx/dc.h:789
    [04] wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const
    [05] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
    [06] wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)
    [07] wxEvtHandler::TryHereOnly(wxEvent&)     
    [08] wxEvtHandler::ProcessEventLocally(wxEvent&)
    [09] wxEvtHandler::ProcessEvent(wxEvent&)    
    [10] wxEvtHandler::SafelyProcessEvent(wxEvent&)
    [11] 0x7f22e8025ee1
    [12] g_closure_invoke                        
    [13] 0x7f22e6af0aad
    [14] g_signal_emit_valist                    
    [15] g_signal_emit                           
    [16] gtk_widget_size_allocate                
    [17] 0x7f22e8024ff3
    [18] g_closure_invoke                        
    [19] 0x7f22e6af02c7
    [20] g_signal_emit_valist                    
    [xcb] Unknown request in queue while dequeuing
    [xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
    [xcb] Aborting, sorry about that.
    gnuplot: ../../src/xcb_io.c:179: dequeue_pending_request: Assertion `!xcb_xlib_unknown_req_in_deq' failed.
    Aborted
    

    A backtrace from gdb looks as follows:

    (gdb) bt
    #0  0x00007ffff02e23a9 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
    #1  0x00007ffff02e54c8 in __GI_abort () at abort.c:89
    #2  0x00007ffff02db4c6 in __assert_fail_base (fmt=0x7ffff0412428 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
        assertion=assertion@entry=0x7fffef9b0a8d "!xcb_xlib_unknown_req_in_deq", 
        file=file@entry=0x7fffef9b0a5b "../../src/xcb_io.c", line=line@entry=179, 
        function=function@entry=0x7fffef9b0f30 "dequeue_pending_request") at assert.c:92
    #3  0x00007ffff02db572 in __GI___assert_fail (assertion=0x7fffef9b0a8d "!xcb_xlib_unknown_req_in_deq", 
        file=0x7fffef9b0a5b "../../src/xcb_io.c", line=179, function=0x7fffef9b0f30 "dequeue_pending_request") at assert.c:101
    #4  0x00007fffef940f0c in ?? () from /usr/lib/x86_64-linux-gnu/libX11.so.6
    #5  0x00007fffef941d4b in _XReply () from /usr/lib/x86_64-linux-gnu/libX11.so.6
    #6  0x00007fffef93d83d in XSync () from /usr/lib/x86_64-linux-gnu/libX11.so.6
    #7  0x00007ffff3e97da1 in gdk_flush () from /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0
    #8  0x00007ffff3e68abe in ?? () from /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0
    #9  0x00007ffff3e694b0 in ?? () from /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0
    #10 0x00007ffff3e76d6e in ?? () from /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0
    #11 0x00007ffff3e787c0 in gdk_draw_rgb_image () from /usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0
    #12 0x00007ffff5f5d1f5 in wxBitmap::CreateFromImageAsPixmap(wxImage const&, int) ()
       from /usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-3.0.so.0
    #13 0x00007ffff5f5dd9a in wxBitmap::wxBitmap(wxImage const&, int) () from /usr/lib/x86_64-linux-gnu/libwx_gtk2u_core-3.0.so.0
    #14 0x0000000000506a8b in wxtPanel::wxt_cairo_create_bitmap (this=0x7fffdc08d1c0) at wxterminal/wxt_gui.cpp:3476
    #15 0x000000000050dc0a in wxtPanel::wxt_cairo_refresh (this=0x7fffdc08d1c0) at wxterminal/wxt_gui.cpp:2685
    #16 0x000000000050df5d in wxt_text () at wxterminal/wxt_gui.cpp:1926
    #17 0x00000000004ebdb9 in term_end_plot () at term.c:541
    #18 0x00000000004f1355 in term_end_plot () at term.c:533
    #19 0x0000000000454792 in do_plot (plots=0x7eba50, pcount=pcount@entry=1) at graphics.c:902
    #20 0x0000000000478afd in eval_plots () at plot2d.c:3311
    #21 0x0000000000429f02 in command () at command.c:614
    #22 do_line () at command.c:409
    #23 0x000000000042a0f5 in do_string_and_free (cmdline=0x7e9480 "set terminal wxt; plot x") at command.c:452
    #24 0x000000000042a135 in do_string (s=<optimized out>) at command.c:436
    #25 0x00000000004192d6 in main (argc=1, argv=0x7fffffffe0f8) at plot.c:623
    

    I googled a bit, and this is probably an issue with the multithreading, like the [xcb] ... message says.

    When I enable debugging (used #define DEBUG 1 in stdfn.h and #define WXTDEBUGINPUT 1 in wxt_gui.cpp) I can plot something like:

    set terminal wxt
    plot x
    

    but gnuplot crashes later e.g. when zooming by mouse with e.g. the message

    wxterminal/wxt_gui.cpp:3931 locking gui mutex
    gnuplot: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.
    Gnuplot not exited using gp_exit(). Exit handlers may not work correctly!
    wxterminal/wxt_gui.cpp:4011 initialize custom interrupt handler 2
    wxterminal/wxt_gui.cpp:3931 locking gui mutex
    wxterminal/wxt_gui.cpp:3940 unlocking gui mutex
    wxterminal/wxt_gui.cpp:3998 checking interrupt status
    wxterminal/wxt_gui.cpp:4020 restore custom interrupt handler 1
    wxterminal/wxt_gui.cpp:3791 gui thread status 0 1 1
    ../src/unix/threadpsx.cpp(1475): assert "This() != this" failed in Wait(): a thread can't wait for itself [in thread 7f8fa611f700]
    wxterminal/wxt_gui.cpp:3940 unlocking gui mutex
    wxterminal/wxt_gui.cpp:3998 checking interrupt status
    wxterminal/wxt_gui.cpp:4020 restore custom interrupt handler 0
    wxterminal/wxt_gui.cpp:3513 Event processed
    
    Call stack:
    [00] wxOnAssert(char const*, int, char const*, char const*, wchar_t const*)
    [01] wxThread::Wait(wxThreadWait)            
    [02] wxt_atexit()                               /home/cbersch/src/gnuplot-wxt-3.0b/src/wxterminal/wxt_gui.cpp:3795
    [03] gp_exit_cleanup                            /home/cbersch/src/gnuplot-wxt-3.0b/src/stdfn.c:447
    [04] 0x7f8fb18a1ba9
    [05] 0x7f8fb18a1bf5
    [06] 0x7f8fb545bb44
    [07] _XIOError                               
    [08] _XReply                                 
    [09] XSync                                   
    [10] wxWindow::Update()                      
    [11] wxStatusBar::DoUpdateStatusText(int)    
    [12] ~ConvertedBuffer                           /usr/include/wx-3.0/wx/string.h:3490
    [13] wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const
    [14] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
    [15] wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)
    [16] wxEvtHandler::TryHereOnly(wxEvent&)     
    [17] wxEvtHandler::ProcessEventLocally(wxEvent&)
    [18] wxEvtHandler::ProcessEvent(wxEvent&)    
    [19] wxEvtHandler::ProcessPendingEvents()    
    [20] wxAppConsoleBase::ProcessPendingEvents()
    Segmentation fault
    

    It can also happen, that the window freezes completely when zooming by mouse. I guess it'll be very hard to track this down.

    I've no experience with multithreading, wxwidgets and such. Hope, these informations are still helpful :)

    Christoph

     
  • Karl Ratzsch
    Karl Ratzsch
    2014-05-17

    gnuplot 465 crashes identically. Will try compiling my own wxWidgets 3.0 and see if it keeps up. Not this weekend, though, and neither the next. Got a thesis to write. :-)

    Should we have a configure option to switch between 2.8 and 3.0, at least until this is resolved?

     
  • Ethan Merritt
    Ethan Merritt
    2014-05-19

    I don't know how Debian sets it up, but on my system the choice of library versions is all done through wx-config. If you have multiple versions of wxWidgets installed then I suppose you must also have multiple versions of wx-config. Point to whichever one you want and the gnuplot's autoconfigure script should do the rest. That's what the option ./configure --with-wx= is for.

     
  • Ethan Merritt
    Ethan Merritt
    2014-05-20

    I installed wxgtk3.0.0 and rebuilt gnuplot - same bug. I applied the fix suggested in the nabble post above - yes, that seems to fix it.

    I'm still getting errors about icon bitmaps. That may be because I skipped some other library update. Plotting works, but there are no widgets visible on the plot window.
    Let me know if it works for you. The same fix should probably go into 4.6.

     
    • I also found this fix, but hadn't tested it. I had to explicitely link wxt_gui.o with -lX11 to compile it, but I get the same error as before. So no, it doesn't work for me.

      And also compiling with --with-wx-single-threaded doesn't help here, I get a segmentation fault in this case.

      BTW: The option --with-wx doesn't work on Debian, I need to use export WX_CONFIG=/usr/lib/x86_64-linux-gnu/wx/config/gtk2-unicode-3.0.

       
      Last edit: Christoph Bersch 2014-05-20
  • Ethan Merritt
    Ethan Merritt
    2014-05-20

    • status: open --> pending-fixed
     
    • Ethan Merritt
      Ethan Merritt
      2014-05-20

      That doesn't make sense. If it is not already linked and calling into the libX11, how can the original bug be explained as a failure to initialize libX11?

      Wait a minute.
      What do you mean "link wxt_gui.o with -lX11"? That's not a separate executable so where does the -l flag come in?

       
      • Sorry, indeed that doesn't make sense. The linking error happens when the gnuplot executable is linked:

        c++  -g -O2 -I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -pthread -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/libdrm -I/usr/include/pango-1.0   -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/libdrm -I/usr/include/harfbuzz   -fPIE    -o gnuplot alloc.o axis.o breaders.o boundary.o color.o command.o contour.o datablock.o datafile.o dynarray.o eval.o external.o fit.o gadgets.o getcolor.o graph3d.o graphics.o help.o hidden3d.o history.o internal.o interpol.o libcerf.o matrix.o misc.o mouse.o multiplot.o parse.o plot.o plot2d.o plot3d.o pm3d.o readline.o save.o scanner.o set.o show.o specfun.o standard.o stats.o stdfn.o tables.o tabulate.o term.o time.o unset.o util.o util3d.o variable.o version.o wxterminal/wxt_gui.o wxterminal/gp_cairo.o wxterminal/gp_cairo_helpers.o  qtterminal/qt_term.o -lreadline  -lncurses  -lz -lgd -lgd   -llua5.1    -L/usr/lib/x86_64-linux-gnu -pthread -Wl,-z,relro  -L/usr/lib/x86_64-linux-gnu   -lwx_gtk2u_richtext-2.8 -lwx_gtk2u_aui-2.8 -lwx_gtk2u_xrc-2.8 -lwx_gtk2u_qa-2.8 -lwx_gtk2u_html-2.8 -lwx_gtk2u_adv-2.8 -lwx_gtk2u_core-2.8 -lwx_baseu_xml-2.8 -lwx_baseu_net-2.8 -lwx_baseu-2.8  -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lglib-2.0   -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfontconfig -lgobject-2.0 -lglib-2.0 -lfreetype   -lQt5Network -lQt5Svg -lQt5PrintSupport -lQt5Widgets -lQt5Gui -lQt5Core   -ldl -lm  -lz -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lglib-2.0  
        /usr/bin/ld: wxterminal/wxt_gui.o: undefined reference to symbol 'XInitThreads'
        //usr/lib/x86_64-linux-gnu/libX11.so.6: error adding symbols: DSO missing from command line
        

        If I change the Makefile to add an -lX11 to this command it links correctly.

         
  • Ethan Merritt
    Ethan Merritt
    2014-05-20

    BTW: The option --with-wx doesn't work on Debian, I need to use export WX_CONFIG=/usr/lib/x86_64-linux-gnu/wx/config/gtk2-unicode-3.0.

    Yeah, I found that I had to do something of the sort also. The wx-config tool comes in with a different name. But let's not fiddle with the configure script until we figure out how to make wxgtk3 work if selected.

     
  • Ethan Merritt
    Ethan Merritt
    2014-05-20

    • status: pending-fixed --> open
     
  • Ethan Merritt
    Ethan Merritt
    2014-05-21

    For me it doesn't make sense to work on this problem until I such time as I have a machine where wxgtk3 is configured by default. Installing it on top of my existing setup is triggering too many library incompatibilities for me to take the remaining error messages seriously.

    What seems to be happening is that the initial fork of the thread that manages the display window [sometimes] returns too quickly, triggering the "doesn't work without open window" message. On my machines that message looks alarming but is non-fatal. The plots appear as normal despite that initial message. So I'm guessing that this is similar to the issue that some people were having with the initial fork of gnuplot_qt in the qt terminal. If it takes too long to initialize, the main program starts asking for window size information before the display manager is ready. Catching the error and waiting a bit would probably be sufficient, although adding proper synchronization would be better.

     
  • Ethan Merritt
    Ethan Merritt
    2014-05-29

    • status: open --> open-later
     
  • AntonG
    AntonG
    2014-06-01

    We in Debian also switched to wxwidget3.0 and got this problem. The proposed fix on 2014-05-19 from just partly fixes the problem. There are still warnings in a terminal:

    ==========================
    gnuplot -e "set terminal wxt; plot x"
    ../src/gtk/dcclient.cpp(2041): assert "m_window" failed in DoGetSize(): GetSize() doesn't work without window [in thread 7f908b5b0700]

    Call stack:
    [00] wxOnAssert(char const, int, char const, char const, wchar_t const)
    [01] wxClientDCImpl::DoGetSize(int, int) const
    [02] wxBufferedDC::UnMask()
    [03] 0x7f9099ec8513
    [04] wxAppConsoleBase::CallEventHandler(wxEvtHandler, wxEventFunctor&, wxEvent&) const
    [05] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler
    , wxEvent&)
    [06] wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)
    [07] wxEvtHandler::TryHereOnly(wxEvent&)
    [08] wxEvtHandler::ProcessEventLocally(wxEvent&)
    [09] wxEvtHandler::ProcessEvent(wxEvent&)
    [10] wxEvtHandler::SafelyProcessEvent(wxEvent&)
    [11] 0x7f9098f6adf1
    [12] g_closure_invoke
    [13] 0x7f90981afd3d
    [14] g_signal_emit_valist
    [15] g_signal_emit
    [16] gtk_widget_size_allocate
    [17] 0x7f9098f69f03
    [18] g_closure_invoke
    [19] 0x7f90981af557
    [20] g_signal_emit_valist
    Segmentation fault
    ==========================

    The gnuplot version is 4.6.5, 5.0 was not tested.

     
  • Ethan Merritt
    Ethan Merritt
    2014-06-11

    • summary: configure picks wrong wxwidgets version? --> changes needed in order to support wxWidgets 3.0
     
  • Ethan Merritt
    Ethan Merritt
    2014-12-13

    Looks like the wxwidgets people have responded to this bug report with "won't fix". I do not understand the logic or the decision, but here is a link to the tracker item:

    http://trac.wxwidgets.org/ticket/16034
    
     
  • Ethan Merritt
    Ethan Merritt
    2014-12-13

    Yay. I finally have a machine to work on that has wxWidgets 3.0 and supporting libraries properly configured so that I can work on this. Following the hints given in the wxwidgets tracker item above, I think I have managed to protect against this failure mode.

    I believe there is a wxwidgets bug involved (intrinsic function IsShownOnScreen() does not work as documented), but we can work around this by using our own window bookkeeping variables.

    Fix committed to cvs for both 5.0 and 5.1
    Please test.

     
    • Karl Ratzsch
      Karl Ratzsch
      2014-12-14

      Is the makefile still broken? I get the error "undefined reference to symbol XInitThread" mentioned above (xubuntu 14.10).

       
  • Ethan Merritt
    Ethan Merritt
    2014-12-14

    The makefile is not broken, but the library requirements listed by wx-config-3.0 are incomplete.

    From the gnuplot version 5 release notes:

    If you configure in the wxt terminal without also configuring in X11,
    you may need to set the environmental variable TERMLIBS:
    TERMLIBS="-lX11" ./configure

     
  • Karl Ratzsch
    Karl Ratzsch
    2014-12-15

    Ah. Got it. gp501-cvs now builds successfully with wxt3 (on xubuntu 14.10 here) after
    TERMOPT="-X11" ./configure

    however, the binary is a bit shaky. From time to time after a plot command (sometimes reproducible, e.g. when hitting any button in the terminal window triggering a replot) there is a warning

    (gnuplot:2852) Glib-Critical **: Source ID 269 was not found when attempting to remove it.

    The positions in gnuplot varies between different runs. That "Source ID" increases with every warning. At one time gnuplot crashed. (any idea where the crash log is? i thought it´d be in the current directory?)

     
    Last edit: Karl Ratzsch 2014-12-15
1 2 > >> (Page 1 of 2)