Conflicting ImageJ sessions in different X11 sessions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Conflicting ImageJ sessions in different X11 sessions

JiHO-2
Hello,

I am encountering a very strange behavior. Here is the situation:

ImageJ is called from within a shell script with the syntax:
        java -Xmx2000m -ijpath $pathToIJ/plugins -jar $pathToIJ/ij.jar -eval  
"some macro code"  > /dev/null 2>&1
The parent shell script runs on a Ubuntu Linux machine, latest and  
greatest. Each user has a *local* installation of the code (bash  
scripts + ij.jar and plugin class files). Each user also works on  
local images, on his account.
User 1 starts IJ through the script and leaves it running.
User 2 opens a new session (through ssh -X or locally using user  
switching, so that User 1 is still connected).
User 2 tries to run the bash script = all windows appear on the  
desktop of User 1 !! There is also a message:

                Macro Error

Duplicate call in line 1.

run("Image Sequence...", "open=/... rest of my inline macro


IJ seems to detect that it was already running and sends the windows  
to the running instance. Is that expected?

This strikes me as very odd, and a potential security vulnerability.

On this machine users:
- each have their own group
- write files as rw-rw-r-- (but since they each have their own group  
they can't write to each other's home directories)
- all belong to the group "users", so that they can share data which  
is present on another drive (not the one accessed here)

When I try to reproduce this manually such as:
#run this as user 1
wget http://rsb.info.nih.gov/ij/download/jars/ij142q.jar
java -jar ij142q.jar -eval "run('AuPbSn 40 (56K)');"
# leave IJ running
#and this as user 2
wget http://rsb.info.nih.gov/ij/download/jars/ij142q.jar
java -jar ij142q.jar -eval "run('Bat Cochlea Volume (19K)');"

IJ opens correctly for user 2. So this seems to be something specific  
to my code, but I really don't know where to look.

I would very much appreciate any pointers to help me debug the issue.  
I cannot provide access to the machine (it is on an internal network  
only) but I can run anything that's needed to debug this.

Thanks in advance. Sincerely,

JiHO
---
http://maururu.net
Reply | Threaded
Open this post in threaded view
|

Re: Conflicting ImageJ sessions in different X11 sessions

Michael Schmid
Hi JiHO,

do you have Edit>Options>Misc>Run Socket Listener enabled?
This prevents you from having multiple instances of ImageJ on one  
machine.

   http://rsb.info.nih.gov/ij/docs/menus/edit.html#misc

Michael
________________________________________________________________

On 30 Jun 2009, at 09:00, JiHO wrote:

> Hello,
>
> I am encountering a very strange behavior. Here is the situation:
>
> ImageJ is called from within a shell script with the syntax:
> java -Xmx2000m -ijpath $pathToIJ/plugins -jar $pathToIJ/ij.jar -
> eval "some macro code"  > /dev/null 2>&1
> The parent shell script runs on a Ubuntu Linux machine, latest and  
> greatest. Each user has a *local* installation of the code (bash  
> scripts + ij.jar and plugin class files). Each user also works on  
> local images, on his account.
> User 1 starts IJ through the script and leaves it running.
> User 2 opens a new session (through ssh -X or locally using user  
> switching, so that User 1 is still connected).
> User 2 tries to run the bash script = all windows appear on the  
> desktop of User 1 !! There is also a message:
>
> Macro Error
>
> Duplicate call in line 1.
>
> run("Image Sequence...", "open=/... rest of my inline macro
>
>
> IJ seems to detect that it was already running and sends the  
> windows to the running instance. Is that expected?
>
> This strikes me as very odd, and a potential security vulnerability.
>
> On this machine users:
> - each have their own group
> - write files as rw-rw-r-- (but since they each have their own  
> group they can't write to each other's home directories)
> - all belong to the group "users", so that they can share data  
> which is present on another drive (not the one accessed here)
>
> When I try to reproduce this manually such as:
> #run this as user 1
> wget http://rsb.info.nih.gov/ij/download/jars/ij142q.jar
> java -jar ij142q.jar -eval "run('AuPbSn 40 (56K)');"
> # leave IJ running
> #and this as user 2
> wget http://rsb.info.nih.gov/ij/download/jars/ij142q.jar
> java -jar ij142q.jar -eval "run('Bat Cochlea Volume (19K)');"
>
> IJ opens correctly for user 2. So this seems to be something  
> specific to my code, but I really don't know where to look.
>
> I would very much appreciate any pointers to help me debug the  
> issue. I cannot provide access to the machine (it is on an internal  
> network only) but I can run anything that's needed to debug this.
>
> Thanks in advance. Sincerely,
>
> JiHO
> ---
> http://maururu.net
Reply | Threaded
Open this post in threaded view
|

Re: Conflicting ImageJ sessions in different X11 sessions

JiHO-2
On 2009-June-30  , at 04:37 , Michael Schmid wrote:

> Hi JiHO,
>
> do you have Edit>Options>Misc>Run Socket Listener enabled?
> This prevents you from having multiple instances of ImageJ on one  
> machine.
>
>  http://rsb.info.nih.gov/ij/docs/menus/edit.html#misc
>
> Michael

Hello Michael,

Sorry, I somehow missed your reply. Thank you very much for the  
information.

I did not even have this option in the Misc menu. I was using IJ 1.41  
and used the jar only version from  http://rsb.info.nih.gov/ij/download/jars/ 
.

I now downloaded 1.42q which has the option, and it is unselected by  
default and it seems to work now. So I guess the socket listener was  
enable by default in the past.

Thanks a lot for your help!

JiHO
---
http://maururu.net
Reply | Threaded
Open this post in threaded view
|

Re: Conflicting ImageJ sessions in different X11 sessions

Gabriel Landini
On Monday 06 July 2009 20:29:07 JiHO wrote:
> I did not even have this option in the Misc menu. I was using IJ 1.41
[...]
> I now downloaded 1.42q which has the option, and it is unselected by
[...]

Were you are aware that there is an update command under the Help menu entry?
The latest one is 1.43b (or 1.43c via the daily build).

G.
Reply | Threaded
Open this post in threaded view
|

Re: Conflicting ImageJ sessions in different X11 sessions

JiHO-2
On 2009-July-06  , at 16:01 , Gabriel Landini wrote:

> On Monday 06 July 2009 20:29:07 JiHO wrote:
>> I did not even have this option in the Misc menu. I was using IJ 1.41
> [...]
>> I now downloaded 1.42q which has the option, and it is unselected by
> [...]
>
> Were you are aware that there is an update command under the Help  
> menu entry?
> The latest one is 1.43b (or 1.43c via the daily build).

Thanks. I knew it but I was not expecting it to work with my setup  
(jar file only called from the command line, sometimes in a weird  
way). It actually does provided that I set ijpath correctly.
Still, I now wonder where these builds are coming from it they are not  
in the jar files directory there:
        http://rsb.info.nih.gov/ij/download/jars/

Thanks again.

JiHO
---
http://maururu.net
Reply | Threaded
Open this post in threaded view
|

Re: Conflicting ImageJ sessions in different X11 sessions

Jonathan Jackson-2
In reply to this post by JiHO-2
On Mon, 6 Jul 2009 15:29:07 -0400, JiHO <[hidden email]> wrote:

>On 2009-June-30  , at 04:37 , Michael Schmid wrote:
>
>> Hi JiHO,
>>
>> do you have Edit>Options>Misc>Run Socket Listener enabled?
>> This prevents you from having multiple instances of ImageJ on one
>> machine.
>>
>>  http://rsb.info.nih.gov/ij/docs/menus/edit.html#misc
>>
>> Michael
>

Hi JiHO,

You may also be interested in the ImageJ launcher script for Linux / Unix
that can be found here:

http://imagejdocu.tudor.lu/doku.php?id=diverse:commandline:imagej

This allows multiple ImageJ instances on one machine without disabling the
socket listener. Instances launched in different X sessions are independent
of each other but features of the socket listener are available, such as
opening images in an existing ImageJ window from the command line.

regards,
Jon