This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 121392 - Two sessions of NB running in same userdir
Summary: Two sessions of NB running in same userdir
Status: RESOLVED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Launchers&CLI (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: t_h
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-07 17:13 UTC by err
Modified: 2009-12-21 06:42 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
log of first session (45.62 KB, text/plain)
2007-11-07 17:14 UTC, err
Details
second session (32.92 KB, text/plain)
2007-11-07 17:15 UTC, err
Details

Note You need to log in before you can comment on or make changes to this bug.
Description err 2007-11-07 17:13:27 UTC
I inadvertently double clicked on icon and a seconed session of NB started! Since I run with a console, I am attaching
logs for each session. I was able to start up a third session! I exitted all sessions and the lock file was still there.
I manually removed the lock, then started NB. Then clicking the icon brings up the current session of NB. (I'm guessing
the number in the lock file is the PID of the "running" session)

(note: C:\Documents and Settings\erra on /erra type system (binmode))
/bugs/ $ ls -l /erra/.netbeans/dev
total 17
-rwx------+  1 erra None 15716 Nov  7 08:50 build.properties
drwx------+ 17 erra None     0 Nov  6 09:25 config
-rwx------+  1 erra None     4 Oct 31 20:24 lock
drwx------+  4 erra None     0 Nov  5 16:54 modules
drwx------+  4 erra None     0 Nov  5 16:54 update
drwx------+  2 erra None     0 Nov  5 16:54 update_tracking
drwx------+  6 erra None     0 Nov  6 16:06 var
/bugs/ $ od -x /erra/.netbeans/dev/lock
0000000 0000 1c0b
0000004

## after manually clearing the lock file, things are ok

/bugs/ $ ls -l /erra/.netbeans/dev
total 17
-rwx------+  1 erra None 15716 Nov  7 09:06 build.properties
drwx------+ 17 erra None     0 Nov  6 09:25 config
-rwx------+  1 erra None    18 Nov  7 09:06 lock
drwx------+  4 erra None     0 Nov  5 16:54 modules
drwx------+  4 erra None     0 Nov  5 16:54 update
drwx------+  2 erra None     0 Nov  5 16:54 update_tracking
drwx------+  6 erra None     0 Nov  6 16:06 var
/bugs/ $ od -x /erra/.netbeans/dev/lock
0000000 0000 6507 c943 4e47 2f72 ed8e 9831 a8c0
0000020 0401
0000022
Comment 1 err 2007-11-07 17:14:38 UTC
Created attachment 52672 [details]
log of first session
Comment 2 err 2007-11-07 17:15:32 UTC
Created attachment 52673 [details]
second session
Comment 3 err 2007-11-07 17:18:51 UTC
As you can see, the original lock file is some old lock file. I vaguly remember running the installer when NB was
running a few days ago (probably the 31st)
Comment 4 ehucka 2007-11-08 14:33:35 UTC
IMO it is not P1 issue (see priority guidelines http://qa.netbeans.org/bugzilla/bug_priority_guidelines.html). Moving to
core for reevaluation.
Comment 5 err 2007-11-08 14:53:09 UTC
P1: data loss	User's data are corrupted or lost

I didn't play around with multiple copies running, but I was guessing it would be easy to get corruption.
Comment 6 Lukas Hasik 2007-11-08 15:17:36 UTC
jesse, could you look at it? IMO, you are the author of the CLI (or reassign if I'm wrong) Thanks.
Comment 7 Jesse Glick 2007-11-09 12:37:23 UTC
Any steps to reproduce?
Comment 8 err 2007-11-09 15:52:53 UTC
To reproduce getting multiple copies of NB running in a userdir you can do (under windows with cygwin)
    # touch ~/.netbeans/dev/lock
Now every time you double click NB's desk top shortcut you get a new instance running.

Regarding the actual failure I observed, I'm not sure how that 4 byte lock file from Oct31 got there. Is there some NB
related program that generates 4 byte lock files? After manually removing it, I only see 18 byte lock files.
Comment 9 Jaroslav Tulach 2007-11-14 15:34:28 UTC
Please generate the two logs while enabling "org.netbeans.CLIHandler" logger using standard Java configuration 
mechanism: http://java.sun.com/javase/6/docs/api/java/util/logging/LogManager.html
That will give us info on what is going on. Otherwise there is really not much we can do.
Comment 10 err 2007-11-14 16:03:34 UTC
> WORKSFORME
> generate the two logs ... Otherwise there is really not much we can do.

Does this mean the steps for reproducing this don't work for you?

Or that reproducing the initial condition using "touch ~/.netbeans/dev/lock" isn't useful?
Comment 11 err 2007-11-22 22:32:07 UTC
Reopening to get answer to last question.
Comment 12 Jaroslav Tulach 2008-02-20 14:26:12 UTC
I have to admit I do not have cygwin. Any other way to reproduce it?
Comment 13 err 2008-02-20 17:45:17 UTC
AFAICT, it has nothing to do with cygwin. Unfortunately I don't know how to use command.com, but I recreated multiple
instances of 6.1M1 running without using cygwin. If you tell me where the code is that creates/checks for lock files I
can take a look.

I used a native windows app, gvim, to create an empty lock file. Using cygwin commands it is seen as
    $ ls -ld .netbeans .netbeans/dev .netbeans/dev/lock
    drwx------+ 8 erra None 0 Feb 19 08:02 .netbeans
    drwx------+ 7 erra None 0 Feb 20 08:36 .netbeans/dev
    -rwx------+ 1 erra None 0 Feb 20 08:36 .netbeans/dev/lock

After creating it, I used the windows desktop icon to start two instances of NB.

Product Version: NetBeans IDE Dev (Build 200801280931)
Java: 1.6.0_04; Java HotSpot(TM) Client VM 10.0-b19
System: Windows XP version 5.1 running on x86; Cp1252; en_US (nb)
Userdir: C:\Documents and Settings\erra\.netbeans\dev
Comment 14 Lukas Hasik 2008-12-04 12:42:38 UTC
somehow able to reproduce with nb65.
I have two terminals open. When you run the same nb.exe in both terminal synchronously then it will start two same IDEs.
This probably the same case when you click the icon. 
Question is when is the lock in userdir created. OTOH, P5 seems as appropriate priority. This is corner case problem
that shouldn't affect user at all. You can always close the "second" IDE that were started by mistake

Seems that I'm not able to reproduce again
Comment 15 Quality Engineering 2009-12-21 06:42:08 UTC
This bug was reported against NetBeans IDE 6.0 or an older release, or against a non-maintained module. NetBeans team does not have enough resources to get to this issue, therefore we are closing the issue as a WONTFIX. If you are interested in providing a patch for this bug, please see our NetFIX guidelines for how to proceed. 

We apologize for any inconvenience.


Thank you.
The NetBeans Team