bugGNUstep - Bugs: bug #25385, crash in [GSToolTips...

Group
 
 

bug #25385: crash in [GSToolTips mouseEntered:] called from [NSWindow _checkTrackingRectangles:forEvent:]

Submitter:  Doug Simons <theeggcamefirst>
Submitted:  Thu 22 Jan 2009 11:13:01 PM UTC
   
 
Category:  Gui/AppKit Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sun 01 Feb 2009 05:21:49 PM UTC, comment #10: 

Thanks ... closing this.

Richard Frith-Macdonald <CaS>
Group Member
Sun 01 Feb 2009 04:49:17 PM UTC, comment #9: 

Excellent! It looks like that fixed the problem. Thank you!!

Doug Simons <theeggcamefirst>
Sat 31 Jan 2009 06:19:20 AM UTC, comment #8: 

I found a retain/release issue in the tooltip code.
For the first time, I'm actually confident of a fix ...as I can see clearly how this would have caused the crash you are getting.
Please give it a try.

Richard Frith-Macdonald <CaS>
Group Member
Sat 31 Jan 2009 01:05:18 AM UTC, comment #7: 

Unfortunately that doesn't seem to have solved the problem. Here's the entire code of our setImage: method in case it might help:

- (void) setImage: (NSImage *) anImage {
    [[self internalImageView] setImage: anImage];

    if (anImage) {
        [self setupInternalViews];
[self setToolTip:[NSString stringWithFormat:@"Image Size: %d x %d",(int)[anImage size].width,(int)[anImage size].height]];
}
}

Our internalImageView is an NSImageView that is our subview which actually displays the image. It is only created once.

Our setupInternalViews method just sizes and positions the internalImageView and another subview. The only part of that method that seems like it might have a bearing on this reads:
        [[self internalImageView] setFrame:innerBounds];
        [[self internalImageView] setImageScaling:NSScaleProportionally];
        [[self internalImageView] setImageAlignment:NSImageAlignCenter];

I don't see any likely culprits there. Our custom image view is loaded as a Custom View object within a nib file. I suppose it's possible that is related to the problem although it seems like a bit of a stretch since the tooltip works at first (and our image isn't set until later).

Doug Simons <theeggcamefirst>
Fri 30 Jan 2009 02:46:10 PM UTC, comment #6: 

I still can't reproduce this ... I've tried  setting a tooltip on an NSImageView, then changing the tooltip with another call to setToolTip: and that won;t produce a crash ... so it has to be more than just setting a tool tip twice.

However, I noticed that when tracking rectangles were removed from a view, the code was not invalidating them.  I changed that as it looked wrong, and might conceivably be the cause of your problem.

What would help most would be a small test application which reliably produces the bug ad which I could run under debug.


Richard Frith-Macdonald <CaS>
Group Member
Wed 28 Jan 2009 03:26:15 PM UTC, comment #5: 

Okay, ignore most of what I said yesterday. I've been able to reliably produce this crash in my app now, and it seems likely that it has more to do with tooltips than with tracking rectangles.

The crash occurs in this way: I call [self setTooltip:] in a private subclass of NSImageView (in an overridden setImage: method). It works fine the first time, but when my setImage: method is called again to switch images and I call setTooltip: a second time (with information about the new image's size) then I get this crash upon moving the mouse over the image.

I hope that helps to track down the problem.

Doug Simons <theeggcamefirst>
Tue 27 Jan 2009 04:51:40 PM UTC, comment #4: 

Unfortunately, I got this same crash again last night. The window in which it is occurring contains a tabView with two splitViews, an outlineView and a tableView as well as a couple buttons and a search field. Oh, and a custom view. :-)

So I'm really not sure which controls are registering cursor tracking rectangles with the window that might be related to the problem (I expect at least the splitViews and the field have cursor rects). Anyway, if there's anything you'd like me to examine in gdb the next time it crashes, let me know. I just don't know what to look for.

Hmm, it just occurred to me that it might even be related to cursor rectangles registered by controls on one of the other tabs in this window. The window has several tabs, with each tab view containing a number of controls. Just prior to the current crash, I had clicked a button (in a different window) that caused this window to come to the front and select this particular tab. So I wonder if it might be not properly resetting rectangles from controls that are swapped out at this point... just a thought.

Also, our custom cursor rectangles (in a different window) don't seem to be working (cursor isn't changing), so I wonder if the tracking rectangle code needs some attention, although this may be completely unrelated.


Doug Simons <theeggcamefirst>
Sun 25 Jan 2009 08:50:42 AM UTC, comment #3: 

I'm guessing that the problem was calling -mouseEntered for an invalidated rectangle, and I changed NSWindow.m so that this should be prevented.
Please let us know if this solves the problem.

Richard Frith-Macdonald <CaS>
Group Member
Fri 23 Jan 2009 10:44:32 PM UTC, comment #2: 

