Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.035 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'scripts': 0.03; 'programmer': 0.03; 'all?': 0.16; 'args,': 0.16; 'exception?': 0.16; 'filename:fname piece:signature': 0.16; 'integer.': 0.16; 'libraries.': 0.16; 'of)': 0.16; 'optional': 0.16; 'received:192.168.1.20': 0.16; 'subject:skip:m 10': 0.16; 'there?': 0.16; 'url:ch': 0.16; 'later': 0.20; 'memory': 0.22; 'example': 0.22; 'header:User-Agent:1': 0.23; 'error': 0.23; 'skip:" 30': 0.26; 'switch': 0.26; 'this:': 0.26; 'header:In- Reply-To:1': 0.27; 'function': 0.29; 'raise': 0.29; 'code': 0.31; 'url:wiki': 0.31; 'loads': 0.31; 'null;': 0.31; 'struct': 0.31; 'know.': 0.32; 'supposed': 0.32; 'run': 0.32; 'maybe': 0.34; 'could': 0.34; 'something': 0.35; 'case,': 0.35; 'but': 0.35; 'application': 0.37; 'so,': 0.37; 'to:addr:python-list': 0.38; 'files': 0.38; 'does': 0.39; 'embedded': 0.39; 'to:addr:python.org': 0.39; 'according': 0.40; 'und': 0.40; 'improved': 0.60; 'signal': 0.60; 'new': 0.61; 'from:charset:utf-8': 0.61; 'soon': 0.63; 'happen': 0.63; 'sincerely': 0.63; 'map': 0.64; 'export': 0.74; 'skip:/ 30': 0.84; 'url:php': 0.85; 'yours': 0.88; 'involved.': 0.91; 'this;': 0.91 Date: Mon, 16 Jun 2014 22:16:16 +0200 From: =?UTF-8?B?Um9sYW5kIFBsw7xzcw==?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: module_traverse segfault References: <539F2603.2020904@rptd.ch> In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="WSI3LfKbCNWRAvsCgG3CLkv6RmMHlHvCb" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 98 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1402949787 news.xs4all.nl 2839 [2001:888:2000:d::a6]:57201 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:73324 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --WSI3LfKbCNWRAvsCgG3CLkv6RmMHlHvCb Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable >> 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 =3D new sObjectType; memset( typeObject, 0, sizeof( sObjectType ) ); typeObject->tp_name =3D "Dragengine.Gui.Graphics.Graphics"; typeObject->tp_basicsize =3D sizeof( sObjectData ); typeObject->tp_flags =3D Py_TPFLAGS_DEFAULT; typeObject->tp_doc =3D "Graphics Object"; typeObject->tp_methods =3D vMethodsInstance; typeObject->tp_new =3D ( newfunc )spModuleGraphics::cfNew; typeObject->tp_init =3D ( initproc )spModuleGraphics::cfInit; typeObject->tp_dealloc =3D ( destructor )spModuleGraphics::cfDealoc; typeObject->ownerClass =3D 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. --=20 Yours sincerely Pl=C3=BCss 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 --WSI3LfKbCNWRAvsCgG3CLkv6RmMHlHvCb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlOfUJkACgkQjKGu9ysRWfqh2wCgh+RPS66PWPEqGqhWmgbDpbee jTgAnjgpR8p98S7bwlYRn5diBG/mN61M =FY96 -----END PGP SIGNATURE----- --WSI3LfKbCNWRAvsCgG3CLkv6RmMHlHvCb--