bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Python test suite, test_openpty in endless loop


From: Michael Banck
Subject: Python test suite, test_openpty in endless loop
Date: Thu, 5 May 2005 15:53:34 +0200
User-agent: Mutt/1.5.6+20040907i

Hi,

Neal's latest pthread checkin fixed one issue in the python test suite.
However, as the test suite now runs further, it exposed another problem
which makes the machine hang in an endless loop (and not just abort the
test suite, as before), namely in test_openpty.

This test is pretty simple:

import os
from test.test_support import verbose, TestFailed, TestSkipped

try:
    if verbose:
        print "Calling os.openpty()"
    master, slave = os.openpty()

at which point it hangs and writes out:
/hurd/term: /dev/ttyp0: Device or Resource Busy

to the terminal endlessly until interrupted (interrupting it from the
same terminal via ^C eventually results in similar messages with ttyp1
until ttyp3 for some time and then a KeyboardInterrupt abort from
Python).

os.openpty is pretty simple as well, it basically wraps around
openpty() (I have stripped away unecessary preprocessor directives as
HAVE_OPENPTY is defined for us):

static PyObject *
posix_openpty(PyObject *self, PyObject *noargs)
{
        int master_fd, slave_fd;
        if (openpty(&master_fd, &slave_fd, NULL, NULL, NULL) != 0)
                return posix_error();
        return Py_BuildValue("(ii)", master_fd, slave_fd);
}

If I run the test in gdb and abort it, I get this backtrace:

#0  0x011b18d2 in _hurd_intr_rpc_msg_in_trap () at intr-msg.c:133
#1  0x01332f0a in __dir_lookup (start_dir=1073741828,
    file_name=0x40000004 <Address 0x40000004 out of bounds>,
    flags=1073741828, mode=1073741828, do_retry=0x1341808,
    retry_name=0x40000004 <Address 0x40000004 out of bounds>,
    result=0x40000004)
    at
/org/buildd/tmp/tmp/glibc-2.3.2.ds1/build-tree/hurd-i386-libc/hurd/RPC_dir_lookup.c:187
#2  0x0119ffb7 in lookup_op.0 () from /usr/lib/debug/libc.so.0.3
#3  0x01199c2a in _hurd_ports_use (which=23064456, operate=0x15ff4fc)
    at hurdinit.c:49
#4  0x011a00b6 in __hurd_file_name_lookup (
    use_init_port=0x1199aa0 <_hurd_ports_use>,
get_dtable_port=0x40000004,
    lookup=0x1332e40 <__dir_lookup>, file_name=0x15ff985 "dev/ptyp0",
    flags=3, mode=0, result=0x15ff940) at hurdlookup.c:94
#5  0x011a04cd in __file_name_lookup (
    file_name=0x40000004 <Address 0x40000004 out of bounds>,
    flags=1073741828, mode=20191240) at hurdlookup.c:235
#6  0x0128424e in __libc_open (
    file=0x40000004 <Address 0x40000004 out of bounds>, oflag=3)
    at ../sysdeps/mach/hurd/open.c:43
#7  0x012d9b07 in __getpt () at ../sysdeps/unix/bsd/getpt.c:65
#8  0x01158524 in openpty (amaster=0x40000004, aslave=0x40000004,
name=0x0,
    termp=0x0, winp=0x0) at openpty.c:98
#9  0x010ecb18 in initposix () from /usr/lib/libpython2.4.so.1.0
#10 0x010acf8d in PyEval_GetFuncDesc () from
/usr/lib/libpython2.4.so.1.0
#11 0x010aae49 in PyEval_EvalFrame () from /usr/lib/libpython2.4.so.1.0
#12 0x010ab92e in PyEval_EvalCodeEx () from /usr/lib/libpython2.4.so.1.0
#13 0x010a8bb7 in PyEval_EvalCode () from /usr/lib/libpython2.4.so.1.0
#14 0x010df4d9 in PyRun_FileExFlags () from /usr/lib/libpython2.4.so.1.0
#15 0x010de8e4 in PyRun_SimpleFileExFlags () from
/usr/lib/libpython2.4.so.1.0#16 0x010de29a in PyRun_AnyFileExFlags ()
from /usr/lib/libpython2.4.so.1.0
#17 0x010e6eb6 in Py_Main () from /usr/lib/libpython2.4.so.1.0
#18 0x08048679 in main (argc=1073741828, argv=0x40000004)
    at ../Modules/python.c:23

On the other hand, a trivial C program using openpty() works fine, so it
might be some Python->C or Python->POSIX issue.

Can anybody look into this, perhaps?  I have no experience with ptys
or Python<->C stuff and am stuck here it seems.


thanks,

Michael




reply via email to

[Prev in Thread] Current Thread [Next in Thread]