Slicer3 does not exit correctly after --evalpython

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Slicer3 does not exit correctly after --evalpython

Daniel Haehn
Hi devels,

when using Slicer3 trunk or a compiled release with --evalpython, Slicer3 does not exit correctly after running python code. (Tested on Snow Leopard and Linux).

13:46:50 daniel@sbia-pc66:~/SLICER/TRUNK/Slicer3-build$ ./Slicer3 --evalpython "print str(1);"
Setting up launch environment...
Starting Slicer: /Users/daniel/SLICER/TRUNK/Slicer3-build
1
vtkDebugLeaks has detected LEAKS!
Class "vtkKWLoadSaveDialog" has 26 instances still around.
Class "vtkMRMLFiducialListNode" has 2 instances still around.
Class "vtkMRMLColorTableStorageNode" has 24 instances still around.
...
and then hangs until CTRL+C

In a release build, the CTRL+C is also needed to exit Slicer.

I don't think it's a problem with the launcher, since --evalpython just gets passed through to Slicer3-real.

When looking at two snippets from Slicer3.cxx:

 652   if (PrintModulePaths)
 653     {
 654
 655     vtkObject::GlobalWarningDisplayOff();
 656
 657     vtkSlicerApplication *slicerApp = 0;
 658
 659     if ( ConfigurationDirectory == "" && TemporaryDirectory == "" )
 660       {
 661       // first call to GetInstance will create the Application
 662       //
 663       // make a substitute tcl proc for the 'exit' built in that
 664       // goes through the vtkKWApplication methodology for exiting
 665       // cleanly
 666       //
 667       slicerApp = vtkSlicerApplication::GetInstance ( );
 668       }
 669     else
 670       {
 671       const char* config_dir = ConfigurationDirectory.c_str();
 672       const char* tmp_dir = TemporaryDirectory.c_str();
 673       slicerApp = vtkSlicerApplication::GetInstance (tmp_dir, config_dir);
 674       }
 675
 676     slicerApp->SetRegistryLevel(0);
 677     slicerApp->PromptBeforeExitOff();
 678     std::cout << slicerApp->GetModulePaths() << std::endl;
 679     slicerApp->SetExitStatus(0);
 680     slicerApp->Exit();
 681     slicerApp->Delete ();
 682     exit(0);
 683     }

and

1985
1986   if ( EvalPython != "" )
1987     {
1988 #if defined(Slicer3_USE_PYTHON)
1989     if ( !NoModules )
1990       {
1991       std::string pythonCmd = EvalPython + "\n";
1992       v = PyRun_String( EvalPython.c_str(),
1993                         Py_file_input,
1994                         PythonDictionary,PythonDictionary);
1995       if (v == NULL)
1996         {
1997         PyErr_Print();
1998         }
1999       slicerApp->SetExitStatus(v == NULL ? EXIT_FAILURE : EXIT_SUCCESS);
2000       slicerApp->Exit();
2001       slicerApp->Delete();
2002       exit(v == NULL ? EXIT_FAILURE : EXIT_SUCCESS);
2003       }
2004 #endif
2005     }

there is no difference between these. In the latter, v is really != NULL is the python code is correct, hence it should be the same code as above.

But only first snippet exits Slicer correctly. There must be something between line 683 and 1985 which causes Slicer to not exit properly.

Does anyone have an idea?

Thanks,
Daniel

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|

Re: Slicer3 does not exit correctly after --evalpython

Dominique Belhachemi
Hi Daniel,

I can reproduce this behavior. The command

     ./Slicer3 --no_splash --evalpython "print str(1);"

produces a lot of leaks. Does anybody have an idea how to solve this issue?

Cheers
Dominique



On Thu, Feb 17, 2011 at 3:58 PM, Daniel Haehn <[hidden email]> wrote:
Hi devels,

when using Slicer3 trunk or a compiled release with --evalpython, Slicer3 does not exit correctly after running python code. (Tested on Snow Leopard and Linux).

13:46:50 daniel@sbia-pc66:~/SLICER/TRUNK/Slicer3-build$ ./Slicer3 --evalpython "print str(1);"
Setting up launch environment...
Starting Slicer: /Users/daniel/SLICER/TRUNK/Slicer3-build
1
vtkDebugLeaks has detected LEAKS!
Class "vtkKWLoadSaveDialog" has 26 instances still around.
Class "vtkMRMLFiducialListNode" has 2 instances still around.
Class "vtkMRMLColorTableStorageNode" has 24 instances still around.
...
and then hangs until CTRL+C

In a release build, the CTRL+C is also needed to exit Slicer.

I don't think it's a problem with the launcher, since --evalpython just gets passed through to Slicer3-real.

When looking at two snippets from Slicer3.cxx:

 652   if (PrintModulePaths)
 653     {
 654
 655     vtkObject::GlobalWarningDisplayOff();
 656
 657     vtkSlicerApplication *slicerApp = 0;
 658
 659     if ( ConfigurationDirectory == "" && TemporaryDirectory == "" )
 660       {
 661       // first call to GetInstance will create the Application
 662       //
 663       // make a substitute tcl proc for the 'exit' built in that
 664       // goes through the vtkKWApplication methodology for exiting
 665       // cleanly
 666       //
 667       slicerApp = vtkSlicerApplication::GetInstance ( );
 668       }
 669     else
 670       {
 671       const char* config_dir = ConfigurationDirectory.c_str();
 672       const char* tmp_dir = TemporaryDirectory.c_str();
 673       slicerApp = vtkSlicerApplication::GetInstance (tmp_dir, config_dir);
 674       }
 675
 676     slicerApp->SetRegistryLevel(0);
 677     slicerApp->PromptBeforeExitOff();
 678     std::cout << slicerApp->GetModulePaths() << std::endl;
 679     slicerApp->SetExitStatus(0);
 680     slicerApp->Exit();
 681     slicerApp->Delete ();
 682     exit(0);
 683     }

and

1985
1986   if ( EvalPython != "" )
1987     {
1988 #if defined(Slicer3_USE_PYTHON)
1989     if ( !NoModules )
1990       {
1991       std::string pythonCmd = EvalPython + "\n";
1992       v = PyRun_String( EvalPython.c_str(),
1993                         Py_file_input,
1994                         PythonDictionary,PythonDictionary);
1995       if (v == NULL)
1996         {
1997         PyErr_Print();
1998         }
1999       slicerApp->SetExitStatus(v == NULL ? EXIT_FAILURE : EXIT_SUCCESS);
2000       slicerApp->Exit();
2001       slicerApp->Delete();
2002       exit(v == NULL ? EXIT_FAILURE : EXIT_SUCCESS);
2003       }
2004 #endif
2005     }

