From owner-freebsd-bugs Sat Jan 30 07:14:17 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id HAA02164 for freebsd-bugs-outgoing; Sat, 30 Jan 1999 07:14:17 -0800 (PST) (envelope-from owner-freebsd-bugs@FreeBSD.ORG) Received: from acer.spvi.com (acer.spvi.com [208.150.70.194]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id HAA02145; Sat, 30 Jan 1999 07:14:13 -0800 (PST) (envelope-from steve@acer.spvi.com) Received: (from steve@localhost) by acer.spvi.com (8.8.8/8.8.8) id KAA05625; Sat, 30 Jan 1999 10:14:11 -0500 (EST) (envelope-from steve) Date: Sat, 30 Jan 1999 10:14:11 -0500 (EST) Message-Id: <199901301514.KAA05625@acer.spvi.com> From: Steve Spicklemire To: freebsd-hackers@FreeBSD.ORG, freebsd-bugs@FreeBSD.ORG CC: steve@acer.spvi.com Subject: Problem with libc_r ?? Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hello FreeBSD Developers, I've got a problem with threads on FreeBSD-2.2.8-STABLE. I run python a lot on a variety of different hardware/OS combinations. Over the holidays I cvsup'd 2.2.8 and tested it on one machine. Everything seemed OK.. so I upgraded two others. (I still have one system running 2.2.7.) I then noticed that some cron jobs were not finishing. I've narrowed it down to two, somehow related symptoms. All of the scripts are run on the Python interpreter (python 1.5.1 or 1.5.2b1 show same results). Any workarounds would be appreciated. For now I have built a thread-disabled interpreter for cron stuff, and thread-enabled for everything else. So long as I don't explicitly need threads in my cron jobs.. this will work. This is just the sort of thing that is a pain in the neck to maintain though. ;-) Here are the clues: 1) If threading is enabled the problem occurs. If threading is disabled the problem does not occur. I'm guessing that this means that it lies in the threaded runtime system, but I don't know the details of all that well enough to speak intelligently about it ( note that I speak about it anyway. ;-> ) 2) If more than one call is made to 'system' or 'popen' the second call hangs. The first call seems to execute properly. All of these scripts work fine, thread-enabled or not, from the command line. And none of this occurs with 2.2.7. Below I've cooked up a simple test: crontab: ---------------------------------------------------------------------- * * * * * /usr/local/bin/python /home/steve/it.py >> /home/steve/it.log 2>&1 & it.py: ---------------------------------------------------------------------- import os os.system('touch /home/steve/one.txt') os.system('touch /home/steve/two.txt') ---------------------------------------------------------------------- When the job runs I get a 'one.txt', but no 'two.txt' in my home directory. It's especially important to notice that I'm not explicitly using threads in this script. Also, the python thread module itself passes its diagnostic test when run from the command line or from cron. The process left hanging is always stuck in: # gdb /usr/local/bin/python 5578 GDB is free software and you are welcome to distribute copies of it under certain conditions; type "show copying" to see the conditions. There is absolutely no warranty for GDB; type "show warranty" for details. GDB 4.16 (i386-unknown-freebsd), Copyright 1996 Free Software Foundation, Inc... /usr/home/steve/5578: No such file or directory. Attaching to program `/usr/local/bin/python', process 5578 Reading symbols from /usr/libexec/ld.so...done. Reading symbols from /usr/lib/libc_r.so.3.0...done. Reading symbols from /usr/lib/libm.so.2.0...done. Reading symbols from /usr/lib/libc.so.3.1...done. 0x2008f741 in _thread_sys_select () (gdb) It's not just a question of jobs being in the background... I tried: python it.py & and it worked fine... it's something about cron that doesn't work with threads and multiple subprocesses. What can I do to further track this down? thanks, -steve To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message