Signal 10?

Andrew MacIntyre andymac at bullseye.apana.org.au
Thu Jan 29 16:16:17 PST 2004


On Thu, 29 Jan 2004, Tony Holmes wrote:

> > The pthreads implementation on 4.x (-lc_r) will also provoke a bus error
> > if the primary thread's stack (which is hard coded at 1MB) is exhausted.
>
> I'm getting sig 10 from python only and it is linked with pthreads.... this
> could explain it. It's a 4.9-Release box.

Python version & gcc version?  Using regexps?

Some special handling for pthreads linkage on FreeBSD was added to Python
2.3.3 (maybe 2.3.2 as well) to limit the recursiion depth of the SRE
regexp engine due to this problem.

If this is the problem, the limit was determined based on the behaviour of
Python's regression test suite, but your app's stack usage may be more
stack hungry than the test suite resulting in the sig10s.

Recent releases of gcc at higher optimisation levels (eg -O3) use
considerably larger stack frames than 2.95, which makes the -lc_r limit
more restrictive.  I've just recently started to see similar reports from
people in the Python Linux community.

This doesn't affect Python from CVS, as SRE is no longer a recursive
engine.

If you wish to rebuild Python with a smaller SRE recursion limit,
adjust the USE_RECURSION_LIMIT macro at the top of Modules/_sre.c in the
Python source tree (somewhere around line 80, depending on Python
version).

--
Andrew I MacIntyre                     "These thoughts are mine alone..."
E-mail: andymac at bullseye.apana.org.au  (pref) | Snail: PO Box 370
        andymac at pcug.org.au             (alt) |        Belconnen  ACT  2616
Web:    http://www.andymac.org/               |        Australia


More information about the freebsd-hardware mailing list