Sorry for the lack of details. Actually, I gave you most of it (the backtrace is pretty minimal), but here's the details. I'm running on the tip (I believe gui is at rev 27656, if I'm reading the svn info correctly). Here's the backtrace:

#0  0xb76245b4 in objc_msg_lookup () from /usr/lib/libobjc.so.2
#1  0xb7ebd4ec in -[GSToolTips mouseEntered:] (self=0x924ab80, _cmd=0xb7f905c0, theEvent=0x8c8c348)
    at GSToolTips.m:242
#2  0xb7e4168c in -[NSWindow _checkTrackingRectangles:forEvent:] (self=0x9252f70, _cmd=0xb7f8fe90,
    theView=0x9214928, theEvent=0x8c7dbb8) at NSWindow.m:3308
#3  0xb7e419a0 in -[NSWindow _checkTrackingRectangles:forEvent:] (self=0x9252f70, _cmd=0xb7f8fe90,
    theView=0x92146f8, theEvent=0x8c7dbb8) at NSWindow.m:3361
#4  0xb7e419a0 in -[NSWindow _checkTrackingRectangles:forEvent:] (self=0x9252f70, _cmd=0xb7f8fe90,
    theView=0x92144e0, theEvent=0x8c7dbb8) at NSWindow.m:3361
#5  0xb7e419a0 in -[NSWindow _checkTrackingRectangles:forEvent:] (self=0x9252f70, _cmd=0xb7f8fe90,
    theView=0x92114a8, theEvent=0x8c7dbb8) at NSWindow.m:3361
#6  0xb7e419a0 in -[NSWindow _checkTrackingRectangles:forEvent:] (self=0x9252f70, _cmd=0xb7f8fe90,
    theView=0x9211278, theEvent=0x8c7dbb8) at NSWindow.m:3361
#7  0xb7e419a0 in -[NSWindow _checkTrackingRectangles:forEvent:] (self=0x9252f70, _cmd=0xb7f8fe90,
    theView=0x9211068, theEvent=0x8c7dbb8) at NSWindow.m:3361
#8  0xb7e419a0 in -[NSWindow _checkTrackingRectangles:forEvent:] (self=0x9252f70, _cmd=0xb7f8fe90,
    theView=0x92109f8, theEvent=0x8c7dbb8) at NSWindow.m:3361
#9  0xb7e419a0 in -[NSWindow _checkTrackingRectangles:forEvent:] (self=0x9252f70, _cmd=0xb7f8fe90,
    theView=0x9210ab8, theEvent=0x8c7dbb8) at NSWindow.m:3361
#10 0xb7e419a0 in -[NSWindow _checkTrackingRectangles:forEvent:] (self=0x9252f70, _cmd=0xb7f8fe90,
    theView=0x9253068, theEvent=0x8c7dbb8) at NSWindow.m:3361
#11 0xb7e42ded in -[NSWindow sendEvent:] (self=0x9252f70, _cmd=0xb7ef6b70, theEvent=0x8c7dbb8)
    at NSWindow.m:3667
---Type <return> to continue, or q <return> to quit---
#12 0xb7cab7af in -[NSApplication sendEvent:] (self=0x8422cb0, _cmd=0xb7ef6ab0, theEvent=0x8c7dbb8)
    at NSApplication.m:1920
#13 0xb7caa238 in -[NSApplication run] (self=0x8422cb0, _cmd=0xb7eec160) at NSApplication.m:1420
#14 0xb7c8be11 in NSApplicationMain (argc=1, argv=0xbffbc864) at Functions.m:74
#15 0x0804fca2 in main (argc=Cannot access memory at address 0x1000c
) at main.m:13

theEvent is a mouseMoved event. Hopefully that's enough to help you track this down. Thanks!


Doug Simons <theeggcamefirst>
Fri 23 Jan 2009 06:59:26 AM UTC, comment #1: 

I'm afraid anyone looking at this will need more information.
Source code of a testcase to demonstrate it would be ideal;.
A stack trace would probably be the minimum requirement ... where exactly is the crash?  What version of the gui is it in? etc.

Richard Frith-Macdonald <CaS>
Group Member
Thu 22 Jan 2009 11:13:01 PM UTC, original submission:  

I'm now seeing frequent (but intermittent) crashes with a Segmentation fault in [GSToolTips mouseEntered:] called by a chain of [NSWindow _checkTrackingRectangles:forEvent:] calls (about 10 of them). Unfortunately, I haven't been able to pin down the circumstances under which this occurs.


Doug Simons <theeggcamefirst>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by CaS (Posted a comment)
  • -email is unavailable- added by theeggcamefirst (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-02-01 CaS Open/ClosedIn Test Closed
    2009-01-25 CaS StatusNone Fixed
        Open/ClosedOpen In Test

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code