Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Jan 2004 08:54:45 +1100 (EST)
From:      Andrew MacIntyre <andymac@bullseye.apana.org.au>
To:        Tony Holmes <tony@crosswinds.net>
Cc:        freebsd-hardware@freebsd.org
Subject:   Re: Signal 10?
Message-ID:  <20040130083530.M8430@bullseye.apana.org.au>
In-Reply-To: <20040129101031.B93034@crosswinds.net>
References:  <20040128121913.A54789@crosswinds.net> <Pine.LNX.4.58.0401290857350.21584@quetzalcoatlite.e.kth.se> <20040129101031.B93034@crosswinds.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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@bullseye.apana.org.au  (pref) | Snail: PO Box 370
        andymac@pcug.org.au             (alt) |        Belconnen  ACT  2616
Web:    http://www.andymac.org/               |        Australia



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040130083530.M8430>