Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 322020 - CommandLineArgs is not thread-safe
Summary: CommandLineArgs is not thread-safe
Status: CLOSED WONTFIX
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Framework (show other bugs)
Version: 3.5.2   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: equinox.framework-inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-06 13:51 EDT by Nick Edgar CLA
Modified: 2021-08-29 00:50 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Edgar CLA 2010-08-06 13:51:49 EDT
I've been trying to figure out a vexing problem in JBE, the Jazz Build Engine, a command-line OSGi app.  Several people have reported that, sometimes, arguments they've specified on the command line are ignored.

TR> sudo BUILD_SYSTEM_DIR/jazz/buildsystem/buildengine/eclipse/jbe -repository [myrepository] -userId rtimothy -pass [mypass] -vm /opt/ibm/java2-i386-50/bin/java -engineId rbf-wica-3.tivlab.austin.ibm.com   
and it keeps telling me: CRRTC3501E: Missing required argument "-userId".  

The command line processing logic in JBE is dead simple, and I've traced through it several times and can't see how an argument could get ignored.

While looking into this, I noticed that 
org.eclipse.equinox.internal.app.CommandLineArgs
is not thread-safe, yet is used by multiple threads.
Its processCommandLine method gets called on one thread, then getApplicationArgs() gets called from another.

For more details, see the Jazz work item:
https://jazz.net/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/123796

I don't think this would explain the original problem, though, since I'd expect either the array or its entries to be null if it was a threading problem, which would cause our code to fail with an NPE since we don't actually check for null.
Comment 1 Eclipse Webmaster CLA 2019-09-06 16:10:32 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.

If you have further information on the current state of the bug, please add it. 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.
Comment 2 Eclipse Genie CLA 2021-08-29 00:50:51 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.