Opened 15 years ago

Closed 15 years ago

#22451 closed defect (fixed)

gimp2 @2.6.7_0+darwin_9+no_x11+quartz – Bus error on startup

Reported by: jp@… Owned by: dbevans (David B. Evans)
Priority: Normal Milestone:
Component: ports Version: 1.8.1
Keywords: Cc: hsivank@…, neric27@…, gellule.xg@…, lhorner@…, phriedrich
Port: gimp2

Description

A few seconds after the GUI comes up, gimp2 crashes on my system.

zaphod:~ jp$ gimp --g-fatal-warnings --stack-trace-mode=always
gimp: fatal error: Bus error
#0  0x9716b851 in __wait4 ()
#1  0x9716b847 in waitpid$UNIX2003 ()
#2  0x00f192ec in g_on_error_stack_trace ()
#3  0x00002be0 in gimp_eek ()
#4  0x00002c64 in gimp_fatal_error ()
#5  0x000036cc in gimp_sigfatal_handler ()
#6  <signal handler called>
#7  0x00000000 in ?? ()
#8  0x00a3c4b9 in send_crossing_event ()
#9  0x00a3d50e in _gdk_windowing_got_event ()
#10 0x00a4957c in _gdk_events_queue ()
#11 0x00a4817c in gdk_event_dispatch ()
#12 0x00f3fa0d in g_main_context_dispatch ()
#13 0x00f4348b in g_main_context_iterate ()
#14 0x00f43767 in g_main_loop_run ()
#15 0x00002319 in app_run ()
#16 0x00003493 in main ()

(script-fu:16354): LibGimpBase-WARNING **: script-fu: gimp_wire_read(): error

Output of dbus-mointor:

method call sender=:1.6 -> dest=org.freedesktop.DBus serial=1 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=Hello
method call sender=:1.6 -> dest=org.freedesktop.DBus serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',sender='org.freedesktop.DBus',path='/org/freedesktop/DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged'"
method call sender=:1.6 -> dest=org.freedesktop.DBus serial=3 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',sender='org.gimp.GIMP.UI',path='/org/gimp/GIMP/UI',interface='org.gimp.GIMP.UI'"
method call sender=:1.6 -> dest=org.freedesktop.DBus serial=6 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RemoveMatch
   string "type='signal',sender='org.gimp.GIMP.UI',path='/org/gimp/GIMP/UI',interface='org.gimp.GIMP.UI'"
method call sender=:1.6 -> dest=org.freedesktop.DBus serial=7 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RemoveMatch
   string "type='signal',sender='org.freedesktop.DBus',path='/org/freedesktop/DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged'"
signal sender=org.freedesktop.DBus -> dest=(null destination) serial=8 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string "org.gimp.GIMP.UI"
   string ""
   string ":1.6"
method call sender=:1.6 -> dest=org.freedesktop.DBus serial=8 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RequestName
   string "org.gimp.GIMP.UI"
   uint32 0
signal sender=org.freedesktop.DBus -> dest=(null destination) serial=9 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string "org.gimp.GIMP.UI"
   string ":1.6"
   string ""
signal sender=org.freedesktop.DBus -> dest=(null destination) serial=10 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.6"
   string ":1.6"
   string ""

Attachments (6)

crash.log (24.6 KB) - added by jp@… 15 years ago.
Error report I get after launching gimp2
Portfile (7.2 KB) - added by mark.pearson0@… 15 years ago.
Modified gtk2 Portfile
patch-gdk-quartz-gdkinputprivate.h.diff (519 bytes) - added by mark.pearson0@… 15 years ago.
Patch for gtk-2.8.15/gdk/quartz/gdkinputprivate.h
patch-gdk-quartz-gdkwindow-quartz.c.diff (606 bytes) - added by mark.pearson0@… 15 years ago.
Patch for gtk-2.8.15/gdk/quartz/gdkwindow-quartz.c
modified-gtk2-port.tar.bz (6.0 KB) - added by jp@… 15 years ago.
Modified port of gtk2 using latest source commits of gnome
patch-crossing-event.diff (2.0 KB) - added by gellule.xg@… 15 years ago.
I've used the same patch approach (I'm attaching my version), and do not have the error anymore.

Download all attachments as: .zip

Change History (37)

comment:1 Changed 15 years ago by jp@…

This is OS X 10.5.8. I also tried the no_python variant, but no success. This might be an error in dbus, because I get a "bus error" when starting inkscape, too.

comment:2 Changed 15 years ago by hsivank@…

Cc: hsivank@… added

Cc Me!

comment:3 Changed 15 years ago by jmroot (Joshua Root)

Keywords: gimp2 quartz no_x11 dbus removed
Owner: changed from macports-tickets@… to devans@…

Changed 15 years ago by jp@…

Attachment: crash.log added

