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 <rep...@bugs.python.org>
<http://bugs.python.org/issue21639>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to