After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 472770 - Load image -> Crash!
Load image -> Crash!
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
git master
Other All
: Normal major
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2007-09-02 09:00 UTC by david gowers
Modified: 2007-09-07 13:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
192dpi PNG that breaks GIMP (11.61 KB, image/png)
2007-09-02 09:02 UTC, david gowers
Details
source xcf (193.85 KB, application/octet-stream)
2007-09-02 09:04 UTC, david gowers
Details
192dpi, 1280x960 xcf that doesn't crash gimp (146.50 KB, application/octet-stream)
2007-09-02 09:08 UTC, david gowers
Details
makes other attachments obsolete. Ignore this file. (43 bytes, text/plain)
2007-09-06 10:48 UTC, david gowers
Details
my sessionrc (4.84 KB, text/plain)
2007-09-06 23:15 UTC, david gowers
Details

Description david gowers 2007-09-02 09:00:24 UTC
1. Set monitor DPI to 96 in gimp. Disable Dot per Dot (by default, or on the image window). (note that enabling Dot Per Dot does not fix this crash. I specify to disable it only for the purposes of consistency.)
2.Load an image that is 192 dpi, then GIMP crashes.
2.or, load an image that is 96 dpi, and use 'scale image' to set the dpi to 192x192 -> gimp crashes.

The change causing this problem has almost certainly occurred within the last 2 days.

A few images are attached:
*One that causes the crash, one which doesn't. Both are 192x192 dpi, 1280x960 pixels.
*The XCF that the crash-causing PNG is based on - opening this causes a crash also.

Note that thumbnailing still works fine -- the crash occurs after the image window opens, but before the image is shown.
Comment 1 david gowers 2007-09-02 09:02:11 UTC
Created attachment 94796 [details]
192dpi PNG that breaks GIMP

gthumb and gimp's thumbnailing display this correctly, with no trouble.
Comment 2 david gowers 2007-09-02 09:04:34 UTC
Created attachment 94797 [details]
source xcf

xcf that the png was extracted from. Also causes GIMP to crash.
xcftools displays this xcf correctly and also was able to extract all layers correctly.
Comment 3 david gowers 2007-09-02 09:08:36 UTC
Created attachment 94798 [details]
192dpi, 1280x960 xcf that doesn't crash gimp

xcfview disrespects the DPI setting on this, but otherwise displays it correctly.

I suspect this bug is caused by improper copy+paste for GRAYA scaling.

Note: opening this a second time *DOES* crash the GIMP.
Comment 4 david gowers 2007-09-02 11:30:17 UTC
Oops, looks like this was caused by the latest scale-region.c from bug #464466. I thought I'd tested it correctly, but apparently not. Closing.
Comment 5 david gowers 2007-09-02 12:05:32 UTC
No, actually some really dodgy bug is happening, and it just happened to synchronize with my tests. After removing the experimental scale-region.c, running 'make clean; make;make install', crashing still happened. 

AAARGH.

Reopening.
Comment 6 david gowers 2007-09-02 13:28:18 UTC
nope, sorry. It's most likely a subtle incompatibility between gj's scale-region.c and the recent changes to GimpDisplayShell.
Closing, finally.
Comment 7 david gowers 2007-09-02 13:52:30 UTC
Not finally; reopened; the crash just occurs whenever it feels like it regardless of which scale-region.c I'm using. Sorry about the noise.