Error report I get after launching gimp2

comment:4 Changed 15 years ago by mark.pearson0@…

I have the same problem with gimp2 @2.6.8_0+debug+no_x11+quartz running on Mac OS X 10.4.11.

$ gimp-2.6 --g-fatal-warnings --stack-trace-mode=always
gimp-2.6: fatal error: Bus error
#0  0x90029a57 in wait4 ()
#1  0x90029a47 in waitpid ()
#2  0x029ba458 in g_on_error_stack_trace ()
#3  0x0000368c in gimp_eek (reason=0x2d4554 "fatal error", message=0x1a4c6310 "Bus error", use_handler=1) at errors.c:228
#4  0x000036ff in gimp_fatal_error (fmt=0x9015f3d0 "Bus error") at errors.c:144
#5  0x000040a2 in gimp_sigfatal_handler (sig_num=10) at main.c:701
#6  <signal handler called>
#7  0x00000000 in ?? ()
#8  0x01727d3d in send_crossing_event ()
#9  0x01728002 in _gdk_synthesize_crossing_events ()
#10 0x01728bfb in _gdk_windowing_got_event ()
#11 0x01733fba in _gdk_events_queue ()
#12 0x01732d62 in gdk_event_dispatch ()
#13 0x029de295 in g_main_context_dispatch ()
#14 0x029e16fa in g_main_context_iterate ()
#15 0x029e1983 in g_main_loop_run ()

(script-fu:10103): LibGimpBase-WARNING **: script-fu: gimp_wire_read(): error

After googling 'send_crossing_event' and learning that crossing events are "emitted when the pointer enters or leaves a GdkWindow" I experimented a bit and discovered the following:

  • Gimp doesn't crash when interacting with the 'Layers, Channels, Paths ...' window (dockable dialogs window)
  • If I select File -> New and create a new image window Gimp doesn't crash
  • Gimp does crash if the mouse is moved over the 'Toolbox' window
  • Gimp does crash if the mouse is moved over the image window

Does this mean that its a Gimp problem? I don't know but I hope this is useful information for somebody who knows more about these things.

comment:5 Changed 15 years ago by neric27@…

Cc: neric27@… added

Cc Me!

comment:6 Changed 15 years ago by charmedguy18@…

The same thing happens to me with gimp +no_python +no_x11 +quartz. I was afraid of this before it even got done compiling because when I looked at the new binary gtk-demo, the fonts do not shape properly (shown here and here). If you go into Gimp and take a screenshot before it crashes, you'll see that there is some text that is, like gtk-test, blocks and obviously not shaped properly (shown here).

(gimp:645): Pango-WARNING **: shaping failure, expect ugly output. shape-engine='BasicEngineFc', font='Lucida Grande Medium 12', text='Looking for data files'

(gimp:645): Pango-WARNING **: shaping failure, expect ugly output. shape-engine='BasicEngineFc', font='Lucida Grande Medium 9.9990234375', text='Brushes'
LibGimpModule-Message: Module '/opt/local/lib/gimp/2.0/modules/libdisplay-filter-lcms.so' load error: dlopen(/opt/local/lib/gimp/2.0/modules/libdisplay-filter-lcms.so, 10): Symbol not found: _CMFlattenProfile
  Referenced from: /opt/local/lib/gimp/2.0/modules/libdisplay-filter-lcms.so
  Expected in: flat namespace
 in /opt/local/lib/gimp/2.0/modules/libdisplay-filter-lcms.so

(gimp:645): Pango-WARNING **: shaping failure, expect ugly output. shape-engine='BasicEngineFc', font='Lucida Grande Semi-Bold 9.9990234375', text='Brushes'

(gimp:645): Pango-WARNING **: shaping failure, expect ugly output. shape-engine='BasicEngineFc', font='Lucida Grande Medium Oblique 9.9990234375', text='Circle (11) (13 × 13)'

(script-fu:647): LibGimpBase-WARNING **: script-fu: gimp_wire_read(): error
Segmentation fault

Also, note that I have tried before to use jhbuild to build gimp +quartz but gtk+ never works because of libpangocairo.dylib. I have no doubt that pango and/or cairo are the reason this doesn't work properly. I'm not going to spend anymore time on this until it is functional so if someone else wants to make a ticket on the gtk+/pango/cairo issue, then be my guest.

comment:7 in reply to:  6 Changed 15 years ago by charmedguy18@…

Replying to charmedguy18@…:

The same thing happens to me with gimp +no_python +no_x11 +quartz. I was afraid of this before it even got done compiling because when I looked at the new binary gtk-demo, the fonts do not shape properly (shown here and here). If you go into Gimp and take a screenshot before it crashes, you'll see that there is some text that is, like gtk-test, blocks and obviously not shaped properly (shown here).

