interrogate crash with HAVE_THREADS = 1

Hi,

I’m recompiling panda to enable threading support (HAVE_THREADS = 1), but after a short while I get an error from interrogate:

built/bin/interrogate -srcdir panda/src/express -Ipanda/src/express -DCPPPARSER -D__STDC__=1 -D__cplusplus -longlong __int64 -D_X86_ -DWIN32_VC -D_WIN32 -D"_declspec(param)=" -D_near -D_far -D__near -D__far -D__stdcall -DFORCE_INLINING -Sbuilt/include/parser-inc -Ithirdparty/win-python/include -Ithirdparty/win-libs-vc7/zlib/include -oc built/tmp/libexpress_igate.cxx -od built/pandac/input/libexpress.in -fnames -string -refcount -assert -python-native -Ibuilt/tmp -Ipanda/src/express -Ibuilt/include -DBUILDING_PANDAEXPRESS -module pandaexpress -library libexpress bigEndian.h buffer.h checksumHashGenerator.h circBuffer.h config_express.h datagram.h datagramGenerator.h datagramIterator.h datagramSink.h dcast.h encryptStream.h encryptStreamBuf.h error_utils.h hashGeneratorBase.h hashVal.h indirectLess.h littleEndian.h memoryInfo.h memoryUsage.h memoryUsagePointerCounts.h memoryUsagePointers.h multifile.h namable.h nativeNumericData.h nodePointerTo.h nodePointerToBase.h nodeReferenceCount.h objectDeletor.h ordered_vector.h password_hash.h patchfile.h pointerTo.h pointerToArray.h pointerToBase.h pointerToVoid.h profileTimer.h pta_uchar.h ramfile.h referenceCount.h reversedNumericData.h streamReader.h streamWriter.h stringDecoder.h subStream.h subStreamBuf.h textEncoder.h threadSafePointerTo.h threadSafePointerToBase.h trueClock.h typedReferenceCount.h typedef.h unicodeLatinMap.h vector_uchar.h virtualFile.h virtualFileComposite.h virtualFileList.h virtualFileMount.h virtualFileMountMultifile.h virtualFileMountSystem.h virtualFileSimple.h virtualFileSystem.h weakPointerTo.h weakPointerToBase.h weakPointerToVoid.h weakReferenceList.h windowsRegistry.h zStream.h zStreamBuf.h express_composite1.cxx express_composite2.cxx
                  *** Error in /c/TeamVienna/PandaExperiments/PandaRecompile/panda3d-1.3.2/built/include/atomicAdjustWin32Impl.h near line 38, column 36:
                  syntax error, unexpected KW_VOLATILE, expecting ')'

The offending line in atomicAdjustWin32Impl.h is as follows:

  INLINE static void inc(TVOLATILE PN_int32 &var);

When threading is disabled, TVOLATILE is #defined to be an empty string, so basically it’s removed, but when threading is on, it’s #defined to be the volatile keyword.
And this seems to make interrogate choke, because it doesn’t expect to meet volatile in this place.
I’ve checked against the latest version from CVS, and the code there is identical.

Any hints?

For the record, here’s info on my config:

*source version: panda 1.3.2 (from the web-site package)
*compiler: visual studio 2003
*I’m using makepanda
*In makepanda I changed HAVE_THREADS to 1, disabled USE_MEMORY_DLMALLOC, enabled USE_MEMORY_MALLOC instead

Thanks,

Erik

This appears to be a minor makepanda bug. The makepanda build system probably hasn’t yet been tested with HAVE_THREADS = 1. Try editing makepanda.py, looking for the line that defines all of command-line parameters for interrogate (search for -DCPPPARSER, for instance), and add the parameter “-Dvolatile=” .

David

Thanks, that seems to have fixed the problem (still compiling this very moment) but I’m past the problem spot.

However, I’m wondering if the removal of the volatile keyword makes any difference for the interrogate process?
I mean: the code itself is compiled with the presence of volatile, whereas the wrappers that interrogate produces doesn’t see the volatile.
I don’t know enough about c wrapping for python to know if this is a problem or not, but it makes me slightly nervous.

Erik

No, the volatile keyword means nothing to interrogate.

Interrogate needs to parse the C++ headers just well enough to understand what the function names and parameter types are, then it generates new C++ code that will produce the appropriate Python-callable wrappers. Then we compile this generated code with the actual compiler (which does know about the volatile keywords and other niceties), so everything is built perfectly.

David