[pypy-dev] "import signal" fails when running PyPy interpreted
Stefan Behnel
stefan_ml at behnel.de
Sun Mar 11 20:15:39 CET 2012
Armin Rigo, 11.03.2012 19:40:
> Care to explain what you are really trying to do?
I'm trying to debug the set of crash bugs that Cython's test suite finds in
cpyext. I was surprised enough to find out that the nightly builds don't
have debugging symbols enabled, and Amaury suggested to run PyPy in
interpreted mode for debugging. So I tried and it didn't turn out to be an
option.
> We never actually
> *use* py.py --- the fact that its options' defaults don't include any
> modules should be a hint --- apart for demos and "just because you
> can".
You should put up a "beginners guide to debugging bugs in PyPy" somewhere.
> If you manage to isolate a failing test, then it can be written in a
> particular way so that you get essentially py.py running only the
> failing 5 lines.
I'd be happy with having all of cpyext run in "debug mode" already. Our
test runner runs in Python space to search and build the test modules. Each
test module has doctests which call into its C code. So there's usually not
much C code involved for a test and C-API interaction is thus limited. That
means that any slow-down in cpyext would be acceptable (because that's what
is being debugged), but avoiding any slow-downs in Python space would be
helpful.
Is such a setup possible?
> Additionally, with sharing the object space across
> multiple tests, we reduce the run time to a small fraction of second
> per test. Look for "class AppTestXxx" in the majority of the test
> files in interpreter/test, module/*/test, or objspace/std/test.
Can't see the magic in those from a quick look.
> It's tersely documented in pypy/doc/coding_guide.rst.
I'm not interested in details. In Cython, I'm used to source level
debugging, be it for Python, Cython or C code, although I tend to work at
the C level most of the time, because that's where most bugs are. I don't
care much about which level I get in PyPy, as long as it's reasonably fast
and jumps into a debugger when an error occurs so that I can look at what's
been going on.
Stefan
More information about the pypy-dev
mailing list