#677 Geany crashes when loading big one-line files

General (289)

This issue originally was reported against the Geany package in Fedora. It seems this is an issue concerning to Geany itself or maybe rather Scintilla, though. The issue is described very simple: The reporter loaded a file with 300MB of data in just one line. There maybe should be some sanity checks in Geany which handle this. For detailed information and reproducing the issue:

The file which was loaded: http://www.filesavr.com/L375LRYN5GCALK7
The backtrace: https://bugzilla.redhat.com/attachment.cgi?id=488371
The bugreport at Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=691668


  • Lex Trotman
    Lex Trotman

    As I read the backtrace the failure was simply running out of memory when trying to allocate nearly a gigabyte temporary buffer in Pango to layout the line.

    Since the maximum user virtual memory is about 3Gb on a 32 bit x86, by the time all the executable, stack and buffering is taken into consideration it is not surprising that the machine ran out of virtual memory.

    It probably would have worked on a 64 bit machine, albeit slowly if it started to page.

    Because machine virtual memory size and physical memory size and actual available memory size are not available to a program there is no way to predict how big a file will load ok, load slowly or fail completely.

    Discussions about a "large file" warning on open stalled because there is no sensible default, large for a netbook is a fleabite to a 64 bit desktop.

  • Nick Treleaven
    Nick Treleaven

    @elextr: Maybe I don't recall correctly, but I thought we discussed having a configurable setting to confirm the loading of big files would be Ok. Probably any X Mb default would be Ok, a user just has to confirm it and/or override the default with something bigger.