Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 369182

Summary: When initializing a config area the first time with lots of linked dropins, Preference Defaults are incorrect and other strange behavior
Product: [Eclipse Project] Platform Reporter: Martin Oberhuber <mober.at+eclipse>
Component: RuntimeAssignee: platform-runtime-inbox <platform-runtime-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: major    
Priority: P3 CC: curtis.windatt.public, daniel_megert, nldasm9880, remy.suen, tjwatson
Version: 3.8   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug
Attachments:
Description Flags
Logs, and zipped workspace metadata none

Description Martin Oberhuber CLA 2012-01-20 03:18:45 EST
Created attachment 209791 [details]
Logs, and zipped workspace metadata

Build ID:  I20111209-2100 (Eclipse 4.2m4)

When I upgraded from Eclipse 4.2m2 to 4.2m4 retaining my normal development workspace, all compiler warning levels in 
   Preferences > Plug-in Development > Compiler
were turned to "Error" severity such that I couldn't compile my code any more.

Knowing what the problem is, I can now easily compare against standard warning levels in a fresh empty 4.2m4 install and re-set them to defaults; but along the way I noticed that there's no easy way for a user to change a warning level based on a specific entry in the Problems View ("which one in preferences corresponds to this specific message?")

Of course I'm also wondering what could change my existing workspace Preferences.

FWIW, I'm was launching Eclipse by batchfile like this:

SET JRE_DIR="C:\Program Files (x86)\Java\jre6"
SET ECL_DIR=%~dp0\..\..\..\eclipse4.2m4\eclipse
SET VMARGS=-Xmx512m -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -Xverify:none
SET TRACEFILE=osgitrace.log
%ECL_DIR%\eclipsec -configuration %~dp0\eclipse\configuration -debug %~dp0\osgiactivate-debug.options.txt %* -vmargs %VMARGS% 2> %TRACEFILE%

I'm having a couple of *.link files under eclipse/links to pull in 3rd party add-ons. I'm attaching the OSGi activation trace here along with some other logs and a stripped-down ZIP of my .metadata for investigation.
Comment 1 Martin Oberhuber CLA 2012-01-20 03:23:31 EST
Update: After a quit and restart (with the same commandline), the warning levels were back to normal !
Comment 2 Martin Oberhuber CLA 2012-01-20 07:20:35 EST
Two more interesting observations:

- On initial Launch, the icons in the About dialog were missing except for the
  Platform and EMF ones. After quit and restart, add-on icons from extension
  locations were visible.

- I had to manually "Reload" the Target Platform (which points to current 
  install) and perform a clean build in order to fix some missing dependencies.

To me, it looks like some race condition occurred on initial startup - likely somewhere down in the base infrastructure - which prevented default Preferences to be initialized properly.
Comment 3 Martin Oberhuber CLA 2012-01-30 11:57:41 EST
FWIW, exactly the same issue happened to me today when upgrading from 4.2m4 to 4.2m5: Default Preferences incorrect, icons in About Dialog missing, strange error about "An internal error occurred during: "Updating Change Sets for CVS Workspace". In fact, perhaps this exception is the cause for the other failures I'm seeing (backtrace below) ?

I'm updating the Summary (previous value was:"On upgrading from 4.2m2 to 4.2m4, all PDE > Compiler warning levels were turned into "Error"") and reassigning this from PDE to Equinox since it seems a general problem with the Framework.

