Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

latest theme changes make Thematic crash

4 views
Skip to first unread message

Riccardo Mottola

unread,
Apr 8, 2013, 6:22:03 AM4/8/13
to Discuss GNUstep
Hi,

After the latest changes by, if I try to theme the "arrow" in the menu,
on save, Thematic will crash.
This happen both if I theme directly through the image elements
inspector or through the specific Menu inspector.

interesting is the double- update in NSMenu.

Riccardo

PS: apparently this bug is not just for that image, but if I change any
image in Thematic.


0xbb29ff1c in objc_msg_lookup () from /usr/lib/libobjc.so.3
(gdb) bt
#0 0xbb29ff1c in objc_msg_lookup () from /usr/lib/libobjc.so.3
#1 0xbb82df74 in -[NSApplication(Private) _targetForAction:window:] (
self=0xb92e4264, _cmd=0xbbafba30, aSelector=0xb921d5d0,
window=0xb9088804)
at NSApplication.m:3891
#2 0xbb82e12f in -[NSApplication(Private)
_targetForAction:keyWindow:mainWindow:] (self=0xb92e4264,
_cmd=0xbbafb6c8, aSelector=0xb921d5d0,
keyWindow=0xb831ed04, mainWindow=0xb9088804) at NSApplication.m:3936
#3 0xbb82be5f in -[NSApplication targetForAction:] (self=0xb92e4264,
_cmd=0xbbafb6d0, aSelector=0xb921d5d0) at NSApplication.m:2297
#4 0xbb82bda0 in -[NSApplication targetForAction:to:from:]
(self=0xb92e4264,
_cmd=0xbbb4c750, theAction=0xb921d5d0, theTarget=0x0,
sender=0xb8746884)
at NSApplication.m:2273
#5 0xbb8fa676 in -[NSMenu update] (self=0xb9030d04, _cmd=0xbbb4c690)
at NSMenu.m:1156
#6 0xbb8fa841 in -[NSMenu update] (self=0xb8704444, _cmd=0xbbafb5b0)
at NSMenu.m:1151
#7 0xbb831178 in -[NSApplication(Private) _windowDidBecomeKey:] (
self=0xb92e4264, _cmd=0xbbafb450, notification=0xb8106f84)
at NSApplication.m:3986
#8 0xbb46283d in -[NSNotificationCenter _postAndRelease:] (self=0xb9269b44,
_cmd=0xbb70ad80, notification=0xb8106f84) at
NSNotificationCenter.m:1224
#9 0xbb461ce6 in -[NSNotificationCenter
postNotificationName:object:userInfo:]
(self=0xb9269b44, _cmd=0xbb70ad88, name=0xbbbb8ab0, object=0xb831ed04,
info=0x0) at NSNotificationCenter.m:1283
#10 0xbb46192d in -[NSNotificationCenter postNotificationName:object:] (
self=0xb9269b44, _cmd=0xbbbaab10, name=0xbbbb8ab0, object=0xb831ed04)
at NSNotificationCenter.m:1263
#11 0xbb9d9212 in -[NSWindow becomeKeyWindow] (self=0xb831ed04,
_cmd=0xbbbaab58) at NSWindow.m:1575
#12 0xbb9d2924 in -[NSWindow makeKeyWindow] (self=0xb831ed04,
_cmd=0xbbbaa628)
at NSWindow.m:1689
#13 0xbb9e4cb8 in -[NSWindow(GNUstepPrivate) _lossOfKeyOrMainWindow] (
self=0xb9088804, _cmd=0xbbbaab90) at NSWindow.m:322
#14 0xbb9d79b6 in -[NSWindow orderWindow:relativeTo:] (self=0xb9088804,
_cmd=0xbbbaab88, place=NSWindowOut, otherWin=0) at NSWindow.m:1790
#15 0xbb9d2b1b in -[NSWindow orderOut:] (self=0xb9088804, _cmd=0xbbbaac18,
sender=0xb9088804) at NSWindow.m:1744
#16 0xbb9e3fae in -[NSWindow close] (self=0xb9088804, _cmd=0xbbbaae10)
at NSWindow.m:2788
#17 0xbb9e0f7b in -[NSWindow performClose:] (self=0xb9088804,
_cmd=0xbbbab108,
sender=0xb92e4264) at NSWindow.m:3013
#18 0xbb9e21fe in -[NSWindow sendEvent:] (self=0xb9088804, _cmd=0xbbafb680,
theEvent=0xb8105104) at NSWindow.m:4067
#19 0xbb830e0e in -[NSApplication sendEvent:] (self=0xb92e4264,
_cmd=0xbbafb5b8, theEvent=0xb8105104) at NSApplication.m:2105
#20 0xbb832ee4 in -[NSApplication run] (self=0xb92e4264, _cmd=0xbbaf1048)


Fred Kiefer

unread,
Apr 8, 2013, 3:53:37 PM4/8/13
to discuss...@gnu.org
I don't think that this problem is related to the NSImage changes.

What happens here is that a window gets closed that was key and main
window and had a delegate. In that process the key and main window state
get transferred separately. This leads to the menu getting updated while
the old window is still main. Now the delegate of that window gets
referenced and this delegate seems to be invalid at that point. To find
out, what this delegate is and why it is already deallocated one needs
to know more details about the application. Or run it with NSZombie enabled.