there is no difference between these. In the latter, v is really != NULL is the python code is correct, hence it should be the same code as above.

But only first snippet exits Slicer correctly. There must be something between line 683 and 1985 which causes Slicer to not exit properly.

Does anyone have an idea?

Thanks,
Daniel

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject


_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|

Re: Slicer3 does not exit correctly after --evalpython

Daniel Haehn
Hi Dominique,

I just investigated a little bit further and I think the "Shutdown"-sequence starting from line 2213 in Applications/GUI/Slicer3.cxx should be executed after using --evalpython aswell.

I will give it a shot if nobody has other ideas.

Daniel

On Feb 23, 2011, at 2:58 PM, Dominique Belhachemi wrote:

> Hi Daniel,
>
> I can reproduce this behavior. The command
>
>      ./Slicer3 --no_splash --evalpython "print str(1);"
>
> produces a lot of leaks. Does anybody have an idea how to solve this issue?
>
> Cheers
> Dominique
>
>
>
> On Thu, Feb 17, 2011 at 3:58 PM, Daniel Haehn <[hidden email]> wrote:
> Hi devels,
>
> when using Slicer3 trunk or a compiled release with --evalpython, Slicer3 does not exit correctly after running python code. (Tested on Snow Leopard and Linux).
>
> 13:46:50 daniel@sbia-pc66:~/SLICER/TRUNK/Slicer3-build$ ./Slicer3 --evalpython "print str(1);"
> Setting up launch environment...
> Starting Slicer: /Users/daniel/SLICER/TRUNK/Slicer3-build
> 1
> vtkDebugLeaks has detected LEAKS!
> Class "vtkKWLoadSaveDialog" has 26 instances still around.
> Class "vtkMRMLFiducialListNode" has 2 instances still around.
> Class "vtkMRMLColorTableStorageNode" has 24 instances still around.
> ...
> and then hangs until CTRL+C
>
> In a release build, the CTRL+C is also needed to exit Slicer.
>
> I don't think it's a problem with the launcher, since --evalpython just gets passed through to Slicer3-real.
>
> When looking at two snippets from Slicer3.cxx:
>
>  652   if (PrintModulePaths)
>  653     {
>  654
>  655     vtkObject::GlobalWarningDisplayOff();
>  656
>  657     vtkSlicerApplication *slicerApp = 0;
>  658
>  659     if ( ConfigurationDirectory == "" && TemporaryDirectory == "" )
>  660       {
>  661       // first call to GetInstance will create the Application
>  662       //
>  663       // make a substitute tcl proc for the 'exit' built in that
>  664       // goes through the vtkKWApplication methodology for exiting
>  665       // cleanly
>  666       //
>  667       slicerApp = vtkSlicerApplication::GetInstance ( );
>  668       }
>  669     else
>  670       {
>  671       const char* config_dir = ConfigurationDirectory.c_str();
>  672       const char* tmp_dir = TemporaryDirectory.c_str();
>  673       slicerApp = vtkSlicerApplication::GetInstance (tmp_dir, config_dir);
>  674       }
>  675
>  676     slicerApp->SetRegistryLevel(0);
>  677     slicerApp->PromptBeforeExitOff();
>  678     std::cout << slicerApp->GetModulePaths() << std::endl;
>  679     slicerApp->SetExitStatus(0);
>  680     slicerApp->Exit();
>  681     slicerApp->Delete ();
>  682     exit(0);
>  683     }
>
> and
>
> 1985
> 1986   if ( EvalPython != "" )
> 1987     {
> 1988 #if defined(Slicer3_USE_PYTHON)
> 1989     if ( !NoModules )
> 1990       {
> 1991       std::string pythonCmd = EvalPython + "\n";
> 1992       v = PyRun_String( EvalPython.c_str(),
> 1993                         Py_file_input,
> 1994                         PythonDictionary,PythonDictionary);
> 1995       if (v == NULL)
> 1996         {
> 1997         PyErr_Print();
> 1998         }
> 1999       slicerApp->SetExitStatus(v == NULL ? EXIT_FAILURE : EXIT_SUCCESS);
> 2000       slicerApp->Exit();
> 2001       slicerApp->Delete();
> 2002       exit(v == NULL ? EXIT_FAILURE : EXIT_SUCCESS);
> 2003       }
> 2004 #endif
> 2005     }
>
> there is no difference between these. In the latter, v is really != NULL is the python code is correct, hence it should be the same code as above.
>
> But only first snippet exits Slicer correctly. There must be something between line 683 and 1985 which causes Slicer to not exit properly.
>
> Does anyone have an idea?
>
> Thanks,
> Daniel
>
> _______________________________________________
> slicer-devel mailing list
> [hidden email]
> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
> To unsubscribe: send email to [hidden email] with unsubscribe as the subject
>

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|

Re: Slicer3 does not exit correctly after --evalpython

Daniel Haehn
Hi,

ok - should be fixed in latest trunk.

Thanks,
Daniel

On Feb 23, 2011, at 3:02 PM, Daniel Haehn wrote:

> Hi Dominique,
>
> I just investigated a little bit further and I think the "Shutdown"-sequence starting from line 2213 in Applications/GUI/Slicer3.cxx should be executed after using --evalpython aswell.
>
> I will give it a shot if nobody has other ideas.
>
> Daniel
>
> On Feb 23, 2011, at 2:58 PM, Dominique Belhachemi wrote:
>
>> Hi Daniel,
>>
>> I can reproduce this behavior. The command
>>
>>     ./Slicer3 --no_splash --evalpython "print str(1);"
>>
>> produces a lot of leaks. Does anybody have an idea how to solve this issue?
>>
>> Cheers
>> Dominique
>>
>>
>>
>> On Thu, Feb 17, 2011 at 3:58 PM, Daniel Haehn <[hidden email]> wrote:
>> Hi devels,
>>
>> when using Slicer3 trunk or a compiled release with --evalpython, Slicer3 does not exit correctly after running python code. (Tested on Snow Leopard and Linux).
>>
>> 13:46:50 daniel@sbia-pc66:~/SLICER/TRUNK/Slicer3-build$ ./Slicer3 --evalpython "print str(1);"
>> Setting up launch environment...
>> Starting Slicer: /Users/daniel/SLICER/TRUNK/Slicer3-build
>> 1
>> vtkDebugLeaks has detected LEAKS!
>> Class "vtkKWLoadSaveDialog" has 26 instances still around.
>> Class "vtkMRMLFiducialListNode" has 2 instances still around.
>> Class "vtkMRMLColorTableStorageNode" has 24 instances still around.
>> ...
>> and then hangs until CTRL+C
>>
>> In a release build, the CTRL+C is also needed to exit Slicer.
>>
>> I don't think it's a problem with the launcher, since --evalpython just gets passed through to Slicer3-real.
>>
>> When looking at two snippets from Slicer3.cxx:
>>
>> 652   if (PrintModulePaths)
>> 653     {
>> 654
>> 655     vtkObject::GlobalWarningDisplayOff();
>> 656
>> 657     vtkSlicerApplication *slicerApp = 0;
>> 658
>> 659     if ( ConfigurationDirectory == "" && TemporaryDirectory == "" )
>> 660       {
>> 661       // first call to GetInstance will create the Application
>> 662       //
>> 663       // make a substitute tcl proc for the 'exit' built in that
>> 664       // goes through the vtkKWApplication methodology for exiting
>> 665       // cleanly
>> 666       //
>> 667       slicerApp = vtkSlicerApplication::GetInstance ( );
>> 668       }
>> 669     else
>> 670       {
>> 671       const char* config_dir = ConfigurationDirectory.c_str();
>> 672       const char* tmp_dir = TemporaryDirectory.c_str();
>> 673       slicerApp = vtkSlicerApplication::GetInstance (tmp_dir, config_dir);
>> 674       }
>> 675
>> 676     slicerApp->SetRegistryLevel(0);
>> 677     slicerApp->PromptBeforeExitOff();
>> 678     std::cout << slicerApp->GetModulePaths() << std::endl;
>> 679     slicerApp->SetExitStatus(0);
>> 680     slicerApp->Exit();
>> 681     slicerApp->Delete ();
>> 682     exit(0);
>> 683     }
>>
>> and
>>
>> 1985
>> 1986   if ( EvalPython != "" )
>> 1987     {
>> 1988 #if defined(Slicer3_USE_PYTHON)
>> 1989     if ( !NoModules )
>> 1990       {
>> 1991       std::string pythonCmd = EvalPython + "\n";
>> 1992       v = PyRun_String( EvalPython.c_str(),
>> 1993                         Py_file_input,
>> 1994                         PythonDictionary,PythonDictionary);
>> 1995       if (v == NULL)
>> 1996         {
>> 1997         PyErr_Print();
>> 1998         }
>> 1999       slicerApp->SetExitStatus(v == NULL ? EXIT_FAILURE : EXIT_SUCCESS);
>> 2000       slicerApp->Exit();
>> 2001       slicerApp->Delete();
>> 2002       exit(v == NULL ? EXIT_FAILURE : EXIT_SUCCESS);
>> 2003       }
>> 2004 #endif
>> 2005     }
>>
>> there is no difference between these. In the latter, v is really != NULL is the python code is correct, hence it should be the same code as above.
>>
>> But only first snippet exits Slicer correctly. There must be something between line 683 and 1985 which causes Slicer to not exit properly.
>>
>> Does anyone have an idea?
>>
>> Thanks,
>> Daniel
>>
>> _______________________________________________
>> slicer-devel mailing list
>> [hidden email]
>> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
>> To unsubscribe: send email to [hidden email] with unsubscribe as the subject
>>
>
> _______________________________________________
> slicer-devel mailing list
> [hidden email]
> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
> To unsubscribe: send email to [hidden email] with unsubscribe as the subject

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|

Re: Slicer3 does not exit correctly after --evalpython

Dominique Belhachemi
Hi Daniel,

it looks a little bit better now.

It works if 'direct rendering' is activated
$ glxinfo
direct rendering: Yes

On a computer where it is deactivated I still get leaks
$ glxinfo
direct rendering: No

$ ./Slicer3 --no_splash --evalpython "print str(1);"
Starting Slicer: /tmp/Slicer3-build
X Error of failed request:  GLXBadContextTag
  Major opcode of failed request:  154 (GLX)
  Minor opcode of failed request:  5 (X_GLXMakeCurrent)
  Serial number of failed request:  149518
  Current serial number in output stream:  149518
1
vtkDebugLeaks has detected LEAKS!
Class "vtkKWLoadSaveDialog" has 13 instances still around.
[...]

Thanks
-Dominique



On Wed, Feb 23, 2011 at 3:21 PM, Daniel Haehn <[hidden email]> wrote:
Hi,

ok - should be fixed in latest trunk.

Thanks,
Daniel

On Feb 23, 2011, at 3:02 PM, Daniel Haehn wrote:

> Hi Dominique,
>
> I just investigated a little bit further and I think the "Shutdown"-sequence starting from line 2213 in Applications/GUI/Slicer3.cxx should be executed after using --evalpython aswell.
>
> I will give it a shot if nobody has other ideas.
>
> Daniel
>
> On Feb 23, 2011, at 2:58 PM, Dominique Belhachemi wrote:
>
>> Hi Daniel,
>>
>> I can reproduce this behavior. The command
>>
>>     ./Slicer3 --no_splash --evalpython "print str(1);"
>>
>> produces a lot of leaks. Does anybody have an idea how to solve this issue?
>>
>> Cheers
>> Dominique
>>
>>
>>
>> On Thu, Feb 17, 2011 at 3:58 PM, Daniel Haehn <[hidden email]> wrote:
>> Hi devels,
>>
>> when using Slicer3 trunk or a compiled release with --evalpython, Slicer3 does not exit correctly after running python code. (Tested on Snow Leopard and Linux).
>>
>> 13:46:50 daniel@sbia-pc66:~/SLICER/TRUNK/Slicer3-build$ ./Slicer3 --evalpython "print str(1);"
>> Setting up launch environment...
>> Starting Slicer: /Users/daniel/SLICER/TRUNK/Slicer3-build
>> 1
>> vtkDebugLeaks has detected LEAKS!
>> Class "vtkKWLoadSaveDialog" has 26 instances still around.
>> Class "vtkMRMLFiducialListNode" has 2 instances still around.
>> Class "vtkMRMLColorTableStorageNode" has 24 instances still around.
>> ...
>> and then hangs until CTRL+C
>>
>> In a release build, the CTRL+C is also needed to exit Slicer.
>>
>> I don't think it's a problem with the launcher, since --evalpython just gets passed through to Slicer3-real.
>>
>> When looking at two snippets from Slicer3.cxx:
>>
>> 652   if (PrintModulePaths)
>> 653     {
>> 654
>> 655     vtkObject::GlobalWarningDisplayOff();
>> 656
>> 657     vtkSlicerApplication *slicerApp = 0;
>> 658
>> 659     if ( ConfigurationDirectory == "" && TemporaryDirectory == "" )
>> 660       {
>> 661       // first call to GetInstance will create the Application
>> 662       //
>> 663       // make a substitute tcl proc for the 'exit' built in that
>> 664       // goes through the vtkKWApplication methodology for exiting
>> 665       // cleanly
>> 666       //
>> 667       slicerApp = vtkSlicerApplication::GetInstance ( );
>> 668       }
>> 669     else
>> 670       {
>> 671       const char* config_dir = ConfigurationDirectory.c_str();
>> 672       const char* tmp_dir = TemporaryDirectory.c_str();
>> 673       slicerApp = vtkSlicerApplication::GetInstance (tmp_dir, config_dir);
>> 674       }
>> 675
>> 676     slicerApp->SetRegistryLevel(0);
>> 677     slicerApp->PromptBeforeExitOff();
>> 678     std::cout << slicerApp->GetModulePaths() << std::endl;
>> 679     slicerApp->SetExitStatus(0);
>> 680     slicerApp->Exit();
>> 681     slicerApp->Delete ();
>> 682     exit(0);
>> 683     }
>>
>> and
>>
>> 1985
>> 1986   if ( EvalPython != "" )
>> 1987     {
>> 1988 #if defined(Slicer3_USE_PYTHON)
>> 1989     if ( !NoModules )
>> 1990       {
>> 1991       std::string pythonCmd = EvalPython + "\n";
>> 1992       v = PyRun_String( EvalPython.c_str(),
>> 1993                         Py_file_input,
>> 1994                         PythonDictionary,PythonDictionary);
>> 1995       if (v == NULL)
>> 1996         {
>> 1997         PyErr_Print();
>> 1998         }
>> 1999       slicerApp->SetExitStatus(v == NULL ? EXIT_FAILURE : EXIT_SUCCESS);
>> 2000       slicerApp->Exit();
>> 2001       slicerApp->Delete();
>> 2002       exit(v == NULL ? EXIT_FAILURE : EXIT_SUCCESS);
>> 2003       }
>> 2004 #endif
>> 2005     }
>>
>> there is no difference between these. In the latter, v is really != NULL is the python code is correct, hence it should be the same code as above.
>>
>> But only first snippet exits Slicer correctly. There must be something between line 683 and 1985 which causes Slicer to not exit properly.
>>
>> Does anyone have an idea?
>>
>> Thanks,
>> Daniel
>>
>> _______________________________________________
>> slicer-devel mailing list
>> [hidden email]
>> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
>> To unsubscribe: send email to [hidden email] with unsubscribe as the subject
>>
>
> _______________________________________________
> slicer-devel mailing list
> [hidden email]
> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
> To unsubscribe: send email to [hidden email] with unsubscribe as the subject



