bugGNUstep - Bugs: bug #23233, SVN version breaks GWorkspace.app

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #23233: SVN version breaks GWorkspace.app

Submitted by:  Charles Philip Chan <cpchan>
Submitted on:  Mon 12 May 2008 02:11:17 AM UTC  
 
Category: Gui/AppKitSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: Fred Kiefer <FredKiefer>
Open/Closed: Closed

Fri 16 May 2008 07:50:55 AM UTC, comment #3:

Hi Fred:

Just about to do some more debugging when I saw your message. Your latest fix (r26527) solved the problem- this bug report can be closed.

Thanks.

Charles

Charles Philip Chan <cpchan>
Wed 14 May 2008 09:57:51 PM UTC, comment #2:

I did some analysis and it turns out that this is really caused by the fix I made to NSWindow. Now the memory gets freed correctly, but not in the right order. As the graphics context and the info dictionary in it are autoreleased objects, they only get freed when the corresponding autorelease pool is released. As by this time the NSWindow is already deallocated (although it still has a reference) and this results in a segmentation fault.
Now what can we do about it? The only solution I can think of is to split up the dealloc in NSWindow and if the windowNumber is set call _terminateBackend and return without actually deallocating the NSWindow, which will get done when the autorelease pool if cleared then the NSWindow is freeed.

Fred Kiefer <FredKiefer>
Project MemberIn charge of this item.
Mon 12 May 2008 10:24:58 AM UTC, comment #1:

Looks like I did cause this by a memory leak fix on NSWindow. There the graphics context kept a reference of the window in its attributes dictionary and the window itself had a reference on the graphics context. This resulted in both never being freed.
I resolved this by reducing the retain count of the window after the graphics context gets created and increasing it just before the graphics context for the window is freed.
What I don't see is how this correction should result in a segmentation fault in GWorkspace. There is either an error in my change or the code in GWorkspace was always incorrect, but the problem was hidden by the gui bug. And of course there are plenty more possibilities.

Could you please try to find out, which sort of window is causing this? I am currently away from my home computer and so it is hard for me to find out where a GSContext gets autoreleased and what GSIMaps a context keeps.

You should try to use all the build in memory debugging facilities of GNUstep like enableDoubleReleaseCheck: and all the rest I don't remember :-)

Fred Kiefer <FredKiefer>
Project MemberIn charge of this item.
Mon 12 May 2008 02:11:17 AM UTC, original submission:

GWorkspace.app does not start up any more with the lastest SVN version of GNUStep- it segfaults. Here is the back trace (and I have attached the error when starting the app):

