GNOME Bugzilla – Bug 493176
gimp_tool_set_active_modifier_state assertion failed
Last modified: 2008-10-30 20:03:27 UTC
From Debian bug report http://bugs.debian.org/448525: I choose rectangle select, and when I finally release the mouse after pulling out the rectangle, the following message shows up on the console, though everything seems to work fine. Gimp-Tools-CRITICAL **: gimp_tool_set_active_modifier_state: assertion `display == tool->focus_display' failed Backtrace from the warning:
+ Trace 174951
The reporter will need to provide more info as this does not seem to be enough for reproducing. For example, what tool (and how) did he use before using the Rectangle Select Tool?
The user seems to get the message whenever he uses the tool, even if it's the first thing he uses after staring up gimp.
I have a propably related bug report, on Gimp 2.4.2: I recently bought a Wacom Bamboo tablet, and after fighting kernel, X and GTK, finally managed to get Gimp to recognize it as an extended input device. However, now Gimp crashes with the same error message than the original author (no backtrace, sorry) when I lift the stylys from the pad after drawing a stroke with the brush tool. I experimented a bit more with it and noticed that if I select any tool at all with the mouse before using the stylus the first time, everything works fine. GTK is version 2.12.2. Also, this Linux installation began its life as Red Hat 9, and has since been updated beyond all recognition, so this _could_ conceivably be some weird library issue or something.
A stack trace would be incredibly helpful. If you're not sure how to get one, please ask and I'll tell you.
I configured Gimp 2.4.2 with --enable-debug. I've attached the backtrace and all other console output at the end of this message. Please tell if you need something more. Furthermore, I've done some additional testing. This bug is triggered (at least in the debug version) if, and only if, GIMP switches automatically to another tool than the currently selected one when it start receiving input from the stylus, as soon as I lift the stylus. In my previous report, for whatever reason the default tool when GIMP started was the finger thing (smudge ?), and GIMP switched to a brush as I used the stylus. Anyway, debugger output follows. *** [bin]$ gdb ./gimp-2.4 GNU gdb 6.7 Copyright (C) 2007 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu"... Using host libthread_db library "/lib/libthread_db.so.1". (gdb) run Starting program: /home/juho/gimpdebug/bin/gimp-2.4 [Thread debugging using libthread_db enabled] [New Thread 0xa73f86b0 (LWP 4394)] Gimp-Tools-CRITICAL **: gimp_tool_set_active_modifier_state: assertion `display == tool->focus_display' failed aborting... Program received signal SIGABRT, Aborted.
+ Trace 181051
Thread 2805958320 (LWP 4394)
I did some more testing and debugging, and the bug seems to happen randomly even if I have used another tool before; however, the common factor is that tool->focus_display on the stack frame 6 (the backtrace is also always the same) is always 0x0.
Great, that's very helpful. I think it's likely that the problem was caused by some recent changes mitch made. There is another thing you could do that might shed further light: go into the "app" directory and run "touch tools/gimptool.c", then, as root, "DEBUG_FOCUS=true make install". This should enable some debugging output that mitch set up. Then run gimp again in a way that produces the error, and note the messages that appear on the console, and add them here. There's no need for another stack trace, it wouldn't be any different.
Setting the DEBUG_FOCUS environment variable is not going to have any effect. You need to set -DDEBUG_FLAGS in the CPP_FLAGS environment variable and reconfigure. But it's a lot simpler to just edit app/tools/gimp-tool.c and add the line #define DEBUG_FOCUS 1 somewhere at the top of the file. And you wouldn't run make as root. Root privileges are only needed for installing the resulting executable. But you can just run it directly from the app directory.
I did as Neumann said. The actions taken here: 1. I started GIMP. 2. Using the stylus as a mouse, I created a new image. 3. I drew a stroke with the stylys and the brush tool. 4. Using the normal mouse (PS/2) I selected the pencil tool and drew a stroke. 5. Using the stylys (which automatically selected the brush again) I drew a stroke. 6. The program crashed. *** [bin]$ ./gimp-2.4 gimp_tool_set_focus_display: tool: 0x8544318 display: 0x8cdf7b0 focus_display: (nil) gimp_tool_set_modifier_state: tool: 0x8544318 display: 0x8cdf7b0 focus_display: 0x8cdf7b0 gimp_tool_set_focus_display: tool: 0x8544318 display: (nil) focus_display: 0x8cdf7b0 gimp_tool_set_focus_display: tool: 0x8544318 display: 0x8cdf7b0 focus_display: (nil) gimp_tool_set_modifier_state: tool: 0x8544318 display: 0x8cdf7b0 focus_display: 0x8cdf7b0 gimp_tool_set_focus_display: tool: 0x8544318 display: (nil) focus_display: 0x8cdf7b0 gimp_tool_set_focus_display: tool: 0x8544318 display: 0x8cdf7b0 focus_display: (nil) gimp_tool_set_modifier_state: tool: 0x8544318 display: 0x8cdf7b0 focus_display: 0x8cdf7b0 gimp_tool_set_focus_display: tool: 0x8544318 display: 0x8cdf7b0 focus_display: 0x8cdf7b0 gimp_tool_set_modifier_state: tool: 0x8544318 display: 0x8cdf7b0 focus_display: 0x8cdf7b0 gimp_tool_set_focus_display: tool: 0x8544318 display: 0x8cdf7b0 focus_display: 0x8cdf7b0 gimp_tool_set_modifier_state: tool: 0x8544318 display: 0x8cdf7b0 focus_display: 0x8cdf7b0 gimp_tool_set_focus_display: tool: 0x8544318 display: (nil) focus_display: 0x8cdf7b0 gimp_tool_set_focus_display: tool: 0x8544318 display: (nil) focus_display: (nil) gimp_tool_set_focus_display: tool: 0x84f1c30 display: (nil) focus_display: (nil) gimp_tool_set_focus_display: tool: 0x877b900 display: 0x8cdf7b0 focus_display: (nil) gimp_tool_set_modifier_state: tool: 0x877b900 display: 0x8cdf7b0 focus_display: 0x8cdf7b0 gimp_tool_set_focus_display: tool: 0x877b900 display: 0x8cdf7b0 focus_display: 0x8cdf7b0 gimp_tool_set_modifier_state: tool: 0x877b900 display: 0x8cdf7b0 focus_display: 0x8cdf7b0 gimp_tool_set_focus_display: tool: 0x877b900 display: (nil) focus_display: 0x8cdf7b0 gimp_tool_set_focus_display: tool: 0x877b9e8 display: (nil) focus_display: (nil) gimp_tool_set_focus_display: tool: 0x877b9e8 display: 0x8cdf7b0 focus_display: (nil) gimp_tool_set_modifier_state: tool: 0x877b9e8 display: 0x8cdf7b0 focus_display: 0x8cdf7b0 gimp_tool_set_focus_display: tool: 0x877b9e8 display: (nil) focus_display: 0x8cdf7b0 gimp_tool_set_focus_display: tool: 0x877bad0 display: (nil) focus_display: (nil) gimp_tool_set_focus_display: tool: 0x877bbb8 display: (nil) focus_display: (nil) gimp_tool_set_focus_display: tool: 0x877bbb8 display: 0x8cdf7b0 focus_display: (nil) gimp_tool_set_modifier_state: tool: 0x877bbb8 display: 0x8cdf7b0 focus_display: 0x8cdf7b0 gimp_tool_set_focus_display: tool: 0x877bbb8 display: (nil) focus_display: 0x8cdf7b0 gimp_tool_set_focus_display: tool: 0x877bca0 display: (nil) focus_display: (nil) Gimp-Tools-CRITICAL **: gimp_tool_set_active_modifier_state: assertion `display == tool->focus_display' failed aborting... ./gimp-2.4: terminated: Aborted (script-fu:5960): LibGimpBase-WARNING **: script-fu: gimp_wire_read(): error [bin]$
Created attachment 100512 [details] [review] Please try if this patch fixes the problem
I've applied the patch, and in five minutes of testing haven't managed to get GIMP to crash. I'll test it some more and let you know the results.
Okay, it is certainly less crash-prone with the patch, but it crash once when using intelligent scissors, with the same error message as before.
Thanks, but does it really crash when that warning happens? Or does it just crash because you passed --g-fatal-warnings on the command line?
Oh, and can you please tell us the exact steps that lead to the intelligent scissors warning?
Comitted the attached patch. Will backport as soon as the intelligent scissors warning is fixed too: 2007-12-07 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_tool_events): if a device change happens, make sure we update the new active tool's focus display and modifier state. Fixes most of bug #493176.
I have backported this change, we might want to do a 2.4.3 release soon... 2007-12-10 Sven Neumann <sven@gimp.org> Merged from trunk: * app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_tool_events): if a device change happens, make sure we update the new active tool's focus display and modifier state. Fixes most of bug #493176.
Juho, can you please answer the question in comment #14 and explain us how to trigger the warning from intelligent scissors? Perhaps it would even be a good idea to open a separate bug report for it.
Sorry about the delay, I've been away for a while. I haven't been able to trigger the scissors bug again, so it might simply be a freak occurence. I did, at the time it happened, have several versions installed side-by-side, so it could conceivably have been some sort of interference. Will inform you if I see this again, but for now, the bug seems to be fixed in 2.4.3.
Cool, closing as FIXED then.