[Python.NET] Bug with System.Diagnostics.Process.ProcessName and tcl

Brian Lloyd brian at zope.com
Wed Mar 9 15:59:08 CET 2005


This has all the symptoms of some kind of memory error -
unfortunately the symptoms are often not directly helpful
in diagnosing the root the problem (since the memory error
occurred sometime before the random insanity started...)

I'm not up on the implementation details of tcl/tk, but its
not out of the question that it could interact badly with
objects that come from PythonNet (which has to do some arguably
evil things with object structs, etc.)

If you can narrow it down to the simplest possible case and
send me that script, I can try to help investigate...


Brian Lloyd        brian at zope.com
V.P. Engineering   540.361.1716
Zope Corporation   http://www.zope.com


> -----Original Message-----
> From: pythondotnet-bounces+brian=zope.com at python.org
> [mailto:pythondotnet-bounces+brian=zope.com at python.org]On Behalf Of
> Steffen Guhlemann
> Sent: Wednesday, March 02, 2005 1:16 PM
> To: pythondotnet at python.org
> Subject: [Python.NET] Bug with System.Diagnostics.Process.ProcessName
> and tcl
>
>
> Hi,
>
> I experienced some very strange bugs. Can someone help me?
>
> The affected Programm is mainly written in Python with a Tcl-Gui.
> Some part of
> the application logic lies in a c#-dll. Deep in this dll a
> function searches
> for a certain Process by its id:
>
> Process p=Process.GetProcessById(pid);
>
> Afterwards the function checks the name of this Process:
>
> string name=p.ProcessName;
>
> This line makes Python go crazy. At least the Tcl-Gui and the
> float-Arithmetics
> (i don't know which is a consequece of which) - we don't know what else is
> affected.
>
> The Tcl-Windows appear with minimal size (0,0) instead of the
> size they where
> meant to. Others with certain controls (e.g. a tree-Control)
> don't even appear.
> Instead Python throws the following Exception:
>
> Traceback (most recent call last):
>   File "C:\tmp\testProcesses\bin\Release\test.py", line 577, in ?
>     width=300)
>   File "C:\tmp\testProcesses\bin\Release\test.py", line 388, in __init__
>     self.move_cursor(self.root)
>   File "C:\tmp\testProcesses\bin\Release\test.py", line 474, in
> move_cursor
>     self.see(node.symbol, node.label)
>   File "C:\tmp\testProcesses\bin\Release\test.py", line 446, in see
>     while x2 > self.canvasx(0)+self.winfo_width():
>   File "C:\Python23\lib\lib-tk\Tkinter.py", line 2028, in canvasx
>     return getdouble(self.tk.call(
> ValueError: invalid literal for float(): 6.0
>
> The float arithmetic error, we found is not deterministic...if i
> edit and start
> the script in IDLE, which also starts the Tree-Control mentioned
> above, then
> somewhen it starts to go wrong with these lines:
>
> val1=0.95
> val2=1024
> val3=int(val1*val2)
> print val3
>
> If beforehand of these lines no c#-function is called that uses some
> ProcessName, the result is 972, otherwise the result could be 0.
> This is not
> deterministic, the Tcl-Problem is deterministic.
>
> Thanks
>
> Steffen
> _________________________________________________
> Python.NET mailing list - PythonDotNet at python.org
> http://mail.python.org/mailman/listinfo/pythondotnet
>



More information about the PythonDotNet mailing list