_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|

Re: Slicer3 does not exit correctly after --evalpython

Daniel Haehn
Hi Dominique,

I don't think that this is connected to --evalpython.

Could you try: ./Slicer without any arguments on the "direct rendering: No" machine and see if you also get leaks if you just exit it?

Thanks,
Daniel

On Feb 24, 2011, at 3:53 PM, Dominique Belhachemi wrote:

> Hi Daniel,
>
> it looks a little bit better now.
>
> It works if 'direct rendering' is activated
> $ glxinfo
> direct rendering: Yes
>
> On a computer where it is deactivated I still get leaks
> $ glxinfo
> direct rendering: No
>
> $ ./Slicer3 --no_splash --evalpython "print str(1);"
> Starting Slicer: /tmp/Slicer3-build
> X Error of failed request:  GLXBadContextTag
>   Major opcode of failed request:  154 (GLX)
>   Minor opcode of failed request:  5 (X_GLXMakeCurrent)
>   Serial number of failed request:  149518
>   Current serial number in output stream:  149518
> 1
> vtkDebugLeaks has detected LEAKS!
> Class "vtkKWLoadSaveDialog" has 13 instances still around.
> [...]
>
> Thanks
> -Dominique
>
>
>
> On Wed, Feb 23, 2011 at 3:21 PM, Daniel Haehn <[hidden email]> wrote:
> Hi,
>
> ok - should be fixed in latest trunk.
>
> Thanks,
> Daniel
>
> On Feb 23, 2011, at 3:02 PM, Daniel Haehn wrote:
>
> > Hi Dominique,
> >
> > I just investigated a little bit further and I think the "Shutdown"-sequence starting from line 2213 in Applications/GUI/Slicer3.cxx should be executed after using --evalpython aswell.
> >
> > I will give it a shot if nobody has other ideas.
> >
> > Daniel
> >
> > On Feb 23, 2011, at 2:58 PM, Dominique Belhachemi wrote:
> >
> >> Hi Daniel,
> >>
> >> I can reproduce this behavior. The command
> >>
> >>     ./Slicer3 --no_splash --evalpython "print str(1);"
> >>
> >> produces a lot of leaks. Does anybody have an idea how to solve this issue?
> >>
> >> Cheers
> >> Dominique
> >>
> >>
> >>
> >> On Thu, Feb 17, 2011 at 3:58 PM, Daniel Haehn <[hidden email]> wrote:
> >> Hi devels,
> >>
> >> when using Slicer3 trunk or a compiled release with --evalpython, Slicer3 does not exit correctly after running python code. (Tested on Snow Leopard and Linux).
> >>
> >> 13:46:50 daniel@sbia-pc66:~/SLICER/TRUNK/Slicer3-build$ ./Slicer3 --evalpython "print str(1);"
> >> Setting up launch environment...
> >> Starting Slicer: /Users/daniel/SLICER/TRUNK/Slicer3-build
> >> 1
> >> vtkDebugLeaks has detected LEAKS!
> >> Class "vtkKWLoadSaveDialog" has 26 instances still around.
> >> Class "vtkMRMLFiducialListNode" has 2 instances still around.
> >> Class "vtkMRMLColorTableStorageNode" has 24 instances still around.
> >> ...
> >> and then hangs until CTRL+C
> >>
> >> In a release build, the CTRL+C is also needed to exit Slicer.
> >>
> >> I don't think it's a problem with the launcher, since --evalpython just gets passed through to Slicer3-real.
> >>
> >> When looking at two snippets from Slicer3.cxx:
> >>
> >> 652   if (PrintModulePaths)
> >> 653     {
> >> 654
> >> 655     vtkObject::GlobalWarningDisplayOff();
> >> 656
> >> 657     vtkSlicerApplication *slicerApp = 0;
> >> 658
> >> 659     if ( ConfigurationDirectory == "" && TemporaryDirectory == "" )
> >> 660       {
> >> 661       // first call to GetInstance will create the Application
> >> 662       //
> >> 663       // make a substitute tcl proc for the 'exit' built in that
> >> 664       // goes through the vtkKWApplication methodology for exiting
> >> 665       // cleanly
> >> 666       //
> >> 667       slicerApp = vtkSlicerApplication::GetInstance ( );
> >> 668       }
> >> 669     else
> >> 670       {
> >> 671       const char* config_dir = ConfigurationDirectory.c_str();
> >> 672       const char* tmp_dir = TemporaryDirectory.c_str();
> >> 673       slicerApp = vtkSlicerApplication::GetInstance (tmp_dir, config_dir);
> >> 674       }
> >> 675
> >> 676     slicerApp->SetRegistryLevel(0);
> >> 677     slicerApp->PromptBeforeExitOff();
> >> 678     std::cout << slicerApp->GetModulePaths() << std::endl;
> >> 679     slicerApp->SetExitStatus(0);
> >> 680     slicerApp->Exit();
> >> 681     slicerApp->Delete ();
> >> 682     exit(0);
> >> 683     }
> >>
> >> and
> >>
> >> 1985
> >> 1986   if ( EvalPython != "" )
> >> 1987     {
> >> 1988 #if defined(Slicer3_USE_PYTHON)
> >> 1989     if ( !NoModules )
> >> 1990       {
> >> 1991       std::string pythonCmd = EvalPython + "\n";
> >> 1992       v = PyRun_String( EvalPython.c_str(),
> >> 1993                         Py_file_input,
> >> 1994                         PythonDictionary,PythonDictionary);
> >> 1995       if (v == NULL)
> >> 1996         {
> >> 1997         PyErr_Print();
> >> 1998         }
> >> 1999       slicerApp->SetExitStatus(v == NULL ? EXIT_FAILURE : EXIT_SUCCESS);
> >> 2000       slicerApp->Exit();
> >> 2001       slicerApp->Delete();
> >> 2002       exit(v == NULL ? EXIT_FAILURE : EXIT_SUCCESS);
> >> 2003       }
> >> 2004 #endif
> >> 2005     }
> >>
> >> there is no difference between these. In the latter, v is really != NULL is the python code is correct, hence it should be the same code as above.
> >>
> >> But only first snippet exits Slicer correctly. There must be something between line 683 and 1985 which causes Slicer to not exit properly.
> >>
> >> Does anyone have an idea?
> >>
> >> Thanks,
> >> Daniel
> >>
> >> _______________________________________________
> >> slicer-devel mailing list
> >> [hidden email]
> >> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
> >> To unsubscribe: send email to [hidden email] with unsubscribe as the subject
> >>
> >
> > _______________________________________________
> > slicer-devel mailing list
> > [hidden email]
> > http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
> > To unsubscribe: send email to [hidden email] with unsubscribe as the subject
>
>

