test_signal strange hang on sunos 5.8

Anders Qvist <[email protected]> Tue, 22 Oct 2002 18:00:39 +0200
Newsgroups gmane.comp.python.snake-farm.user
Message-ID <[email protected]>
Next one is a tricky beast. test_signal.py on both our sun4u solaris 8
machines hangs if run as a part of the test suite, but not if run on
its own. The top part of the stack trace is as follows:

#0  0xdf5da12c in _pause () from /usr/lib/libc.so.1
#1  0xdf4fa8bc in pause () from /usr/lib/libthread.so.1
#2  0x000792b0 in call_function (pp_stack=0xdfffded8, oparg=0)
    at ../python/dist/src/Python/ceval.c:3214
#3  0x00076fd0 in eval_frame (f=0x1a1110)
    at ../python/dist/src/Python/ceval.c:1993
#4  0x000785f0 in PyEval_EvalCodeEx (co=0x7333e0, globals=0x1a1110,
    locals=0x0, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0,
    defcount=0, closure=0x0) at ../python/dist/src/Python/ceval.c:2538
#5  0x0007b03c in PyEval_EvalCode (co=0x7333e0, globals=0x7adb70,
    locals=0x7adb70) at ../python/dist/src/Python/ceval.c:478
#6  0x00091280 in PyImport_ExecCodeModuleEx (
    name=0xdfffeab0 "test.test_signal", co=0x7333e0,
    pathname=0xdfffe5c0 "/mp/slaskdisk/tmp/quest/python/dist/src/Lib/test/test_signal.py") at ../python/dist/src/Python/import.c:530
#7  0x000917d4 in load_source_module (name=0xdfffeab0 "test.test_signal",
    pathname=0xdfffe5c0 "/mp/slaskdisk/tmp/quest/python/dist/src/Lib/test/test_signal.py", fp=0x100c00) at ../python/dist/src/Python/import.c:800
#8  0x000920dc in load_module (name=0xdfffeab0 "test.test_signal",
    fp=0x100b78,
    buf=0xdfffe5c0 "/mp/slaskdisk/tmp/quest/python/dist/src/Lib/test/test_signal.py", type=1) at ../python/dist/src/Python/import.c:1465
#9  0x00093090 in import_submodule (mod=0x19f3b0,
---Type <return> to continue, or q <return> to quit---
    subname=0xdfffeab5 "test_signal", fullname=0xdfffeab0 "test.test_signal")
    at ../python/dist/src/Python/import.c:2004
#10 0x00092b90 in load_next (mod=0x19f3b0, altmod=0x19f3b0, p_name=0xdfffeab5,
    buf=0xdfffeab0 "test.test_signal", p_buflen=0xdfffeaac)
    at ../python/dist/src/Python/import.c:1860
#11 0x00092694 in import_module_ex (name=0x0, globals=0x19f3b0,
    locals=0x544390, fromlist=0x66feb0)
    at ../python/dist/src/Python/import.c:1718
#12 0x00092898 in PyImport_ImportModuleEx (name=0x7868a4 "test.test_signal",
    globals=0x119780, locals=0x544390, fromlist=0x66feb0)
    at ../python/dist/src/Python/import.c:1752

I gather this comes from line 54 in test_signal.py:

        try:
54>         signal.pause()
            if verbose:
                print "pause() returned"
        except HandlerBCalled:
            if verbose:
                print "HandlerBCalled exception caught"
            else:
                pass

The execution (with -v) generates the following output:

  test_signal
  starting pause() loop...
  call pause()...
  + sleep 2
  + kill -5 23928
  + sleep 2
  + kill -2 23928
  + sleep 2
  + kill -3 23928

Whereas executing the test alone:

  test_signal
  starting pause() loop...
  call pause()...
  + sleep 2
  + kill -5 25192
  + sleep 2
  handlerA (5, <frame object at 0x15b6c0>)
  pause() returned
  call pause()...
  + kill -2 25192
  + sleep 2
  handlerB (2, <frame object at 0x15b6c0>)
  HandlerBCalled exception caught
  call pause()...
  + kill -3 25192
  KeyboardInterrupt (assume the alarm() went off)
  1 test OK.

-- 
Anders "Quest" Qvist

"We've all heard that a million monkeys banging on a million typewriters
will eventually reproduce the entire works of Shakespeare. Now, thanks 
to the Internet, we know this is not true." -- Robert Wilensky