(gimp:645): Pango-WARNING **: shaping failure, expect ugly output. shape-engine='BasicEngineFc', font='Lucida Grande Medium 12', text='Looking for data files'

(gimp:645): Pango-WARNING **: shaping failure, expect ugly output. shape-engine='BasicEngineFc', font='Lucida Grande Medium 9.9990234375', text='Brushes'
LibGimpModule-Message: Module '/opt/local/lib/gimp/2.0/modules/libdisplay-filter-lcms.so' load error: dlopen(/opt/local/lib/gimp/2.0/modules/libdisplay-filter-lcms.so, 10): Symbol not found: _CMFlattenProfile
  Referenced from: /opt/local/lib/gimp/2.0/modules/libdisplay-filter-lcms.so
  Expected in: flat namespace
 in /opt/local/lib/gimp/2.0/modules/libdisplay-filter-lcms.so

(gimp:645): Pango-WARNING **: shaping failure, expect ugly output. shape-engine='BasicEngineFc', font='Lucida Grande Semi-Bold 9.9990234375', text='Brushes'

(gimp:645): Pango-WARNING **: shaping failure, expect ugly output. shape-engine='BasicEngineFc', font='Lucida Grande Medium Oblique 9.9990234375', text='Circle (11) (13 × 13)'

(script-fu:647): LibGimpBase-WARNING **: script-fu: gimp_wire_read(): error
Segmentation fault

Also, note that I have tried before to use jhbuild to build gimp +quartz but gtk+ never works because of libpangocairo.dylib. I have no doubt that pango and/or cairo are the reason this doesn't work properly. I'm not going to spend anymore time on this until it is functional so if someone else wants to make a ticket on the gtk+/pango/cairo issue, then be my guest.

I realize I posted this in the wrong ticket now...

Changed 15 years ago by mark.pearson0@…

Attachment: Portfile added

Modified gtk2 Portfile

Changed 15 years ago by mark.pearson0@…

Patch for gtk-2.8.15/gdk/quartz/gdkinputprivate.h

Changed 15 years ago by mark.pearson0@…

Patch for gtk-2.8.15/gdk/quartz/gdkwindow-quartz.c

comment:8 Changed 15 years ago by mark.pearson0@…

I have come up with a fix for this problem in the form of a couple of patches to the gtk2 port.

On further investigation it turned out that the Bus Error was caused by a non-existent 'method' input_window_crossing being called on a quartz GdkWindowObject. The patches I have provided are not a permanent fix for gtk2 since I don't have enough in-depth knowledge about Gtk+ to know which parts of the quartz implementation are lacking and how to fix them, but at least these patches allowed me to get Gimp into a usable state. As such this fix should be viewed as just that - an interim measure to prevent Gimp from being totally unusable.

To use the patches do the following (assuming you don't have a local port repository), replacing 'mark' with your username of course:

  1. Create a folder in your home directory e.g. /Users/mark/ports to act as the local repository
  2. Within that folder create a folder x11/gtk2 (yes I know we're talking gtk-quartz here but at the moment gtk2 lives under the category 'x11' so I'm not going to argue)
  3. Save the attachment Portfile to /Users/mark/ports/x11/gtk2
  4. Create a folder called files in the x11/gtk2 folder
  5. Save the two patch-gdk-quartz-....diff attachments to the files folder you just created
  6. Edit the file /opt/local/etc/macports/sources.conf and add a line file:///Users/mark/ports before the rsync://... line (this means Macports will use locally modified ports in preference to ports of the same name in the global repository, in our case port 'gtk2')
  7. cd to /Users/mark/ports and type portindex to get Macports to index this local version of gtk2

Then uninstall gtk2 with sudo port -f uninstall gtk2, and reinstall (from the local repository) using sudo port install gtk2.

Please note: This does not fix other crashes/problems I still experience with Gimp such as a different bus error when quitting Gimp, and also popup windows appearing behind the image window, toolbox and layers/channels dock window.

Hopefully this information is useful to somebody.

comment:9 Changed 15 years ago by mark.pearson0@…

A minor point, but I just realised the gdk/quartz attachments should refer to gtk-2.18.5 not gtk-2.8.15. Sorry for any confusion.

comment:10 Changed 15 years ago by jp@…

I followed your steps one by one, but I encountered an error:

--->  Fetching gtk2
--->  Attempting to fetch patch-gtk-builder-convert.diff from http://arn.se.distfiles.macports.org/gtk2
--->  Attempting to fetch patch-gtk-builder-convert.diff from http://distfiles.macports.org/gtk2
--->  Attempting to fetch patch-gtk-builder-convert.diff from http://aarnet.au.distfiles.macports.org/pub/macports/mpdistfiles/gtk2
--->  Attempting to fetch patch-gtk-builder-convert.diff from http://svn.macports.org/repository/macports/distfiles/gtk2
--->  Attempting to fetch patch-gtk-builder-convert.diff from http://svn.macports.org/repository/macports/distfiles/general/
Error: Target org.macports.fetch returned: fetch failed
Error: Status 1 encountered during processing.

comment:11 Changed 15 years ago by mark.pearson0@…

Sorry for the delay in replying to the above query. I'm afraid that after 1.5 months of fighting to get both Gimp and Digikam working under any combination of KDE4/Gnome/X11/Quartz on Tiger I gave up in despair and installed Ubuntu on my MacBook Pro.

I don't know what the 'Attempting to fetch patch-gtk-build-convert.diff' errors are caused by.

Just for information: even when I got Gimp running with gtk2 +quartz it wasn't usable because popup dialog windows would popup behind the other windows. It also crashed with bus errors on running certain script-fu scripts and when quitting Gimp.

Wish there was better news...

comment:12 Changed 15 years ago by jp@…

Thanks for trying to solve this anyway. Looks like I have to fall back (again) to the X11 version.

comment:13 Changed 15 years ago by gellule.xg@…

A fix for this issue seems to have made it to the gtk master, but not to the 2.18 branch. See: http://git.gnome.org/browse/gtk+/commit/?id=42ac2268773936a0a85b017e5ebac83c4b0b7557 https://bugzilla.gnome.org/show_bug.cgi?id=598881

Maybe a macports patch could be crafted in the mean time.

Changed 15 years ago by jp@…

Attachment: modified-gtk2-port.tar.bz added

Modified port of gtk2 using latest source commits of gnome

comment:14 Changed 15 years ago by jp@…

I created some patches from the repo gellule pointed me to. Just extract the archive I attached to this report in a folder called "ports" and follow from Step 6 in Marks how-to. I didnt test it very much, though.

comment:15 Changed 15 years ago by gellule.xg@…

Cc: gellule.xg@… added

Cc Me!

Changed 15 years ago by gellule.xg@…

Attachment: patch-crossing-event.diff added

I've used the same patch approach (I'm attaching my version), and do not have the error anymore.

