[New-bugs-announce] [issue21639] tracemalloc crashes with floating point exception when using StringIO

Claudiu.Popa report at bugs.python.org
Mon Jun 2 15:52:03 CEST 2014


New submission from Claudiu.Popa:

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!

----------
components: Library (Lib)
files: tracemalloc.patch
keywords: patch
messages: 219587
nosy: Claudiu.Popa, haypo
priority: normal
severity: normal
status: open
title: tracemalloc crashes with floating point exception when using StringIO
type: crash
versions: Python 3.5
Added file: http://bugs.python.org/file35450/tracemalloc.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21639>
_______________________________________


More information about the New-bugs-announce mailing list