[pypy-issue] [issue1563] cppyy: segfault when referencing data members on classes

Alex Stewart tracker at bugs.pypy.org
Sat Jul 27 23:14:09 CEST 2013


New submission from Alex Stewart <foogod at gmail.com>:

[Using pypy-2.0.2 (precompiled 64-bit Linux version from pypy.org, with reflex 
built from http://cern.ch/wlav/reflex-2013-04-23.tar.bz2]

Attempting to access any class data member via the class object (not an instance 
of the class) causes an invalid memory access:

  class MyClass {
  public:
      int m_myval;
  };

>>>> import cppyy
>>>> cppyy.load_reflection_info('libMyClass.so')
<CPPLibrary object at 0x00007ff69f4acbc0>
>>>> cppyy.gbl.MyClass().m_myval
0
>>>> cppyy.gbl.MyClass.m_myval
Segmentation fault (core dumped)

Obviously, accessing data members on the class itself does not make sense in 
C++, but attempting to do so should not segfault the whole interpreter 
(especially since this even happens when using things like hasattr to check for 
existence of the attribute, without even accessing it)..

----------
messages: 5994
nosy: Foogod, pypy-issue
priority: bug
release: 2.0
status: unread
title: cppyy: segfault when referencing data members on classes

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue1563>
________________________________________


More information about the pypy-issue mailing list