Charles-Francois Natali <neolo...@free.fr> added the comment:

> It looks a bit strange for this bug to happen, though. Does Ubuntu use a 
> small stack size?

There are other possible reasons:
- the programs that crash (or the libraries they're using) use the stack a lot
- somehow, pthread_attr_setstacksize is called and set to a reduced thread 
stack size
- notice that this is reported on x86_64 architectures, and stack usage is 
increased on 64 bits

Since I don't have an Ubuntu box, it would be nice if one of the reporters 
could:
- return the result of "ulimit -s" on their box
- call "ulimit -s unlimited", and see if the bug goes away
- check that the attached patch marshal_stack.diff solves this
- return the result of "ltrace -e pthread_attr_setstacksize <command used to 
start program>"

> A small benchmark shows no difference in startup time when disabling the 
> stack buffer. (this is on Linux: of course, the problem might be that the 
> glibc is heavily optimized)

Yeap, there as some crappy systems out there (no name :-), that's why it would 
be nice to have some feedback and small benchmarks on various platforms. 
Anyway, even if compiled files are small most of the time, I'm not sure that 
this "let's copy the file to the stack/heap" approcah is optimal, and maybe 
mmap would be worth considering if we find that the overhead is not negligible 
(I haven't looked at the code in detail, so maybe it's not possible to use in 
this case).

----------
keywords: +patch
Added file: http://bugs.python.org/file16960/marshal_stack.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7332>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to