java.lang.IllegalStateException
	at org.eclipse.core.runtime.Platform.getPlugin(Platform.java:730)
	at org.eclipse.core.internal.preferences.legacy.InitLegacyPreferences.init(InitLegacyPreferences.java:43)
	at org.eclipse.core.internal.preferences.PreferenceServiceRegistryHelper.applyRuntimeDefaults(PreferenceServiceRegistryHelper.java:147)
	at org.eclipse.core.internal.preferences.PreferencesService.applyRuntimeDefaults(PreferencesService.java:368)
	at org.eclipse.core.internal.preferences.DefaultPreferences.applyRuntimeDefaults(DefaultPreferences.java:166)
	at org.eclipse.core.internal.preferences.DefaultPreferences.load(DefaultPreferences.java:237)
	at org.eclipse.core.internal.preferences.EclipsePreferences.create(EclipsePreferences.java:396)
	at org.eclipse.core.internal.preferences.EclipsePreferences.internalNode(EclipsePreferences.java:642)
	at org.eclipse.core.internal.preferences.DefaultPreferences.node(DefaultPreferences.java:153)
	at org.eclipse.core.internal.preferences.legacy.PreferenceForwarder.getDefaultPreferences(PreferenceForwarder.java:130)
	at org.eclipse.core.internal.preferences.legacy.PreferenceForwarder.contains(PreferenceForwarder.java:192)
	at org.eclipse.team.core.Team.readIgnoreState(Team.java:368)
	at org.eclipse.team.core.Team.initializeIgnores(Team.java:177)
	at org.eclipse.team.core.Team.getAllIgnores(Team.java:166)
	at org.eclipse.team.core.Team.getStringMatchers(Team.java:209)
	at org.eclipse.team.core.Team.matchesEnabledIgnore(Team.java:121)
	at org.eclipse.team.core.Team.isIgnoredHint(Team.java:106)
	at org.eclipse.team.internal.ccvs.core.resources.EclipseResource.isIgnored(EclipseResource.java:117)
	at org.eclipse.team.internal.ccvs.core.CVSSyncTreeSubscriber.isSupervised(CVSSyncTreeSubscriber.java:95)
	at org.eclipse.team.internal.ccvs.core.CVSSyncTreeSubscriber.getSyncInfo(CVSSyncTreeSubscriber.java:75)
	at org.eclipse.team.internal.ccvs.core.CVSSyncTreeSubscriber.getDiff(CVSSyncTreeSubscriber.java:149)
	at org.eclipse.team.internal.core.subscribers.SubscriberChangeSetManager.getDiff(SubscriberChangeSetManager.java:302)
	at org.eclipse.team.internal.core.subscribers.SubscriberChangeSetManager$EventHandler.handleChange(SubscriberChangeSetManager.java:183)
	at org.eclipse.team.internal.core.subscribers.SubscriberChangeSetManager$EventHandler.doDispatchEvents(SubscriberChangeSetManager.java:80)
	at org.eclipse.team.internal.core.BackgroundEventHandler.dispatchEvents(BackgroundEventHandler.java:394)
	at org.eclipse.team.internal.core.BackgroundEventHandler.processEvents(BackgroundEventHandler.java:374)
	at org.eclipse.team.internal.core.BackgroundEventHandler$1.run(BackgroundEventHandler.java:203)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 4 Thomas Watson CLA 2012-01-30 13:49:16 EST
Moving to Platform-Runtime

org.eclipse.core.runtime.Platform.getPluginRegistry() seems to be the problem, but I am not sure why that is returning null.  My guess is the reflective magic being done in that method is throwing an exception which gets eaten and null is returned.

Do you have a log file you could attach with the exception and any others that may have happened?
Comment 5 Martin Oberhuber CLA 2012-01-30 18:38:55 EST
Logs, zipped workspace etc are all still attached from the first time I saw this.
Comment 6 Martin Oberhuber CLA 2012-03-19 04:01:31 EDT
I just saw this again when launching Eclipse 4.2m6 for the very first time.

On my machine, this is 100% reproducable. 

Logs look still pretty much the same as attached and in comment 3 - let me know if you want any more logs. As an alternative, we could also meet at EclipseCon next week and debug this live on my machine:

java.lang.IllegalStateException
	at org.eclipse.core.runtime.Platform.getPlugin(Platform.java:734)
	at org.eclipse.core.internal.preferences.legacy.InitLegacyPreferences.init(InitLegacyPreferences.java:43)
	at org.eclipse.core.internal.preferences.PreferenceServiceRegistryHelper.applyRuntimeDefaults(PreferenceServiceRegistryHelper.java:147)
	at org.eclipse.core.internal.preferences.PreferencesService.applyRuntimeDefaults(PreferencesService.java:368)
Comment 7 Martin Oberhuber CLA 2013-03-04 05:18:30 EST
CQ:WIND00406410  

While I had previously seen this only in my dev environments, the issue has now been reported by a customer (on BuildID = Eclipse 3.8.1 on host = RHEL 6 Linux GTK 32-bit).

This is a severe issue for us, since customers won't notice the broken Preferences on the initial launch and might start doing some work until very odd and unexpected behavior is observed. 

I'm going to mark the issue as Major on All Platforms therefore.
Comment 8 Eclipse Genie CLA 2020-08-06 13:55:44 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.