_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|

Re: Slicer3 does not exit correctly after --evalpython

Dominique Belhachemi
Hi Daniel,

you are right, this issue has nothing to do with "--evalpython". Your patch works.

I will create a bug report.

Thanks
Dominique


On Thu, Feb 24, 2011 at 3:56 PM, Daniel Haehn <[hidden email]> wrote:
Hi Dominique,

I don't think that this is connected to --evalpython.

Could you try: ./Slicer without any arguments on the "direct rendering: No" machine and see if you also get leaks if you just exit it?

Thanks,
Daniel

On Feb 24, 2011, at 3:53 PM, Dominique Belhachemi wrote:

> Hi Daniel,
>
> it looks a little bit better now.
>
> It works if 'direct rendering' is activated
> $ glxinfo
> direct rendering: Yes
>
> On a computer where it is deactivated I still get leaks
> $ glxinfo
> direct rendering: No
>
> $ ./Slicer3 --no_splash --evalpython "print str(1);"
> Starting Slicer: /tmp/Slicer3-build
> X Error of failed request:  GLXBadContextTag
>   Major opcode of failed request:  154 (GLX)
>   Minor opcode of failed request:  5 (X_GLXMakeCurrent)
>   Serial number of failed request:  149518
>   Current serial number in output stream:  149518
> 1
> vtkDebugLeaks has detected LEAKS!
> Class "vtkKWLoadSaveDialog" has 13 instances still around.
> [...]
>
> Thanks
> -Dominique
>
>
>
> On Wed, Feb 23, 2011 at 3:21 PM, Daniel Haehn <[hidden email]> wrote:
> Hi,
>
> ok - should be fixed in latest trunk.
>
> Thanks,
> Daniel
>
> On Feb 23, 2011, at 3:02 PM, Daniel Haehn wrote:
>
> > Hi Dominique,
> >
> > I just investigated a little bit further and I think the "Shutdown"-sequence starting from line 2213 in Applications/GUI/Slicer3.cxx should be executed after using --evalpython aswell.
> >
> > I will give it a shot if nobody has other ideas.
> >
> > Daniel
> >
> > On Feb 23, 2011, at 2:58 PM, Dominique Belhachemi wrote:
> >
> >> Hi Daniel,
> >>
> >> I can reproduce this behavior. The command
> >>
> >>     ./Slicer3 --no_splash --evalpython "print str(1);"
> >>
> >> produces a lot of leaks. Does anybody have an idea how to solve this issue?
> >>
> >> Cheers
> >> Dominique
> >>
> >>
> >>
> >> On Thu, Feb 17, 2011 at 3:58 PM, Daniel Haehn <[hidden email]> wrote:
> >> Hi devels,
> >>
> >> when using Slicer3 trunk or a compiled release with --evalpython, Slicer3 does not exit correctly after running python code. (Tested on Snow Leopard and Linux).
> >>
> >> 13:46:50 daniel@sbia-pc66:~/SLICER/TRUNK/Slicer3-build$ ./Slicer3 --evalpython "print str(1);"
> >> Setting up launch environment...
> >> Starting Slicer: /Users/daniel/SLICER/TRUNK/Slicer3-build
> >> 1
> >> vtkDebugLeaks has detected LEAKS!
> >> Class "vtkKWLoadSaveDialog" has 26 instances still around.
> >> Class "vtkMRMLFiducialListNode" has 2 instances still around.
> >> Class "vtkMRMLColorTableStorageNode" has 24 instances still around.
> >> ...
> >> and then hangs until CTRL+C
> >>
> >> In a release build, the CTRL+C is also needed to exit Slicer.
> >>
> >> I don't think it's a problem with the launcher, since --evalpython just gets passed through to Slicer3-real.
> >>
> >> When looking at two snippets from Slicer3.cxx:
> >>
> >> 652   if (PrintModulePaths)
> >> 653     {
> >> 654
> >> 655     vtkObject::GlobalWarningDisplayOff();
> >> 656
> >> 657     vtkSlicerApplication *slicerApp = 0;
> >> 658
> >> 659     if ( ConfigurationDirectory == "" && TemporaryDirectory == "" )
> >> 660       {
> >> 661       // first call to GetInstance will create the Application
> >> 662       //
> >> 663       // make a substitute tcl proc for the 'exit' built in that
> >> 664       // goes through the vtkKWApplication methodology for exiting
> >> 665       // cleanly
> >> 666       //
> >> 667       slicerApp = vtkSlicerApplication::GetInstance ( );
> >> 668       }
> >> 669     else
> >> 670       {
> >> 671       const char* config_dir = ConfigurationDirectory.c_str();
> >> 672       const char* tmp_dir = TemporaryDirectory.c_str();
> >> 673       slicerApp = vtkSlicerApplication::GetInstance (tmp_dir, config_dir);
> >> 674       }
> >> 675
> >> 676     slicerApp->SetRegistryLevel(0);
> >> 677     slicerApp->PromptBeforeExitOff();
> >> 678     std::cout << slicerApp->GetModulePaths() << std::endl;
> >> 679     slicerApp->SetExitStatus(0);
> >> 680     slicerApp->Exit();
> >> 681     slicerApp->Delete ();
> >> 682     exit(0);
> >> 683     }
> >>
> >> and
> >>
> >> 1985
> >> 1986   if ( EvalPython != "" )
> >> 1987     {
> >> 1988 #if defined(Slicer3_USE_PYTHON)
> >> 1989     if ( !NoModules )
> >> 1990       {
> >> 1991       std::string pythonCmd = EvalPython + "\n";
> >> 1992       v = PyRun_String( EvalPython.c_str(),
> >> 1993                         Py_file_input,
> >> 1994                         PythonDictionary,PythonDictionary);
> >> 1995       if (v == NULL)
> >> 1996         {
> >> 1997         PyErr_Print();
> >> 1998         }
> >> 1999       slicerApp->SetExitStatus(v == NULL ? EXIT_FAILURE : EXIT_SUCCESS);
> >> 2000       slicerApp->Exit();
> >> 2001       slicerApp->Delete();
> >> 2002       exit(v == NULL ? EXIT_FAILURE : EXIT_SUCCESS);
> >> 2003       }
> >> 2004 #endif
> >> 2005     }
> >>
> >> there is no difference between these. In the latter, v is really != NULL is the python code is correct, hence it should be the same code as above.
> >>
> >> But only first snippet exits Slicer correctly. There must be something between line 683 and 1985 which causes Slicer to not exit properly.
> >>
> >> Does anyone have an idea?
> >>
> >> Thanks,
> >> Daniel
> >>
> >> _______________________________________________
> >> slicer-devel mailing list
> >> [hidden email]
> >> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
> >> To unsubscribe: send email to [hidden email] with unsubscribe as the subject
> >>
> >
> > _______________________________________________
> > slicer-devel mailing list
> > [hidden email]
> > http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
> > To unsubscribe: send email to [hidden email] with unsubscribe as the subject
>
>



