Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #73324
| Date | 2014-06-16 22:16 +0200 |
|---|---|
| From | Roland Plüss <roland@rptd.ch> |
| Subject | Re: module_traverse segfault |
| References | <539F2603.2020904@rptd.ch> <lnneut$7gd$1@ger.gmane.org> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.11095.1402949787.18130.python-list@python.org> (permalink) |
[Multipart message — attachments visible in raw view] - view raw
>> Program received signal SIGSEGV, Segmentation fault.
>> 0x00007fffffffc958 in ?? ()
>> (gdb) bt
>> #0 0x00007fffffffc958 in ?? ()
>> #1 0x00007fffdd2f9ed0 in module_traverse () from
>> /usr/lib64/libpython3.3.so.1.0
>> #2 0x00007fffdd396cc7 in collect_with_callback () from
>> /usr/lib64/libpython3.3.so.1.0
>> #3 0x00007fffdd397738 in PyGC_Collect () from
>> /usr/lib64/libpython3.3.so.1.0
>> #4 0x00007fffdd3808ca in Py_Finalize () from
>> /usr/lib64/libpython3.3.so.1.0
>
> Can you run (some of) the same code in a normal interpreter? If so,
> does it raise an uncaught exception?
Can't, it's fully embedded inside the application and fully loads
C-classes from C-land memory without any files or libraries.
> Was the program supposed to be shutting down when this occurred? Or
> did this happen during 'normal' execution?
Shutting down. It happens though also if I trigger an error for example
using
if( ! PyArg_ParseTuple( args, "iiii", &x1, &y1, &x2, &y2 ) ){
return NULL;
}
and proving for example floats instead of integer.
So it happens as soon as the GC is involved. Could it be a tp_* function
that is marked optional is actually not optional at all? According to
the documentation I need only this:
@@@@@@
typeObject = new sObjectType;
memset( typeObject, 0, sizeof( sObjectType ) );
typeObject->tp_name = "Dragengine.Gui.Graphics.Graphics";
typeObject->tp_basicsize = sizeof( sObjectData );
typeObject->tp_flags = Py_TPFLAGS_DEFAULT;
typeObject->tp_doc = "Graphics Object";
typeObject->tp_methods = vMethodsInstance;
typeObject->tp_new = ( newfunc )spModuleGraphics::cfNew;
typeObject->tp_init = ( initproc )spModuleGraphics::cfInit;
typeObject->tp_dealloc = ( destructor )spModuleGraphics::cfDealoc;
typeObject->ownerClass = this;
PyType_Ready( typeObject );
Py_INCREF( typeObject );
PyModule_AddObject( pPyModule, "Graphics", ( PyObject* )typeObject );
@@@@@@
where sObject is:
@@@@@@
struct sObjectType : public PyTypeObject{
spModuleGraphics *ownerClass;
};
@@@@@@
but maybe the documentation is missing something there?
>
> In any case, switch to 3.4.1 or later for improved gc and finalization.
>
Not in GenToo yet as far as I know.
--
Yours sincerely
Plüss Roland
Leader and Head Programmer
- Game: Epsylon ( http://www.indiedb.com/games/epsylon )
- Game Engine: Drag[en]gine ( http://www.indiedb.com/engines/dragengine
, http://dragengine.rptd.ch/wiki )
- Normal Map Generator: DENormGen ( http://epsylon.rptd.ch/denormgen.php )
- As well as various Blender export scripts und game tools
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: module_traverse segfault Roland Plüss <roland@rptd.ch> - 2014-06-16 22:16 +0200
csiph-web