comment:16 Changed 15 years ago by lhorner@…

Cc: lhorner@… added

Cc Me!

comment:17 Changed 15 years ago by drechsel@…

Worked for me on Mac OS X 10.4.11 PPC - thanks! - I used

sudo port install -f gtk2 +aqua+no_x11

to install the patched port

comment:18 in reply to:  17 Changed 15 years ago by drechsel@…

Replying to drechsel@…:

Worked for me on Mac OS X 10.4.11 PPC - thanks! - I used

sudo port -f install gtk2 +aqua+no_x11

to install the patched port

comment:19 Changed 15 years ago by jp@…

Cc: jp@… added

Cc Me!

comment:20 Changed 15 years ago by jp@…

Cc: jp@… removed

Cc Me!

comment:21 in reply to:  14 Changed 15 years ago by lhorner@…

Replying to jp@…:

I created some patches from the repo gellule pointed me to. Just extract the archive I attached to this report in a folder called "ports" and follow from Step 6 in Marks how-to. I didnt test it very much, though.

I succeeded using this patch in getting Gimp quartz running. (I haven't done much with it yet. If I find a problem I'll report it here.) G4 running 10.5.8.

comment:22 Changed 15 years ago by jp@…

@maintainer: Would be great if the patches could be checked in. The attached patches seem to work quiet well.

comment:23 Changed 15 years ago by jp@…

Cc: jp@… added

Cc Me!

comment:24 Changed 15 years ago by jp@…

Cc: jp@… removed

Cc Me!

comment:25 Changed 15 years ago by gellule.xg@…

I had an E-mail exchange with Matthias Clasen (the GTK+ 2.18 branch maintainer). He should be cherry picking this fix for the next 2.18.8 release which should be made available in about one week (assuming a constant ~1 month release cycle). Then an upgrade of macport's GTK to the 2.18.8 version should fix the issue.

comment:26 Changed 15 years ago by gellule.xg@…

Yes! The fix has been picked up by the 2.18 branch. We'll get it with 2.18.8. See: http://git.gnome.org/browse/gtk+/commit/?h=gtk-2-18&id=2f66220326e3619e75fbad4ab8fdf8d90338a7ad

comment:27 Changed 15 years ago by gellule.xg@…

Gtk 2.18.8 has been released. See also: http://trac.macports.org/ticket/24068

comment:28 Changed 15 years ago by phriedrich

Cc: info@… added

Cc Me!

comment:29 Changed 15 years ago by gellule.xg@…

Fixed for me with latest gtk2 port (version 2.18.8 of gtk, r65210 in macports). Sweet!

comment:30 Changed 15 years ago by jp@…

Works for me too. Could someone set this to "fixed"?!

comment:31 Changed 15 years ago by mf2k (Frank Schima)

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.