Bug 204626 - [Browser] Intermittent crash on OS X in embedded browser when cancelling a download.
Summary: [Browser] Intermittent crash on OS X in embedded browser when cancelling a do...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.3   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal with 2 votes (vote)
Target Milestone: 3.3.2   Edit
Assignee: Felipe Heidrich CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
: 211566 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-09-25 20:25 EDT by George Comninos CLA
Modified: 2007-12-17 12:36 EST (History)
4 users (show)

See Also:
steve_northover: pmc_approved+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description George Comninos CLA 2007-09-25 20:25:52 EDT
Build ID: I20070625-1500

Steps To Reproduce:
1. Open internal Web Browser View
2. Browse to a website that has a link to a file to download
3. Click the file link, save dialog should come up
4. Hit cancel
5. Repeat until crash occurs


More information:
The problem is in org.eclipse.swt.carbon.macosx.Safari in the method decideDestinationWithSuggestedFilename(). In the code where it says if (path == null) (cancel case), it should be sending Cocoa.S_cancel instead of S.release. This is during a delegate callback handler for the NSURLDownload, releasing the object during this callback can cause bad memory access exceptions.

Here is a piece of the crash log:

Command: eclipse
Path:    /Users/gcomnino/Desktop/eclipse3.4M1/Eclipse.app/Contents/MacOS/eclipse
Parent:  WindowServer [239]

Version: 3.3 (3.3)

PID:    1446
Thread: 0

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_INVALID_ADDRESS (0x0001) at 0xa1a78a48

Thread 0 Crashed:
0   libobjc.A.dylib                	0x90a59391 objc_msgSend + 33
1   com.apple.Foundation           	0x9293607c -[NSURLDownload _writeDataForkData:resourceForkData:] + 44
2   com.apple.Foundation           	0x92935bc0 -[NSURLDownload _decodeDownloadData:] + 161
3   com.apple.Foundation           	0x92935108 -[NSURLDownload connection:didReceiveData:lengthReceived:] + 164
4   com.apple.Foundation           	0x9285aafa -[NSURLConnection(NSURLConnectionInternal) _sendDidReceiveDataCallback] + 641
5   com.apple.Foundation           	0x92858ddb -[NSURLConnection(NSURLConnectionInternal) _sendCallbacks] + 686
6   com.apple.Foundation           	0x92858ab5 _sendCallbacks + 201
7   com.apple.CoreFoundation       	0x9082cf92 CFRunLoopRunSpecific + 1213
8   com.apple.CoreFoundation       	0x9082cace CFRunLoopRunInMode + 61
9   libswt-pi-carbon-3406.jnilib   	0x1214d6df Java_org_eclipse_swt_internal_carbon_OS_CFRunLoopRunInMode + 61
Comment 1 Steve Northover CLA 2007-10-17 15:46:50 EDT
Should be an easy fix.  Felipe, can you do this while Grant is gone?
Comment 2 Felipe Heidrich CLA 2007-10-17 17:32:03 EDT
Thank you very much!

I've added George Comninos to our contributors list:
http://www.eclipse.org/swt/contributors.txt

Fixed in HEAD > 20071017
Comment 3 Grant Gayed CLA 2007-11-30 16:14:07 EST
*** Bug 211566 has been marked as a duplicate of this bug. ***
Comment 4 George Comninos CLA 2007-11-30 16:29:35 EST
Hey guys,
any chance this can be pushed to the maintenance build also (3.3.2 or the next dot release for 3.3)?
Comment 5 Grant Gayed CLA 2007-11-30 16:44:42 EST
SN can you decide on this and if appropriate add it to the 3.3.2 stream?  The fix seems safe to me but I don't want to commit to putting it into a maintenance branch while you're not here.
Comment 6 Steve Northover CLA 2007-12-02 12:12:49 EST
Please add this to 3.3.2.
Comment 7 Grant Gayed CLA 2007-12-17 12:36:52 EST
Fix added to the 3.3.2 stream.