_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|

Re: Slicer3 does not exit correctly after --evalpython

pieper
Administrator
Hi Dominique -

I'm able to run slicer on a machine without direct rendering (in a
ubuntu instance running in virtualbox).

So I think there's probably something else wrong with the X config on
your machine.  Does glxgears work on it?

-Steve

On 02/24/2011 04:07 PM, Dominique Belhachemi wrote:

> Hi Daniel,
>
> you are right, this issue has nothing to do with "--evalpython". Your
> patch works.
>
> I will create a bug report.
>
> Thanks
> Dominique
>
>
> On Thu, Feb 24, 2011 at 3:56 PM, Daniel Haehn <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Hi Dominique,
>
>     I don't think that this is connected to --evalpython.
>
>     Could you try: ./Slicer without any arguments on the "direct
>     rendering: No" machine and see if you also get leaks if you just
>     exit it?
>
>     Thanks,
>     Daniel
>
>     On Feb 24, 2011, at 3:53 PM, Dominique Belhachemi wrote:
>
>      > Hi Daniel,
>      >
>      > it looks a little bit better now.
>      >
>      > It works if 'direct rendering' is activated
>      > $ glxinfo
>      > direct rendering: Yes
>      >
>      > On a computer where it is deactivated I still get leaks
>      > $ glxinfo
>      > direct rendering: No
>      >
>      > $ ./Slicer3 --no_splash --evalpython "print str(1);"
>      > Starting Slicer: /tmp/Slicer3-build
>      > X Error of failed request:  GLXBadContextTag
>      >   Major opcode of failed request:  154 (GLX)
>      >   Minor opcode of failed request:  5 (X_GLXMakeCurrent)
>      >   Serial number of failed request:  149518
>      >   Current serial number in output stream:  149518
>      > 1
>      > vtkDebugLeaks has detected LEAKS!
>      > Class "vtkKWLoadSaveDialog" has 13 instances still around.
>      > [...]
>      >
>      > Thanks
>      > -Dominique
>      >
>      >
>      >
>      > On Wed, Feb 23, 2011 at 3:21 PM, Daniel Haehn
>     <[hidden email] <mailto:[hidden email]>> wrote:
>      > Hi,
>      >
>      > ok - should be fixed in latest trunk.
>      >
>      > Thanks,
>      > Daniel
>      >
>      > On Feb 23, 2011, at 3:02 PM, Daniel Haehn wrote:
>      >
>      > > Hi Dominique,
>      > >
>      > > I just investigated a little bit further and I think the
>     "Shutdown"-sequence starting from line 2213 in
>     Applications/GUI/Slicer3.cxx should be executed after using
>     --evalpython aswell.
>      > >
>      > > I will give it a shot if nobody has other ideas.
>      > >
>      > > Daniel
>      > >
>      > > On Feb 23, 2011, at 2:58 PM, Dominique Belhachemi wrote:
>      > >
>      > >> Hi Daniel,
>      > >>
>      > >> I can reproduce this behavior. The command
>      > >>
>      > >>     ./Slicer3 --no_splash --evalpython "print str(1);"
>      > >>
>      > >> produces a lot of leaks. Does anybody have an idea how to
>     solve this issue?
>      > >>
>      > >> Cheers
>      > >> Dominique
>      > >>
>      > >>
>      > >>
>      > >> On Thu, Feb 17, 2011 at 3:58 PM, Daniel Haehn
>     <[hidden email] <mailto:[hidden email]>> wrote:
>      > >> Hi devels,
>      > >>
>      > >> when using Slicer3 trunk or a compiled release with
>     --evalpython, Slicer3 does not exit correctly after running python
>     code. (Tested on Snow Leopard and Linux).
>      > >>
>      > >> 13:46:50 daniel@sbia-pc66:~/SLICER/TRUNK/Slicer3-build$
>     ./Slicer3 --evalpython "print str(1);"
>      > >> Setting up launch environment...
>      > >> Starting Slicer: /Users/daniel/SLICER/TRUNK/Slicer3-build
>      > >> 1
>      > >> vtkDebugLeaks has detected LEAKS!
>      > >> Class "vtkKWLoadSaveDialog" has 26 instances still around.
>      > >> Class "vtkMRMLFiducialListNode" has 2 instances still around.
>      > >> Class "vtkMRMLColorTableStorageNode" has 24 instances still
>     around.
>      > >> ...
>      > >> and then hangs until CTRL+C
>      > >>
>      > >> In a release build, the CTRL+C is also needed to exit Slicer.
>      > >>
>      > >> I don't think it's a problem with the launcher, since
>     --evalpython just gets passed through to Slicer3-real.
>      > >>
>      > >> When looking at two snippets from Slicer3.cxx:
>      > >>
>      > >> 652   if (PrintModulePaths)
>      > >> 653     {
>      > >> 654
>      > >> 655     vtkObject::GlobalWarningDisplayOff();
>      > >> 656
>      > >> 657     vtkSlicerApplication *slicerApp = 0;
>      > >> 658
>      > >> 659     if ( ConfigurationDirectory == "" &&
>     TemporaryDirectory == "" )
>      > >> 660       {
>      > >> 661       // first call to GetInstance will create the Application
>      > >> 662       //
>      > >> 663       // make a substitute tcl proc for the 'exit' built
>     in that
>      > >> 664       // goes through the vtkKWApplication methodology for
>     exiting
>      > >> 665       // cleanly
>      > >> 666       //
>      > >> 667       slicerApp = vtkSlicerApplication::GetInstance ( );
>      > >> 668       }
>      > >> 669     else
>      > >> 670       {
>      > >> 671       const char* config_dir = ConfigurationDirectory.c_str();
>      > >> 672       const char* tmp_dir = TemporaryDirectory.c_str();
>      > >> 673       slicerApp = vtkSlicerApplication::GetInstance
>     (tmp_dir, config_dir);
>      > >> 674       }
>      > >> 675
>      > >> 676     slicerApp->SetRegistryLevel(0);
>      > >> 677     slicerApp->PromptBeforeExitOff();
>      > >> 678     std::cout << slicerApp->GetModulePaths() << std::endl;
>      > >> 679     slicerApp->SetExitStatus(0);
>      > >> 680     slicerApp->Exit();
>      > >> 681     slicerApp->Delete ();
>      > >> 682     exit(0);
>      > >> 683     }
>      > >>
>      > >> and
>      > >>
>      > >> 1985
>      > >> 1986   if ( EvalPython != "" )
>      > >> 1987     {
>      > >> 1988 #if defined(Slicer3_USE_PYTHON)
>      > >> 1989     if ( !NoModules )
>      > >> 1990       {
>      > >> 1991       std::string pythonCmd = EvalPython + "\n";
>      > >> 1992       v = PyRun_String( EvalPython.c_str(),
>      > >> 1993                         Py_file_input,
>      > >> 1994                         PythonDictionary,PythonDictionary);
>      > >> 1995       if (v == NULL)
>      > >> 1996         {
>      > >> 1997         PyErr_Print();
>      > >> 1998         }
>      > >> 1999       slicerApp->SetExitStatus(v == NULL ? EXIT_FAILURE :
>     EXIT_SUCCESS);
>      > >> 2000       slicerApp->Exit();
>      > >> 2001       slicerApp->Delete();
>      > >> 2002       exit(v == NULL ? EXIT_FAILURE : EXIT_SUCCESS);
>      > >> 2003       }
>      > >> 2004 #endif
>      > >> 2005     }
>      > >>
>      > >> there is no difference between these. In the latter, v is
>     really != NULL is the python code is correct, hence it should be the
>     same code as above.
>      > >>
>      > >> But only first snippet exits Slicer correctly. There must be
>     something between line 683 and 1985 which causes Slicer to not exit
>     properly.
>      > >>
>      > >> Does anyone have an idea?
>      > >>
>      > >> Thanks,
>      > >> Daniel
>      > >>
>      > >> _______________________________________________
>      > >> slicer-devel mailing list
>      > >> [hidden email] <mailto:[hidden email]>
>      > >> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
>      > >> To unsubscribe: send email to
>     [hidden email]
>     <mailto:[hidden email]> with
>     unsubscribe as the subject
>      > >>
>      > >
>      > > _______________________________________________
>      > > slicer-devel mailing list
>      > > [hidden email] <mailto:[hidden email]>
>      > > http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
>      > > To unsubscribe: send email to
>     [hidden email]
>     <mailto:[hidden email]> with
>     unsubscribe as the subject
>      >
>      >
>
>
>
>
> _______________________________________________
> slicer-devel mailing list
> [hidden email]
> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
> To unsubscribe: send email to [hidden email] with unsubscribe as the subject
_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject
Reply | Threaded
Open this post in threaded view
|

