Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 364116 - [10.7]Crash when opening two FileDialogs in a row
Summary: [10.7]Crash when opening two FileDialogs in a row
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.2   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 critical with 3 votes (vote)
Target Milestone: 3.8 M6   Edit
Assignee: Silenio Quarti CLA
QA Contact: Lakshmi P Shanmugam CLA
URL:
Whiteboard:
Keywords:
: 361530 386794 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-11-18 03:19 EST by Nikolay Kasyanov CLA
Modified: 2012-08-09 04:33 EDT (History)
8 users (show)

See Also:


Attachments
example code, crashes every time (2.23 KB, application/octet-stream)
2011-11-18 03:20 EST, Nikolay Kasyanov CLA
no flags Details
crash log (63.29 KB, text/plain)
2011-11-18 13:07 EST, Nikolay Kasyanov CLA
no flags Details
Modified Snippet72, crash using save FileDialog (1.96 KB, application/octet-stream)
2012-03-07 15:52 EST, Steven Darnell CLA
no flags Details
Snippet crash log, 32-bit JVM on OSX 10.7.3 (68.45 KB, application/octet-stream)
2012-03-07 16:09 EST, Steven Darnell CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nikolay Kasyanov CLA 2011-11-18 03:19:21 EST
Build Identifier: Build id: 20110916-0149

When I'm trying to open two file dialogs in a row, jvm crashes with "Invalid memory access of location ... eip=...".

I've detected this in Eclipse RCP Application, but it reproduces in plain SWT app too.

I'm using Mac OS X 10.7.2 with latest Apple Java update (Java for Mac OS X 10.7 update 1).

Bug not reproduces on Oracle's Java 7 for Mac OS X preview

Reproducible: Always

Steps to Reproduce:
1. Create one file dialog, call .open() for it
2. Create another file dialog, call .open() for it
3. Enjoy jvm crash
Comment 1 Nikolay Kasyanov CLA 2011-11-18 03:20:51 EST
Created attachment 207202 [details]
example code, crashes every time

Run, click Open..., select some file or cancel first dialog.
Comment 2 Nikolay Kasyanov CLA 2011-11-18 03:24:24 EST
It crashes not at second .open() (it just silently returns null), but somewhere inside swt
Comment 3 Lakshmi P Shanmugam CLA 2011-11-18 08:19:35 EST
please attach the crash log.
Comment 4 Nikolay Kasyanov CLA 2011-11-18 13:07:44 EST
Created attachment 207238 [details]
crash log
Comment 5 Rodolfo M. Raya CLA 2011-11-24 08:33:59 EST
(In reply to comment #0)
> Build Identifier: Build id: 20110916-0149
> 
> Reproducible: Always
> 
> Steps to Reproduce:
> 1. Create one file dialog, call .open() for it
> 2. Create another file dialog, call .open() for it
> 3. Enjoy jvm crash

One of my applications is affected by this bug. Whenever I try to open a second FileDialog object STW crashes. Same app works fine on Windows and Linux.
Comment 6 Nikolay Kasyanov CLA 2011-12-13 10:09:41 EST
Looks like this bug may be in some way connected with Most Recently Used list (or how its caled in OS X?).
I thinks so because after some time after (may be few days) crash I can successfully select two files with two open dialogs without crash, but on next run, if I select same files — crash again, but if I select other files — no problem.

So I can select one file one time without problem.

I guess it's because opened with this dialog files added in some MRU list, and it screws open dialog after selecting this file again.

Hope this info will be useful.
Comment 7 Steven Darnell CLA 2012-03-07 15:52:19 EST
Created attachment 212253 [details]
Modified Snippet72, crash using save FileDialog

I modified Snippet72 to loop over the creation of a save FileDialog. The snippet runs on 10.6 bug fails on 10.7. Failure occurs with and without SWT.SHEET. Failure occurs with the expanded save dialog (the version controlled by NSNavPanelExpandedStateForSaveMode, which includes a file picker), but succeeds with the smaller unexpanded save dialog (click the disclosure triangle in the dialog before pressing Save or Cancel).

Failures are observed using SWT 3.7, 3.7.2, 3.8M5, and git master.
Comment 8 Steven Darnell CLA 2012-03-07 16:01:07 EST
I am the project lead of an RCP application and I observe this crash on OSX 10.7 in my app. I completely agree that this is a critical bug, as opening and saving files are basic and critical workflows. I request that this bug is assigned and fixed for the upcoming 3.8/4.2 release.

@Lakshmi I see that this bug has been stale for the past three months. What is needed to move this bug forward?
Comment 9 Steven Darnell CLA 2012-03-07 16:09:48 EST
Created attachment 212254 [details]
Snippet crash log, 32-bit JVM on OSX 10.7.3
Comment 10 Silenio Quarti CLA 2012-03-09 17:05:55 EST
This crash happens because we subclass NSSavePanel to perform copy/paste/etc shortcuts (see bug#280202). I am not sure why this is a problem now. It could be just a bug in cocoa 10.7.  I found a alternative way to fix#280202 that does not require the subclassing.

Fixed
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=1c16a64584c10811be25bc2b538d561bcb86b0e1
Comment 11 Valerio Santinelli CLA 2012-03-12 06:57:22 EDT
This still happens in the SWT package delivered with Eclipse 3.7.2
Is there any plan to include this fix in a build that will be released soon?
Comment 12 Silenio Quarti CLA 2012-03-12 09:54:41 EDT
Sorry, there is no planned 3.7.x builds.  The next build is 3.8.
Comment 13 Valerio Santinelli CLA 2012-03-16 13:25:11 EDT
Thank you Silenio. Has this fix been ported to 3.8, too? I don't like the idea of having to switch to an unstable version but I definitely need that feature in my current application and if there's no other choices I'll move over to the latest 3.8
Comment 14 Silenio Quarti CLA 2012-03-16 13:41:39 EDT
3.8 M6 (which will be done this week) has the fix.
Comment 15 Lakshmi P Shanmugam CLA 2012-08-06 04:39:41 EDT
*** Bug 361530 has been marked as a duplicate of this bug. ***
Comment 16 Sheng Jun Wang CLA 2012-08-09 04:33:06 EDT
*** Bug 386794 has been marked as a duplicate of this bug. ***