#0 0xb74315d4 in objc_msg_lookup () from /usr/X11R6/lib/libobjc.so.2
#1 0xb757c32d in GSIMapCleanMap (map=0x9f2c354) at ../Headers/Additions/GNUstepBase/GSIMap.h:864
#2 0xb757c1c4 in GSIMapEmptyMap (map=0x9f2c354) at ../Headers/Additions/GNUstepBase/GSIMap.h:894
#3 0xb757c175 in -[GSDictionary dealloc] (self=0x9f2c350, _cmd=0xb7a2b508) at GSDictionary.m:102
#4 0xb767236c in -[NSObject release] (self=0x9f2c350, _cmd=0xb7da9ef0) at NSObject.m:2025
#5 0xb7bc7ea2 in -[NSGraphicsContext dealloc] (self=0x9f2c3b0, _cmd=0xb6894550) at NSGraphicsContext.m:284
#6 0xb681d636 in -[GSContext dealloc] (self=0x9f2c3b0, _cmd=0xb7a2b508) at GSContext.m:223
#7 0xb767236c in -[NSObject release] (self=0x9f2c3b0, _cmd=0xb7a02050) at NSObject.m:2025
#8 0xb75c70d3 in -[NSAutoreleasePool emptyPool] (self=0x83828d8, _cmd=0xb7a020b8) at NSAutoreleasePool.m:420
#9 0xb75c6ede in -[NSAutoreleasePool dealloc] (self=0x83828d8, _cmd=0xb7a020b0) at NSAutoreleasePool.m:324
#10 0xb75c6e93 in -[NSAutoreleasePool release] (self=0x83828d8, _cmd=0xb7ef6e98) at NSAutoreleasePool.m:317
#11 0xb7ea555d in -[FSNodeRep(Icons) resizedIcon:ofSize:] (self=0x8411860, _cmd=0xb7ef6dc0, icon=0x9f25308, size=24) at FSNodeRepIcons.m:417
#12 0xb7ea4307 in -[FSNodeRep(Icons) cachedIconOfSize:forKey:] (self=0x8411860, _cmd=0xb7ef6d98, size=24, key=0x9f25160)
at FSNodeRepIcons.m:231
#13 0xb7ea4510 in -[FSNodeRep(Icons) cachedIconOfSize:forKey:addBaseIcon:] (self=0x8411860, _cmd=0xb7ef6da8, size=24, key=0x9f25160,
baseIcon=0x9f25308) at FSNodeRepIcons.m:257
#14 0xb7ea3dfc in -[FSNodeRep(Icons) iconOfSize:forNode:] (self=0x8411860, _cmd=0xb7efa690, size=24, node=0x9f06818) at FSNodeRepIcons.m:163
#15 0xb7ea873c in -[FSNBrowserCell setIcon] (self=0x9f069d0, _cmd=0x8137ce8) at FSNBrowserCell.m:127
#16 0x080b6c35 in -[Finder addSearchPlaceWithPath:] (self=0x9f136f8, _cmd=0x8137a30, spath=0x824ec40) at Finder/Finder.m:603
#17 0x080b3634 in -[Finder init] (self=0x9f136f8, _cmd=0x81378d8) at Finder/Finder.m:149
#18 0x080b294d in +[Finder finder] (self=0x8137560, _cmd=0x8113430) at Finder/Finder.m:61
#19 0x08052aad in -[GWorkspace applicationWillFinishLaunching:] (self=0x82e84f8, _cmd=0xb7d72be0, aNotification=0x8447198)
at GWorkspace.m:454
#20 0xb7662c30 in -[NSNotificationCenter _postAndRelease:] (self=0x81e66d0, _cmd=0xb7a26c48, notification=0x8447198)
at NSNotificationCenter.m:1070
#21 0xb766354c in -[NSNotificationCenter postNotificationName:object:userInfo:] (self=0x81e66d0, _cmd=0xb7a26c50, name=0xb7e15200,
object=0x830de50, info=0x0) at NSNotificationCenter.m:1129
#22 0xb7663401 in -[NSNotificationCenter postNotificationName:object:] (self=0x81e66d0, _cmd=0xb7d726a0, name=0xb7e15200, object=0x830de50)
at NSNotificationCenter.m:1109
#23 0xb7b32278 in -[NSApplication finishLaunching] (self=0x830de50, _cmd=0xb7d72808) at NSApplication.m:952
#24 0xb7b33f77 in -[NSApplication run] (self=0x830de50, _cmd=0x810dab0) at NSApplication.m:1366
#25 0x0804d84b in main () at main.m:37

Thanks.

Charles

Charles Philip Chan <cpchan>

 

Attached Files
file #15654:  error.log added by cpchan (8KiB - text/x-log - Console log when starting GWorkspace)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by FredKiefer (Posted a comment)
  • -unavailable- added by cpchan (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 16 May 2008 02:29:39 PM UTCFredKieferOpen/ClosedOpen=>Closed
    Fri 16 May 2008 02:29:38 PM UTCFredKieferStatusConfirmed=>Fixed
    Wed 14 May 2008 09:57:51 PM UTCFredKieferStatusNone=>Confirmed
    Mon 12 May 2008 10:24:58 AM UTCFredKieferCategoryNone=>Gui/AppKit
      Item GroupNone=>Bug
      Assigned toNone=>FredKiefer
    Mon 12 May 2008 02:11:17 AM UTCcpchanAttached File-=>Added error.log, #15654

    Back to the top


    Powered by Savane 3.1-cleanup1