Bug 240025

Summary: Error creating ~/.eclipse/.Segmentation fault
Product: [Fedora] Fedora Reporter: Ben Konrath <ben>
Component: eclipseAssignee: Ben Konrath <ben>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: 3.2.2-13.fc7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-06-07 06:42:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ben Konrath 2007-05-14 14:15:47 UTC
+++ This bug was initially created as a clone of Bug #239991 +++

Description of problem: As title suggests - I'm now unable to start eclipse.
Using the icon in the menus yields nothing, and running it from the command
prompt, yields the above message.


Version-Release number of selected component (if applicable): 
[austin@localhost ~]$ rpm -qa eclipse*
eclipse-subclipse-1.1.9-2.fc6
eclipse-gef-3.2.1-4.fc6
eclipse-bugzilla-0.2.4-3.fc6
eclipse-platform-sdk-3.2.2-5.fc6
eclipse-changelog-2.3.3-2.fc6
eclipse-rcp-3.2.2-5.fc6
eclipse-cdt-3.1.2-3.fc6
eclipse-pde-runtime-3.2.2-5.fc6
eclipse-gef-sdk-3.2.1-4.fc6
eclipse-gef-examples-3.2.1-4.fc6
eclipse-platform-3.2.2-5.fc6
eclipse-jdt-3.2.2-5.fc6
eclipse-rcp-sdk-3.2.2-5.fc6
eclipse-pde-3.2.2-5.fc6
eclipse-subclipse-book-1.1.9-2.fc6
eclipse-ecj-3.2.2-5.fc6


How reproducible: Every time. Unable to start eclipse


Steps to Reproduce:
1. Run yumex and find an update for eclipse on a Friday.
2. Wait until Friday knock off before running the update.
3. Try to use Eclipse on Monday, and see above message.
  
Actual results:
The message given in the title (Error creating ~/.eclipse/.Segmentation fault)
is all that's shown on a Terminal Window when trying to start Eclipse.

Expected results:
For Eclipse to launch.

Additional info:
The .eclipse directory exists and has writable permissions for myself. The
.Segmantion\ Fault file didn't exist, so I ran touch to create it, and Eclipse
still crashed with the same message.

I'll try to completely erase all Eclipse and re-install (Windows trick?) to see
if that fixes the problem.

