New submission from Doug O'Riordan <orior...@biztosan.hu>:

Ran into Segfaults while trying to use pysnmp with 3.8.0rc1.
The code is running fine on 3.8.0b04.

$ python3.8
Python 3.8.0rc1 (default, Oct  2 2019, 14:15:18)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ctypes
>>> class in6_addr_U(ctypes.Union):
...     _fields_ = [
...         ('__u6_addr8', ctypes.c_uint8 * 16),
...         ('__u6_addr16', ctypes.c_uint16 * 8),
...         ('__u6_addr32', ctypes.c_uint32 * 4),
...     ]
...
Segmentation fault

$ docker run -it python:3.8.0rc1-slim
Python 3.8.0rc1 (default, Oct  2 2019, 23:38:42)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ctypes
>>> class in6_addr_U(ctypes.Union):
...     _fields_ = [
...         ('__u6_addr8', ctypes.c_uint8 * 16),
...         ('__u6_addr16', ctypes.c_uint16 * 8),
...         ('__u6_addr32', ctypes.c_uint32 * 4),
...     ]
...
$

The code is from here: 
https://github.com/etingof/pysnmp/blob/master/pysnmp/carrier/sockmsg.py#L47-L52

----------
components: ctypes
messages: 353906
nosy: oriordan
priority: normal
severity: normal
status: open
title: Crash when subclassing ctypes.Union
type: crash
versions: Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue38368>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to