Riccardo Mottola

unread,
Apr 9, 2013, 9:33:22 AM4/9/13
to discuss...@gnu.org, Fred Kiefer
Hi,

at first, I thought a reliable way of reproducing it. I was able to get
it crash also withhout saving or applying changes, just by openin a
theme and opening the inspector (without, with just the main document
window it would work). But then it proved that it wasn't always the case.

On linux, the stacktrace I got was:

#0 0xb76b10d5 in objc_msg_lookup ()
from /usr/lib/gcc/i686-pc-linux-gnu/4.7.2/libobjc.so.4
#1 0xb7c287eb in -[NSApplication(Private) _targetForAction:window:] (
self=0x814d76c, _cmd=0xb7eef2a0 <_OBJC_SELECTOR_TABLE+3360>,
aSelector=0x8171338, window=0x84b0fe4) at NSApplication.m:3891
#2 0xb7c28997 in -[NSApplication(Private)
_targetForAction:keyWindow:mainWindow:] (self=0x814d76c, _cmd=0xb7eeef48
<_OBJC_SELECTOR_TABLE+2504>,
aSelector=0x8171338, keyWindow=0x843a9a4, mainWindow=0x84b0fe4)
at NSApplication.m:3936
#3 0xb7c2669f in -[NSApplication targetForAction:] (self=0x814d76c,
_cmd=0xb7eeef50 <_OBJC_SELECTOR_TABLE+2512>, aSelector=0x8171338)
at NSApplication.m:2297
#4 0xb7c265fb in -[NSApplication targetForAction:to:from:] (
self=self@entry=0x814d76c,
_cmd=_cmd@entry=0xb7f40490 <_OBJC_SELECTOR_TABLE+1168>,
theAction=theAction@entry=0x8171338, theTarget=0x0,
sender=sender@entry=0x819e01c) at NSApplication.m:2273
#5 0xb7cf7792 in -[NSMenu update] (self=0x819dfb4,
_cmd=0xb7f403d0 <_OBJC_SELECTOR_TABLE+976>) at NSMenu.m:1156
#6 0xb7cf7918 in -[NSMenu update] (self=0x81b2d2c,
_cmd=0xb7eeee30 <_OBJC_SELECTOR_TABLE+2224>) at NSMenu.m:1151
#7 0xb7c2b8b1 in -[NSApplication(Private) _windowDidBecomeKey:] (
self=0x814d76c, _cmd=0xb7eeecd0 <_OBJC_SELECTOR_TABLE+1872>,

in #1: window is:
<NSWindow: 0x84b0fe4>Number: 681 Title: Sleek.theme
This would be the main window.
checking at #2 we see:
<NSPanel: 0x843a9a4>Number: 722 Title: System Images Inspector
(gdb) po mainWindow
<NSWindow: 0x84b0fe4>Number: 681 Title: Sleek.theme

Sadly, what appeared to be easily reproducible, appeared not to when you
try to chase it with zombies. At one point however I got:
2013-04-09 12:36:25.421 Thematic[4601] *** -[ThemeDocument
respondsToSelector:]: message sent to deallocated instance 0x88ddeb4
2013-04-09 12:36:25.421 Thematic[4601] *** -[ThemeDocument
respondsToSelector:]: message sent to deallocated instance 0x88ddeb4

I tried to poke with a breakpoint in GSLogZombie but got lost.

it appears the culprit is the disappearing of ThemeDocument itself,
then, right?

Riccardo

Wolfgang Lux

unread,
Apr 9, 2013, 10:03:41 AM4/9/13
to Riccardo Mottola, Fred Kiefer, discuss...@gnu.org
Probably. This is somewhat odd as ThemeDocument sets the delegate of its window to nil when it is deallocated. So maybe the theme document is set as delegate of other windows besides the document window. You might checking by setting a breakpoint on NSWindow's setDelegate: method. Apart from that you can set a breakpoint in the dealloc method of ThemeDocument to see when it gets deallocated.

Wolfgang


Wolfgang Lux

unread,
Apr 10, 2013, 3:51:33 AM4/10/13
to Riccardo Mottola, Fred Kiefer, discuss-gnustep@gnu.org Discuss
Wolfgang Lux wrote:

>> it appears the culprit is the disappearing of ThemeDocument itself, then, right?
>
> Probably. This is somewhat odd as ThemeDocument sets the delegate of its window to nil when it is deallocated. So maybe the theme document is set as delegate of other windows besides the document window. ...

I just noticed that the code to reset the delegate was only in my local copy of the code. I had made this change some time ago, but obviously had forgotten to commit it. It is now in svn and thematic should no longer crash.

Wolfgang


Riccardo Mottola

unread,
Apr 10, 2013, 7:00:11 AM4/10/13
to Wolfgang Lux, Fred Kiefer, discuss-gnustep@gnu.org Discuss
Hi,
:) you had a pimped version on your HD! thankts for sharing it. A quick
test was positive.

Now later I will test if i can finally theme the menu arrow through
thematic, since different bugs were overlapping.

Thank you,

Riccardo

0 new messages