[issue20354] tracemalloc causes segfault in "make profile-opt"

STINNER Victor report at bugs.python.org
Thu Jan 23 00:18:57 CET 2014


STINNER Victor added the comment:

Oops, the original code is:
---
/* Pack the frame_t structure to reduce the memory footprint on 64-bit
   architectures: 12 bytes instead of 16. This optimization might produce
   SIGBUS on architectures not supporting unaligned memory accesses (64-bit
   IPS CPU?): on such architecture, the structure must not be packed. */
#pragma pack(4)
typedef struct
#ifdef __GNUC__
__attribute__((packed))
#endif
{
    PyObject *filename;
    int lineno;
} frame_t;
---

"#pragma pack(4)" is for Microsoft Visual Studio. For GCC, there is already the "__attribute__((packed))" line. See attached workaround tracemalloc_gcov.patch. But I would interested to understand why it does crash. It might be a GCC or gcov bug.

----------
keywords: +patch
Added file: http://bugs.python.org/file33638/tracemalloc_gcov.patch

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


More information about the Python-bugs-list mailing list