GNOME Bugzilla – Bug 591097
[Win32] Crash loading file with image
Last modified: 2009-12-13 15:51:36 UTC
When I try to open a (specific) spreadsheet created with version 1.9.1 (windows) with any later version I have tried (1.9.3-1.9.10) the pop-up box with contents "gnumeric.exe has generated errors and will be closed by Windows. You will need to restart the program". The error occurs when the reading file bar is almost complete. This spreadsheet opens ok with the Linux version 1.7.12, but the file saved with this version also gives the same error when opened with 1.9.3 or later.
Please attach a copy of the file that causes this problem.
Created attachment 140152 [details] Spreadsheet with multiple sheets This file will crash all versions of Gnumeric after 1.9.1 that I have tried. It is 4447KB and too large to submit. Is there somewhere else I can put it?
You could send it directly to Morten: mortenw (at) gnome.org or me: aguelzow (at) pyrshep.ca
In either case, you might want to try compressing the file first using winzip or something like that. That often cuts down the file size by 90% or more.
Ok, got the file. It loads fine for me, however. (That's on Linux.) The log file has a stack trace that suggests that the problem is related to one or more of the embedded images. FramePtr ReturnAd Param#1 Param#2 Param#3 Param#4 Function Name 0022E0A8 003A6E5A 033694B8 0022E0E8 00066B5A 00066F5A !<nosymbols> 0022E0F8 68BCA30E 03EF98B0 0022E138 00066F5A 0022E138 !gdk_pixbuf_loader_close 0022E148 68BCAF63 00000000 3FF00000 0022E178 68BC2CAE !sheet_object_image_set_crop 0022E178 68BC45ED 03530510 03F01C70 01822188 03ED0F18 !sheet_object_image_set_image 0022E198 68B70F7E 03530510 03F01C70 0022E1B8 00000000 !sheet_object_new_view 0022E1B8 63A43C6F 03F01C70 03F01C70 00000001 017B8420 !gnm_pane_compute_visible_region
A potentially related issue is described in bug 537683
I also find that the file opens correctly using Mandriva Linux 2009.1 with Gnumeric 1.9.5, and the embedded images are displayed correctly. I have tried some other windows versions: The version from http://www.gnome.org/~jody/gnumeric/win32/gnumeric-1.9.0-win32-1.exe dated 2008-02-28 works correctly and opens the images imbedded in the file. (This is most likely the one I used to create the file, as my file was dated 2008-06-19 before saving it again recently.) The version from http://www.gnome.org/~jody/gnumeric/win32/gnumeric-1.7.12-win32-1.exe dated 2007-09-05 works also with display of the images. The 1.9.1 version opens without a crash, but the images aren't displayed properly. The image areas are blue with "?" scattered across the image in different colors. The 1.9.3 and later versions crash, as I previously reported. So I imagine that the windows versions of the graphics handling routines are generating the crash.
The image you see in 1.9.1 was the "unknown image type" image.
I think this crash is caused by a NULL pointer dereference in gdip_buffer_to_bitmap: http://git.gnome.org/cgit/gtk+/tree/gdk-pixbuf/io-gdip-utils.c static GpBitmap * gdip_buffer_to_bitmap (const gchar *buffer, size_t size, GError **error) { HRESULT hr; HGLOBAL hg = NULL; GpBitmap *bitmap = NULL; IStream *stream = NULL; GpStatus status; guint64 size64 = size; hg = gdip_buffer_to_hglobal (buffer, size, error); if (!hg) return NULL; IStream_SetSize (stream, *(ULARGE_INTEGER *)&size64); --> The above IStream_SetSize call is too early (stream is still NULL) hr = CreateStreamOnHGlobal (hg, FALSE, (LPSTREAM *)&stream); if (!SUCCEEDED (hr)) { gdip_set_error_from_hresult (error, GDK_PIXBUF_ERROR_FAILED, hr, _("Could not create stream: %s")); GlobalFree (hg); return NULL; } --> The Istream_SetSize call should be here, after the error checking (just like in gdip_buffer_to_image) status = GdipCreateBitmapFromStream (stream, &bitmap); The bug was introduced while fixing Bug 552545: http://git.gnome.org/cgit/gtk+/commit/?id=b559c7dacc4a7f8ee0e525192775eac5207e3cc4
*** Bug 590384 has been marked as a duplicate of this bug. ***
This is fixed in current gtk.
(In reply to comment #11) > This is fixed in current gtk. The windows build will not run on Windows 2000 SP4. It fails in ws2_32.dll with an entry point not found message. In addition, when installed on Windows XP, this windows version of Gnumeric runs, but the graphics export of charts ("Save as Image") has only the SVG type in the dropdown list. Version 1.9.3 has SVG, PNG, JPEG, PDF, PS, EPS types. This is a significant shortcoming of the new version.