Author Claudiu.Popa
Recipients Claudiu.Popa, vstinner
Date 2014-06-02.13:52:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1401717123.97.0.114910217041.issue21639@psf.upfronthosting.co.za>
In-reply-to
Content
Given the following code, tracemalloc crashes with:
"Floating point exception: 8 (core dumped)"

import tracemalloc
tracemalloc.start(10)
import io
io.StringIO()

The culprit is this line "assert(nelem <= PY_SIZE_MAX / elsize);" from tracemalloc_alloc. elsize is 0 from stringio.c, "self->buf = (Py_UCS4 *)PyMem_Malloc(0);".
The attached patch skips the assert if elsize is 0, but I don't know if this is the right approach.
Thanks!
History
Date User Action Args
2014-06-02 13:52:04Claudiu.Popasetrecipients: + Claudiu.Popa, vstinner
2014-06-02 13:52:03Claudiu.Popasetmessageid: <1401717123.97.0.114910217041.issue21639@psf.upfronthosting.co.za>
2014-06-02 13:52:03Claudiu.Popalinkissue21639 messages
2014-06-02 13:52:03Claudiu.Popacreate