THIS JUST BOILS DOWN TO: WITH A CLEAN COMPLETELY FRESH COMPILE+INSTALLATION OF SVN GIMP, GIMP JUST CRASHES ARBITRARILY UPON OPENING AN IMAGE, WHETHER THROUGH THE OPEN DIALOG OR GIMP-REMOTE. IT IS POSSIBLE THAT THE CRASH OCCURS PER-SESSION (that is, it either will crash on any image that you could possibly open for a given session, or it won't crash on any of the images you could open).

GAH. >_< 

Anyhow, this appears to be real, but I'm at a loss to explain it. Hopefully it is easily reproduced. The DOT FOR DOT setting is irrelevant, it's crashed with the default set either way. The DPI setting is probably also irrelevant.
Comment 8 david gowers 2007-09-03 13:21:51 UTC
Okay, I've tested with 2.4rc1, and it doesn't exhibit this crashing behaviour. So the crash-causing code has been introduced after the rc1 release was made.

(I also adjusted OS field to be accurate. The bug is probably present on all platforms -- but I *know* it is evident on Linux.)
Comment 9 david gowers 2007-09-04 00:49:40 UTC
Adjusting summary to be more accurate.

Other details:
OS: Ubuntu 6.06, running on a AMD Duron with 1gb of RAM
Window Manager: dwm
GLib 2.14.1 (SVN)
GTK+ 2.11.7 (SVN)
Comment 10 david gowers 2007-09-04 00:51:06 UTC
Adjusting summary to be more accurate.

Other details:
OS: Ubuntu 6.06, running on a AMD Duron with 1gb of RAM
Window Manager: dwm
GLib 2.14.1 (SVN)
GTK+ 2.11.7 (SVN)
Comment 11 david gowers 2007-09-05 01:05:00 UTC
2.4rc1: doesn't exhibit this bug.
2.4rc2: does exhibit this bug.

Stacktrace later.
Comment 12 Michael Schumacher 2007-09-05 09:00:00 UTC
I can't reproduce the crash with rc2 on Windows, neither with the XCF nor with the PNG file.
Comment 13 david gowers 2007-09-06 00:25:47 UTC
In case I haven't been perfectly clear: The crash happens when opening virtually any image. It seems to be random luck if a crash DOESN'T occur. Really, steps to reproduce are simpler than I thought:
1. Load image
2. See GIMP crash after the image window appears, before the image is displayed in it. (To me, this points at recent changes in gimpdisplayshell.c causing the crash.)

I'll try to mark all attachments as obsolete.
It seems I have to recompile RC2 again before I can reinstall it; I'll have a stacktrace sometime today.
Comment 14 david gowers 2007-09-06 01:35:28 UTC
I just found out: This crash never occurs for indexed images, only RGB/RGBA/GRAY/GRAYA. And sometimes, it won't occur -- ie. I can open the same file twice, and the first time it might be okay, the second time it crashes immediately.


It looks like it's a tile refcounting bug:


tile_release (tile=0x0, dirty=0) at tile.c:176
176	  tile->ref_count--;



But that may be misleading, since tile_manager_get is returning a NULL tile:


  • #0 tile_release
    at tile.c line 176
  • #1 tile_manager_get
    at tile-manager.c line 203
  • #2 pixel_regions_configure
    at pixel-region.c line 559
  • #3 pixel_regions_register
    at pixel-region.c line 330
  • #4 pixel_regions_process_parallel_valist
    at pixel-processor.c line 369
  • #5 pixel_regions_process_parallel
    at pixel-processor.c line 475
  • #6 initial_region
    at paint-funcs.c line 4278
  • #7 gimp_projection_construct
    at gimpprojection-construct.c line 481
  • #8 gimp_projection_validate_tile
    at gimpprojection.c line 688
  • #9 tile_manager_validate
    at tile-manager.c line 292
  • #10 tile_lock
    at tile.c line 162
  • #11 tile_manager_get
    at tile-manager.c line 258
  • #12 read_pixel_data_1
    at tile-manager.c line 774
  • #13 gimp_projection_get_pixel_at
    at gimpprojection.c line 266
  • #14 gimp_pickable_pick_color
    at gimppickable.c line 209
  • #15 gimp_image_pick_color
    at gimpimage-pick-color.c line 83
  • #16 gimp_cursor_view_update_cursor
    at gimpcursorview.c line 419
  • #17 gimp_display_shell_update_cursor
    at gimpdisplayshell-cursor.c line 169
  • #18 gimp_display_shell_canvas_tool_events
    at gimpdisplayshell-callbacks.c line 1482
  • #19 _gtk_marshal_BOOLEAN__BOXED
    at gtkmarshalers.c line 84
  • #20 IA__g_closure_invoke
    at gclosure.c line 490
  • #21 signal_emit_unlocked_R
    at gsignal.c line 2440
  • #22 IA__g_signal_emit_valist
    at gsignal.c line 2209
  • #23 IA__g_signal_emit
    at gsignal.c line 2243
  • #24 gtk_widget_event_internal
    at gtkwidget.c line 4675
  • #25 IA__gtk_main_do_event
    at gtkmain.c line 1545
  • #26 gdk_event_dispatch
    at gdkevents-x11.c line 2351
  • #27 IA__g_main_context_dispatch
    at gmain.c line 2061
  • #28 g_main_context_iterate
    at gmain.c line 2694
  • #29 IA__g_main_loop_run
    at gmain.c line 2898
  • #30 app_run
    at app.c line 246
  • #31 main
    at main.c line 385



I've tried opening different images, and the backtrace remains essentially the same.
Comment 15 Michael Schumacher 2007-09-06 08:48:54 UTC
(In reply to comment #13)
> In case I haven't been perfectly clear: The crash happens when opening
> virtually any image.

Then you should probably mark the attachments as obsolete.
Comment 16 david gowers 2007-09-06 10:48:00 UTC
Created attachment 95045 [details]
makes other attachments obsolete. Ignore this file.

I said I'd try, but I haven't been able to; the Edit link doesn't seem to allow it.
It seems to me that the only way to do so is to make a dummy attachment which obsoletes them.
So I am doing that.
Comment 17 Martin Nordholts 2007-09-06 18:11:32 UTC
What is odd is that your stacktrace contains a call to `gimp_image_pick_color'. That function is not called for me when I open an image.

If you clear your ~/.gimp-2.4, does it help? If not, try to remove gimp stuff from PREFIX/lib|share|bin and reinstall, just to make sure you start fresh.

Let's try to sort this out for 2.4.
Comment 18 Michael Natterer 2007-09-06 18:49:56 UTC
The stack trace is entirely reasonable. It crashes when the "Cursor"
dockable wants to update the color under the cursor of the newly
opened image. However, I cannot reproduce this even with the cursor
dockable open.

Comment 19 Michael Natterer 2007-09-06 18:56:37 UTC
Argh, I see the bug. It's all in the stack trace and caused by my
fix for bug #472170.

However, while I see the bug in the stack trace, I still can't
reproduce it... will look into fixing it anyway.
Comment 20 david gowers 2007-09-06 23:15:41 UTC
Created attachment 95093 [details]
my sessionrc

Attaching a copy of my sessionrc in the hope it helps to reproduce the bug.
Comment 21 Jörg Gittinger 2007-09-07 07:45:12 UTC
I have Gimp crashes on my Windows XP installation with RC1 and RC2 when gimp is about to update the last tile in the bottom right corner. With RC1 and RC2 this happens only when opening large images (3000x2000), not with small ones that fit 100% on the screen. With RC1 this happened from time to time, with RC2 always. Since the tile update is so slow (*weap*) on Windows I can watch the tile update progress until it reaches the bottom right corner and then - *crash*.

Interestingly on my Vista Notebook RC1 runs almost stable ?!?! I haven't tried RC2 yet.
Comment 22 Jörg Gittinger 2007-09-07 08:09:47 UTC
I just verified that the crash happens on my XP installation when displaying the large image with 33% zoomed view - not in 100% view.
Comment 23 Michael Natterer 2007-09-07 08:44:48 UTC
Jörg, I think your crashes are unrelated, please check bug #469831 instead.

I'm very sure this fixes the bug, but I could never reproduce it.
Closing as FIXED anyway, please reopen if it's still there.

2007-09-07  Michael Natterer  <mitch@gimp.org>

	* app/base/tile-manager.c (read_pixel_data_1): use a temporary
	variable to store the return value of tile_manager_get() instead
	of assigning to tm->cached_tile directly to make sure
	tm->cached_num and tm->cached_tile are always in a consistent
	state (the requested tile might be invalid and needs to be
	validated, which would call tile_manager_get() recursively, which
	in turn would clear the cached tile). Fixes bug #472770.
Comment 24 david gowers 2007-09-07 13:32:10 UTC
Works for me. Thanks.