segfault using shutil.make_archive

dieter dieter at handshake.de
Fri Oct 7 02:24:45 EDT 2016


Tim <jtim.arnold at gmail.com> writes:
> I need to zip up a directory that's about 400mb.
> I'm using shutil.make_archive and I'm getting this response:
>
>     Segmentation fault: 11 (core dumped)
>
> The code is straightforward (and works on other, smaller dirs):
>
>     shutil.make_archive(os.path.join(zip_dir, zname), 'zip', tgt_dir)
>
> I guess I could drop the convenience of make_archive and use zipfile but that seems to be exactly what make_archive does.

>From your description (above and in other messages of this thread),
I guess, that the cause is a (running out of) memory problem.

Memory allocations are frequent (in many places) and they fail rarely.
Therefore, there is quite a high probability that some of those
allocations fail to check that the allocation has been successful.
If this happens (and the allocation fails), then a "SIGSEGV" is
almost certain.


I would try to move the task on a system with a larger address space
(more RAM, more swap space, maybe a 64 bit system).
It may succeed there.





More information about the Python-list mailing list