Menu

#2296 gnuplot crashes on Windows plotting >=100000 data points with impulse style

None
closed-fixed
nobody
Windows (118)
2021-06-02
2020-08-16
No

I'm using gnuplot on Windows 10 (64 Bit). Gnuplot version 5.2.8.
(It seems the bug was introduced with version 5.2.0. Version 5.0.7 does not show the bug.)

When I'm trying to plot data with about 100000 (1x10^5) or more data points and using the "impulse" style, gnuplot will crash (gnuplot.exe as well as wgnuplot.exe) when using the terminal "windows". The backend ("GDI", "GDI+", "Direct2D") does not matter.
There is no crash using terminal "qt".
There is no crash when using the "point" style or "lines" style.
There is no crash when using gnuplot on Linux.

The following command sequence in gnuplot or wgnuplut will crash it:
> set term windows
> set samples 100000
> plot [0:99999] plot sin(x) with impulses

A white window will appear for a short moment and gnuplot crashes with the following error showing up (see attached screenshot):
"Exception code=0xc0000005 flags=0x0 at 0x00000000005A9298. Access violation - attempting to read data at address 0x0000000000000000"

The crash also happens with data files containing about 100000 data points or more, depending on the data. E.g., 100000 random integers in the range [0, 100] will lead to a crash, but no crash with random integers in the range [0, 1].

I have tested other versions of gnuplot, and to me it seems the bug was introduced in version 5.2.0 Version 5.0.7 and below do not crash.

1 Attachments

Discussion

  • Bastian Märkisch

    • labels: --> Windows
     
  • flipliquid

    flipliquid - 2021-01-08

    Also seeing this on windows. Gnuplot version 5.4.

    After running "wgnuplot"

    gnuplot> plot sin(x)/x 
    

    This demonstrates the same behavior as @markisch mentioned. A separate blank window will pop up and then both the wgnuplot host window and the blank window both crash/close. Except I'm also seeing the issue with the 'lines' style. E.g. the following

    plot 'mydata.dat' with lines
    

    will crash.

    I'm not seeing this behavior after changing to Qt.

     
  • Bastian Märkisch

    Confirmed with

    set term windows
    set samples 100000
    plot [0:99999] sin(x) with impulses
    

    using the 64 bit Windows version. Does not depend on wether I use the Direct2D or GDI+ backend.

     
  • Bastian Märkisch

    • status: open --> pending-fixed
     
  • Bastian Märkisch

    We are running out of certain memory when building the list of plot commands. Unfortunately, we failed to detect that in a number of cases which leads to segfaults. Now we just stop drawing in that case.
    The particular memory API used here - LocalAlloc() - is slow and deprecated and should be replaced.

     
  • Ethan Merritt

    Ethan Merritt - 2021-06-02
    • Status: pending-fixed --> closed-fixed
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.