-- Additional comment from bkonrath on 2007-05-14 03:35 EST --
You just discovered a bug in the laucher patch we added to work around other bugs :(

To get eclipse working again, you should just have to move ~/.eclipse out of the
way and start eclipse again.

mv ~/.eclipse{,.back}

But I'd like to know what is causing the segmenation fault. Could you run
eclipse with gdb:

gdb /usr/bin/eclipse

and then type 'run' at the gdb prompt. When you hit the seg fault, type 'bt' and
post the results. Thanks.

-- Additional comment from austin.arrowsmith.gov.au on 2007-05-14
03:36 EST --
Created an attachment (id=154622)
A diff of the two directory structures

This file was created with :
diff -r .eclipse .eclipse_old_070514/ > eclipse_dir_structure_differences.log


-- Additional comment from austin.arrowsmith.gov.au on 2007-05-14
03:39 EST --
Cool - synchronised posting.
Have Eclipse working with a new .eclipse directory. Lowered priority.

Will attach gdb results (however unhelpful they may be).

-- Additional comment from bkonrath on 2007-05-14 03:41 EST --
If you could post a tar of the old .eclipse directory, that might be useful too.
BTW, thanks for the bug report.

-- Additional comment from austin.arrowsmith.gov.au on 2007-05-14
03:45 EST --
Created an attachment (id=154623)
Results of running Eclipse with gdb

As requested, the results of running gdb /usr/bin/eclipse

-- Additional comment from austin.arrowsmith.gov.au on 2007-05-14
03:50 EST --
(In reply to comment #4)
> If you could post a tar of the old .eclipse directory, that might be useful too.
> BTW, thanks for the bug report.

I'm unsure I will be able to, due to the potentially classified nature of the
directory, and the fact that I don't know what is stored in there.

See attachment #154622 [details] for more information.

-- Additional comment from bkonrath on 2007-05-14 03:54 EST --
(In reply to comment #6)
> I'm unsure I will be able to, due to the potentially classified nature of the
> directory, and the fact that I don't know what is stored in there.

Ok, no problem.
 
> See attachment #154622 [details] [edit] for more information.

That doesn't help much. As for the gdb output, I forgot to mention that you'll
need to install the eclipse-debuginfo package to make the information useful.
Thanks.


-- Additional comment from austin.arrowsmith.gov.au on 2007-05-14
05:12 EST --
Installed eclipse-debuginfo-3.2.1-4.fc6 and the results didn't change.

-- Additional comment from bkonrath on 2007-05-14 05:25 EST --
Ok, I'll try to reproduce this on my box. What were the permissions on the
original .eclipse?

-- Additional comment from austin.arrowsmith.gov.au on 2007-05-14
05:28 EST --
drwxr-x---
(same as the current eclipse)

-- Additional comment from bkonrath on 2007-05-14 05:47 EST --
ok, and does this file exist in the old .eclipse directory?:

org.eclipse.platform_3.2.0/configuration/org.eclipse.update/platform.xml

I'm looking at the following chunck of code from this patch:

http://cvs.fedora.redhat.com/viewcvs/rpms/eclipse/FC-6/eclipse-launcher-addplatformtotildeeclipse.patch?rev=1.4&view=markup

+       platform_xml = g_strconcat(g_get_home_dir(),
"/.eclipse/org.eclipse.platform_3.2.0/configuration/org.eclipse.update/platform.xml",
NULL);
+       touched = g_strconcat(g_get_home_dir(),
"/.eclipse/.homedirmodified-fedora", NULL);
+       
+
+       if (!g_file_test(platform_xml, G_FILE_TEST_EXISTS))
+       {
+               /* If platform.xml doesn't exist, Eclipse has yet to be started.
+                * We don't have worry about doing anything now and in the future 
+                * so add the appropriate file to ~/.eclipse. */
+               if (g_mkdir(g_strconcat(g_get_home_dir(), "/.eclipse", NULL),
493) < 0) 
+               {
+                       g_print("Error creating ~/.eclipse/.");
+                       g_print(g_strconcat(error->message, "\n\0", NULL));
+                       g_free(error);
+               }

The seg fault is coming from this line:

g_print(g_strconcat(error->message, "\n\0", NULL));

because g_mkdir() does raise a GError:

http://library.gnome.org/api/glib/2.8/glib-File-Utilities.html.en#g-mkdir

This is my mistake and I will put an update out to fix this, thank you. 

I'd still like to figure out why your laucher is hitting this section. Let me
know if you have any ideas.


-- Additional comment from austin.arrowsmith.gov.au on 2007-05-14
05:51 EST --
When I delete the .eclipse directory, Eclipse will start, and ask me for the
workspace directory. I press enter (accepting defaults), and it finds existing
projects, and a list of files I previously had open.

I will then close Eclipse, and it saves the workspace, and brings back the
prompt with no other messages.

I try to start Eclipse again, and I get:
Error creating ~/.eclipse/.Segmentation fault

Does this mean I need to remove my .eclipse directory each time I want to start it?

-- Additional comment from austin.arrowsmith.gov.au on 2007-05-14
05:53 EST --
(In reply to comment #11)
> ok, and does this file exist in the old .eclipse directory?:
> 
> org.eclipse.platform_3.2.0/configuration/org.eclipse.update/platform.xml

The only files in that directory are:
.eclipse/org.eclipse.platform_3.2.0/configuration/org.eclipse.update/
.eclipse/org.eclipse.platform_3.2.0/configuration/org.eclipse.update/.lock


In fact - removing my .eclipse directory and recreating as described above,
gives me the following directory tree:
.eclipse/
.eclipse/.homedirmodified-fedora
.eclipse/org.eclipse.platform_3.2.0/
.eclipse/org.eclipse.platform_3.2.0/configuration/
.eclipse/org.eclipse.platform_3.2.0/configuration/org.eclipse.update/
.eclipse/org.eclipse.platform_3.2.0/configuration/org.eclipse.update/.lock
.eclipse/org.eclipse.platform_3.2.0/configuration/org.eclipse.osgi/
.eclipse/org.eclipse.platform_3.2.0/configuration/org.eclipse.osgi/.bundledata.1
.eclipse/org.eclipse.platform_3.2.0/configuration/org.eclipse.osgi/.lazy.1
.eclipse/org.eclipse.platform_3.2.0/configuration/org.eclipse.osgi/.manager/
.eclipse/org.eclipse.platform_3.2.0/configuration/org.eclipse.osgi/.manager/.fileTable.4
.eclipse/org.eclipse.platform_3.2.0/configuration/org.eclipse.osgi/.manager/.fileTableLock
.eclipse/org.eclipse.platform_3.2.0/configuration/org.eclipse.osgi/.manager/.fileTable.5
.eclipse/org.eclipse.platform_3.2.0/configuration/org.eclipse.osgi/.state.1
.eclipse/org.eclipse.platform_3.2.0/configuration/.settings/
.eclipse/org.eclipse.platform_3.2.0/configuration/.settings/org.eclipse.ui.ide.prefs
.eclipse/org.eclipse.platform_3.2.0/configuration/org.eclipse.core.runtime/
.eclipse/org.eclipse.platform_3.2.0/configuration/org.eclipse.core.runtime/.manager/
.eclipse/org.eclipse.platform_3.2.0/configuration/org.eclipse.core.runtime/.manager/.fileTableLock

HTH.

-- Additional comment from bkonrath on 2007-05-14 06:05 EST --
I managed to reproduce the seg fault by changing the permissions on .eclipse to
760 and removing
org.eclipse.platform_3.2.0/configuration/org.eclipse.update/platform.xml. 

Eclipse should be able to start in this condition. Here are the changes that
need to be made to this patch to fix this bug:

* check to see if platform.xml and ~/.eclipse both don't exist to determine if
eclipse has yet to be run
* remove these lines:
  g_print(g_strconcat(error->message, "\n\0", NULL));
  g_free(error);
* use the current umask value for directory creation

-- Additional comment from bkonrath on 2007-05-14 06:09 EST --
(In reply to comment #12)
> Does this mean I need to remove my .eclipse directory each time I want to
start it?

No, this is a bug that will be fixed. I'll have new packages for you to test by
tomorrow morning (UTC/GMT +9). Thanks.

-- Additional comment from bkonrath on 2007-05-14 07:20 EST --
Here is the test plan for this fix. The new package will be 3.2.2-6.fc6.

-> Ensure that the test plan from bug #238107 still passes (tests 1 - 3):

1) ensure update manager works if there 
org.eclipse.rcp_3.2.1.r321_v20060801-clWbqCmjexIWDqg in platform.xml
  -> install eclipse-3.2.2-2.fc6
  -> ensure org.eclipse.rcp_3.2.1.r321_v20060801-clWbqCmjexIWDqg is in 
     platform.xml:
     grep -r rcp_3.2.1  
~/.eclipse/org.eclipse.platform_3.2.0/configuration/org.eclipse.update/platform.xml
  -> if not, running eclipse twice should put rcp_3.2.1 in platform.xml
  -> install eclipse-3.2.2-6.fc6
  -> start eclipse and ensure 3.2.1.r321_v20060801-clWbqCmjexIWDqg is not in 
     platform.xml
  -> ensure that the update manager works

2) ensure that update manager works with a new configuration
   -> install eclipse-3.2.2-6.fc6
   -> rm -r ~/.eclipse
   -> run eclipse
   -> close eclipse
   -> run eclipse again
   -> ensure org.eclipse.rcp_3.2.1.r321_v20060801-clWbqCmjexIWDqg is not in 
     platform.xml:
     grep rcp_3.2.1 \
~/.eclipse/org.eclipse.platform_3.2.0/configuration/org.eclipse.update/platform.xml
   -> ensure that the update manager works

3) ensure that original bug is fixed
   -> install 3.2.1-4.fc6
   -> rm -r ~/.eclipse
   -> start eclipse 
   -> close eclipse
   -> update to eclipse-3.2.2-6.fc6
   -> ensure update manager works

4) ensure that this bug is fixed
   -> install eclipse-3.2.2-6.fc6
   -> start eclipse
   -> close eclipse
   -> change permissions of .eclipse to 750
   -> mv
~/.eclipse/org.eclipse.platform_3.2.0/configuration/org.eclipse.update/platform.xml{,.back}
   -> ensure eclipse starts
   -> ensure update manager works

Comment 1 Ben Konrath 2007-05-16 07:35:23 UTC
Here is the test plan for this fix. The new package will be 3.2.2-13.fc7.

-> Ensure that the test plan from bug #238109 still passes (tests 1 - 3):

1) ensure update manager works if there 
org.eclipse.rcp_3.2.1.r321_v20060801-clWbqCmjexIWDqg in platform.xml
  -> install eclipse-3.2.2-2.fc6
  -> ensure org.eclipse.rcp_3.2.1.r321_v20060801-clWbqCmjexIWDqg is in 
     platform.xml:
     grep -r rcp_3.2.1  
~/.eclipse/org.eclipse.platform_3.2.0/configuration/org.eclipse.update/platform.xml
  -> if not, running eclipse twice should put rcp_3.2.1 in platform.xml
  -> install eclipse-3.2.2-6.fc6
  -> start eclipse and ensure 3.2.1.r321_v20060801-clWbqCmjexIWDqg is not in 
     platform.xml
  -> ensure that the update manager works

2) ensure that update manager works with a new configuration
   -> install eclipse-3.2.2-13.fc7
   -> rm -r ~/.eclipse
   -> run eclipse
   -> close eclipse
   -> run eclipse again
   -> ensure org.eclipse.rcp_3.2.1.r321_v20060801-clWbqCmjexIWDqg is not in 
     platform.xml:
     grep rcp_3.2.1 \
~/.eclipse/org.eclipse.platform_3.2.0/configuration/org.eclipse.update/platform.xml
   -> ensure that the update manager works

3) ensure that original bug is fixed
   -> install 3.2.1-4.fc6
   -> rm -r ~/.eclipse
   -> start eclipse 
   -> close eclipse
   -> update to eclipse-3.2.2-13.fc7
   -> ensure update manager works

4) ensure that this bug is fixed
   -> install eclipse-3.2.2-13.fc7
   -> start eclipse
   -> close eclipse
   -> change permissions of ~/.eclipse to 750
   -> mv
~/.eclipse/org.eclipse.platform_3.2.0/configuration/org.eclipse.update/platform.xml{,.back}
   -> ensure eclipse starts
   -> ensure update manager works

Comment 2 Ben Konrath 2007-05-16 08:49:01 UTC
All tests pass with eclipse-3.2.2-13.fc7.