Re: Slicer3 does not exit correctly after --evalpython

Dominique Belhachemi
Hi Steve,

I have this problem on a cluster node. I am using 'ssh -X' to connect to this machine without direct rendering.
Because it is possible to run glxgears, xclock and paraview I thought it is a Slicer problem. I will try to debug this.

Thanks
Dominique




On Thu, Feb 24, 2011 at 4:22 PM, Steve Pieper <[hidden email]> wrote:
Hi Dominique -

I'm able to run slicer on a machine without direct rendering (in a ubuntu instance running in virtualbox).

So I think there's probably something else wrong with the X config on your machine.  Does glxgears work on it?

-Steve


On 02/24/2011 04:07 PM, Dominique Belhachemi wrote:
Hi Daniel,

you are right, this issue has nothing to do with "--evalpython". Your
patch works.

I will create a bug report.

Thanks
Dominique


On Thu, Feb 24, 2011 at 3:56 PM, Daniel Haehn <[hidden email]
<mailto:[hidden email]>> wrote:

   Hi Dominique,

   I don't think that this is connected to --evalpython.

   Could you try: ./Slicer without any arguments on the "direct
   rendering: No" machine and see if you also get leaks if you just
   exit it?

   Thanks,
   Daniel

   On Feb 24, 2011, at 3:53 PM, Dominique Belhachemi wrote:

    > Hi Daniel,
    >
    > it looks a little bit better now.
    >
    > It works if 'direct rendering' is activated
    > $ glxinfo
    > direct rendering: Yes
    >
    > On a computer where it is deactivated I still get leaks
    > $ glxinfo
    > direct rendering: No
    >
    > $ ./Slicer3 --no_splash --evalpython "print str(1);"
    > Starting Slicer: /tmp/Slicer3-build
    > X Error of failed request:  GLXBadContextTag
    >   Major opcode of failed request:  154 (GLX)
    >   Minor opcode of failed request:  5 (X_GLXMakeCurrent)
    >   Serial number of failed request:  149518
    >   Current serial number in output stream:  149518
    > 1
    > vtkDebugLeaks has detected LEAKS!
    > Class "vtkKWLoadSaveDialog" has 13 instances still around.
    > [...]
    >
    > Thanks
    > -Dominique
    >
    >
    >
    > On Wed, Feb 23, 2011 at 3:21 PM, Daniel Haehn
   <[hidden email] <mailto:[hidden email]>> wrote:
    > Hi,
    >
    > ok - should be fixed in latest trunk.
    >
    > Thanks,
    > Daniel
    >
    > On Feb 23, 2011, at 3:02 PM, Daniel Haehn wrote:
    >
    > > Hi Dominique,
    > >
    > > I just investigated a little bit further and I think the
   "Shutdown"-sequence starting from line 2213 in
   Applications/GUI/Slicer3.cxx should be executed after using
   --evalpython aswell.
    > >
    > > I will give it a shot if nobody has other ideas.
    > >
    > > Daniel
    > >
    > > On Feb 23, 2011, at 2:58 PM, Dominique Belhachemi wrote:
    > >
    > >> Hi Daniel,
    > >>
    > >> I can reproduce this behavior. The command
    > >>
    > >>     ./Slicer3 --no_splash --evalpython "print str(1);"
    > >>
    > >> produces a lot of leaks. Does anybody have an idea how to
   solve this issue?
    > >>
    > >> Cheers
    > >> Dominique
    > >>
    > >>
    > >>
    > >> On Thu, Feb 17, 2011 at 3:58 PM, Daniel Haehn
   <[hidden email] <mailto:[hidden email]>> wrote:
    > >> Hi devels,
    > >>
    > >> when using Slicer3 trunk or a compiled release with
   --evalpython, Slicer3 does not exit correctly after running python
   code. (Tested on Snow Leopard and Linux).
    > >>
    > >> 13:46:50 daniel@sbia-pc66:~/SLICER/TRUNK/Slicer3-build$
   ./Slicer3 --evalpython "print str(1);"
    > >> Setting up launch environment...
    > >> Starting Slicer: /Users/daniel/SLICER/TRUNK/Slicer3-build
    > >> 1
    > >> vtkDebugLeaks has detected LEAKS!
    > >> Class "vtkKWLoadSaveDialog" has 26 instances still around.
    > >> Class "vtkMRMLFiducialListNode" has 2 instances still around.
    > >> Class "vtkMRMLColorTableStorageNode" has 24 instances still
   around.
    > >> ...
    > >> and then hangs until CTRL+C
    > >>
    > >> In a release build, the CTRL+C is also needed to exit Slicer.
    > >>
    > >> I don't think it's a problem with the launcher, since
   --evalpython just gets passed through to Slicer3-real.
    > >>
    > >> When looking at two snippets from Slicer3.cxx:
    > >>
    > >> 652   if (PrintModulePaths)
    > >> 653     {
    > >> 654
    > >> 655     vtkObject::GlobalWarningDisplayOff();
    > >> 656
    > >> 657     vtkSlicerApplication *slicerApp = 0;
    > >> 658
    > >> 659     if ( ConfigurationDirectory == "" &&
   TemporaryDirectory == "" )
    > >> 660       {
    > >> 661       // first call to GetInstance will create the Application
    > >> 662       //
    > >> 663       // make a substitute tcl proc for the 'exit' built
   in that
    > >> 664       // goes through the vtkKWApplication methodology for
   exiting
    > >> 665       // cleanly
    > >> 666       //
    > >> 667       slicerApp = vtkSlicerApplication::GetInstance ( );
    > >> 668       }
    > >> 669     else
    > >> 670       {
    > >> 671       const char* config_dir = ConfigurationDirectory.c_str();
    > >> 672       const char* tmp_dir = TemporaryDirectory.c_str();
    > >> 673       slicerApp = vtkSlicerApplication::GetInstance
   (tmp_dir, config_dir);
    > >> 674       }
    > >> 675
    > >> 676     slicerApp->SetRegistryLevel(0);
    > >> 677     slicerApp->PromptBeforeExitOff();
    > >> 678     std::cout << slicerApp->GetModulePaths() << std::endl;
    > >> 679     slicerApp->SetExitStatus(0);
    > >> 680     slicerApp->Exit();
    > >> 681     slicerApp->Delete ();
    > >> 682     exit(0);
    > >> 683     }
    > >>
    > >> and
    > >>
    > >> 1985
    > >> 1986   if ( EvalPython != "" )
    > >> 1987     {
    > >> 1988 #if defined(Slicer3_USE_PYTHON)
    > >> 1989     if ( !NoModules )
    > >> 1990       {
    > >> 1991       std::string pythonCmd = EvalPython + "\n";
    > >> 1992       v = PyRun_String( EvalPython.c_str(),
    > >> 1993                         Py_file_input,
    > >> 1994                         PythonDictionary,PythonDictionary);
    > >> 1995       if (v == NULL)
    > >> 1996         {
    > >> 1997         PyErr_Print();
    > >> 1998         }
    > >> 1999       slicerApp->SetExitStatus(v == NULL ? EXIT_FAILURE :
   EXIT_SUCCESS);
    > >> 2000       slicerApp->Exit();
    > >> 2001       slicerApp->Delete();
    > >> 2002       exit(v == NULL ? EXIT_FAILURE : EXIT_SUCCESS);
    > >> 2003       }
    > >> 2004 #endif
    > >> 2005     }
    > >>
    > >> there is no difference between these. In the latter, v is
   really != NULL is the python code is correct, hence it should be the
   same code as above.
    > >>
    > >> But only first snippet exits Slicer correctly. There must be
   something between line 683 and 1985 which causes Slicer to not exit
   properly.
    > >>
    > >> Does anyone have an idea?
    > >>
    > >> Thanks,
    > >> Daniel
    > >>
    > >> _______________________________________________
    > >> slicer-devel mailing list
    > >> [hidden email] <mailto:[hidden email]>

    > >> http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
    > >> To unsubscribe: send email to
   [hidden email]
   <mailto:[hidden email]> with

   unsubscribe as the subject
    > >>
    > >
    > > _______________________________________________
    > > slicer-devel mailing list
    > > [hidden email] <mailto:[hidden email]>

    > > http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
    > > To unsubscribe: send email to
   [hidden email]
   <mailto:[hidden email]> with

   unsubscribe as the subject
    >
    >




_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject


_______________________________________________
slicer-devel mailing list
[hidden email]
http://massmail.spl.harvard.edu/mailman/listinfo/slicer-devel
To unsubscribe: send email to [hidden email] with unsubscribe as the subject