import freeze

C

Colin Brown

I have a Pyro server thread that is not starting and I have traced the
problem through to the a point in the Pyro code where it freezes. The code
fragment (my added print statements):

print '[finalizeConfig_Server] before import random'
import random
print '[finalizeConfig_Server] after import random'

is printing the first print line but not the second. Is there any way of
dynamically turning on in-depth tracing before the import statement?
[Py2.3.2, Win2K]

Colin Brown
PyNZ
 
P

Peter Hansen

Colin said:
I have a Pyro server thread that is not starting and I have traced the
problem through to the a point in the Pyro code where it freezes. The code
fragment (my added print statements):

print '[finalizeConfig_Server] before import random'
import random
print '[finalizeConfig_Server] after import random'

is printing the first print line but not the second. Is there any way of
dynamically turning on in-depth tracing before the import statement?
[Py2.3.2, Win2K]

Not sure about tracing per se, but if you can run the server program
without detaching from the console, the following two lines of code
can be exceptionally helpful:

import pdb
pdb.set_trace()

This lets you manually single-step through the code to find the source
of the trouble (and other features, probably including some real
tracing).

-Peter
 
C

Colin Brown

Peter Hansen said:
Colin said:
I have a Pyro server thread that is not starting and I have traced the
problem through to the a point in the Pyro code where it freezes. The code
fragment (my added print statements):

print '[finalizeConfig_Server] before import random'
import random
print '[finalizeConfig_Server] after import random'

is printing the first print line but not the second. Is there any way of
dynamically turning on in-depth tracing before the import statement?
[Py2.3.2, Win2K]

Not sure about tracing per se, but if you can run the server program
without detaching from the console, the following two lines of code
can be exceptionally helpful:

import pdb
pdb.set_trace()

This lets you manually single-step through the code to find the source
of the trouble (and other features, probably including some real
tracing).

-Peter

Thanks Peter

I have never really got into pdb, it has always seemed too clunky and is
difficult to use with multithreaded code. Somehow I think my time will be
better spent working through other avenues.

The crazy thing is all I have done is copied a working Pyro application to a
different directory and put the mainline code into the package. I wish to
run
the program via "exec('from PkgName import Main')" but it is all turning to
custard! All my other socket code, Pyro clients and threads are fine but the
server code just hangs. I am so close to encapsulating all the application
code
into a zip package, it is really frustrating to have to give up now but I
haved
reached an impasse.

Colin
 
P

Peter Hansen

Colin said:
I have never really got into pdb, it has always seemed too clunky and is
difficult to use with multithreaded code. Somehow I think my time will be
better spent working through other avenues.

Your call. I don't really know much about PDB either. In fact,
all I ever do with it is hit "s" (step), "r" (return), "n" (next),
and sometimes I evaluate an expression with "!expr".

I also use it to troubleshoot problems in multithreaded code
from time to time, as I recall, never with any particular problem.
I'm surprised more people don't use it because it's really rather
trivial to fire up and step through a few lines of code. Clunky?
Maybe... but it works, and it's very very convenient.

-Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
474,171
Messages
2,570,935
Members
47,472
Latest member
KarissaBor

Latest Threads

Top