Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#596 gnuplot_x11 segfault 3

Version 5
closed
nobody
None
5
2014-06-18
2012-08-17
Peter Schiffer
No

Hello,

last segfault fix from me. Bug report with 2 backtraces can be found here: https://bugzilla.redhat.com/show_bug.cgi?id=766215
However there is no reproducer and I wasn't able to test proposed patch.
I've removed the "if (current_plot)" condition because it seems irrelevant and if current_plot is false, new_cmap->pixels variable won't be allocated, what could lead to given segfaults. But of course, this can be incorrect solution, so please be cautious when reviewing this patch.

Thanks,

peter

Discussion

  • Peter Schiffer
    Peter Schiffer
    2012-08-17

    realloccolors-sigsegv.patch

     
  • Ethan Merritt
    Ethan Merritt
    2012-08-18

    gnuplot_x11 can maintain and refresh multiple plot windows. current_plot points to the one (if any) that gnuplot itself is still connected to. The others belong to previous plots (gnuplot "persist" option). The if (current_plot) test will fail if an event is triggered via one of the other plot windows.

    It would help a lot to have a recipe for reproducing these failures. My inclination is to think that if the connection to the active plot is lost (i.e. current_plot is NULL), and the connection to X server context is also lost (current_gc is also NULL), then no recovery is possible and the program should just exit. But it is possible that what you are seeing is the result of one or more X11 events that the program was never expecting to see and can safely ignore. I'll stare harder at the backtrace to see if it offers any hints.

     
  • Peter Schiffer
    Peter Schiffer
    2012-08-22

    So, if I understand correctly, ReallocColors() is needed only if event is triggered by the currently connected plot window to gnuplot. (and no curly braces are missing for the "if (current_plot)"). Right?

    Otherwise I have no more ideas :-(

     
  • Ethan Merritt
    Ethan Merritt
    2014-06-18

    • status: open --> closed
    • Group: --> Version 5