Strange threads/stack size interaction on FreeBSD

Stefan Schwarzer Stefan.Schwarzer at tu-clausthal.de
Wed Sep 4 15:10:13 EDT 2002


OS: FreeBSD 4.6.2
Python: 2.2.1 (built from the ports collection)
Hardware: Dual Processor Athlon, 1 GB RAM

I compiled Python while having a default stack size (as shown by ulimit -a)
of 262144 kbytes.

Because of a problem with a Python program (that dumped core, but that's
another problem) I recompiled the kernel with a stack size of 524288 kbytes.
After rebooting the program mentioned succeeded without errors.

A while later I noticed that a unit test case dealing with threads no longer
worked; it hung. Checking with /usr/local/lib/python2.2/test/test_threading.py
I observed that it hung, too, after only printing "waiting for all tasks to
complete".

After rebooting the system with the old kernel with the old stack size, I
saw both my own unit test and test_threading.py succeed! I also tried
compiling Python for the larger stack size but that didn't help either.

It seems, that there is some interaction between the set stack size and
Python's threading code.

I've searched the Python FAQ, Google Groups and the bug database of the
Python project on this, but without success, so I have some questions.

- Has anybody here experienced something similar, perhaps on other
   platforms?

- Is Python's threading code dependent on a stack limit set at compiled
   time (seems so)?

- What are your recommendations to deal with the problem?

- Should I enter a bug report on this topic?

Stefan




More information about the Python-list mailing list