packp3d_dev and pdeploy_dev

All right, I think that I may have chased down the problem, at least in part–but I don’t know what to do about it.

First of all, I note that this doesn’t just affect packp3d and pdeploy–it seems to be more general than that, causing any attempt to run a .p3d file through the newly-built runtime distributable to fail. I’m guessing that I was previously able to run .p3d files as a result of having installed a version of the runtime distributable that didn’t have this issue.

I’ve been tinkering–primarily by adding simple debugging output lines, but occasional commenting-out of lines–with the source code for the runtime/runtime-distributable (I’m honestly not sure of which is running the relevant code, so I’ve been rebuilding both; I imagine that it’s the distributable, however), and seem to have found a likely candidate.

It is, however, entirely possible that I’ve found an issue that I myself introduced somehow.

The proximal cause of the issue seems to be “rt_terminate” being called in “p3dSession.cxx”, thus prompting a halt.

This appears to be a response to a broken XML message being sent to “read_xml” in “binaryXml.cxx”. Specifically, that method is finding the “xnode” returned from “read_xml_node” to be NULL; this appears to be caused by the very first read in “read_xml_node” producing a “gcount” value different to “sizeof(value_length)”–specifically, “gcount” appears to be coming out as 0, which, from what I’ve gathered, indicates that no characters were read.

Now, “read_xml” is called from a few places, but, based on some experimentation, I think that the offending party is “rt_thread_run” in “p3dSession.cxx”. As far as I see, this appears to be happening on the first attempted reading. This would seem to imply a problem with “_pipe_read”, and thus “r_from”–but I fear that I don’t know the system well enough to be confident of what to make of that.

Hmm, if it really is a bug in the binary XML reader, then you could switch over to the regular XML reader by changing “#define DO_BINARY_XML 1” at the top of binaryXml.cxx to “#undef DO_BINARY_XML”.

I would guess that it’s more likely to be some failure condition due to a broken pipe because of an error triggered elsewhere. Is there nothing interesting in the associated log files at all?

It would really help if you just gave me the .p3d files so I could try running it for myself.

All right, I’ve just tried that, and it doesn’t prevent the issue–it just moves the failed read to the “non-binary” code in “read_xml”, which then reports it has unexpectedly reached the end of the file. This seems to conform with the “binary” version reporting a “gcount” of 0: it looks as though it’s receiving no data.

No, I don’t think that the bug is in the reader; rather, think that either a bad XML command is being sent from somewhere, a command is being corrupted or lost along the way, or somehow the pipes are misaligned, causing a command to be lost. I just don’t know what that command is intended to be, or where it’s being sent from.

I’ve posted everything that I’ve noticed in the logs, I’m afraid. :confused: It’s entirely possible that I’ve missed something, of course.

Is there anything in particular that I should look for? It may be that there’s something that I’m passing over, not realising that it’s important.

[edit] But see the edit at the end of the post. [/edit]

At the moment simply running “panda3d packp3d1.9.p3d”, where both panda3d and packp3d1.9.p3d are being built by me from the source code, packp3d1.9.p3d having been copied over to another directory and the command executed from there. (I do realise that packp3d requires arguments, but execution doesn’t seem to be getting far enough for that to be an issue.)

I just tried another experiment: I created an empty file and renamed its extension to “.p3d”, then tried to run that. This time, panda managed to very briefly open a splash/error window, and printed “failed to execute”–which indicates that it’s at least getting somewhere in that case. However, this appears to occur earlier than the spawning of the python run thread, which is where my problem seems to be occurring, so I don’t think that it’s terribly relevant.

[edit]
Actually. hang on: looking again through the output produced when building the runtime-distributable, I see quite a few “missing modules” and “unknown modules”, some of which seem to be xml-related. Could some of those be relevant?

I’m a little dubious, I’ll admit: I recall similar errors being considered to be unconcerning previously, but more saliently, when executing panda3d as described above I do seem to be seeing other pairs of pipes working before we reach the one that’s failing, with XML commands being sent and received, which seems to indicate that the basic functionality works.

Amusingly, one of the “missing modules” is apparently named “idonotexist”–at least it’s truthful! :laughing:

Additionally, looking again at “p3dcore.log”, I noticed the following few lines:

Downloading file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/panda3d/thaumaturge_1.9/linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.xml: 0M, 0xc424b0
Downloaded file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/panda3d/thaumaturge_1.9/linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.xml: 100%, 0xc424b0, success = 1
File is incorrect: panda3d.thaumaturge_1.9.linux_amd64.mf
report_package_info_ready: panda3d

Note the “File is incorrect” line–could that be relevant?

No, we don’t use Python modules for writing XML, so that can’t be related. You’d be seeing other errors if that was the case.

“File is incorrect” means that the extract on disk didn’t exist or was invalid. This isn’t necessarily an error. It just means it has to (re-)extract the file.

Could we take a step back for a moment? I’m finding it really difficult to analyze what’s going on here since this thread seems to be about a hundred different things. Let’s take it one step at a time, please.

The problem, if I’m understanding correctly, is that a .p3d file does not run with the runtime, correct? Please tell me the following:

  1. Whether you have been deleting the Runtime directory (on Linux, ~/.panda3d/) to be sure.
  2. Which host_url and distributor you used for building the rtdist and runtime.
  3. The outputs of the commands “panda3d -V” “panda3d -U” and “panda3d -P”
  4. The command-line output of running “panda3d packp3d.p3d -h” without arguments.
  5. Post the log files that appear when you run just that.

Good idea. The reason, I think, that this thread has become so muddled is that this issue has proven rather difficult to pin down.

To answer your questions:

Indeed–although, for the sake of clarity, note that I don’t mean a specific .p3d file, but rather .p3d files in general–or at least, those generated either as part of this distributable or previously by packp3d, presumably using a related distributable.

In general, yes, I believe so–I may have forgotten to do so a few times, but in most of my tests I’ve been deleting all but the “log” folder from /.panda3d/.

–distributor thaumaturge --host file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage

panda3d -V: 1.0.4c
panda3d -U: file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage
panda3d -P: linux_amd64

For the next two questions, I’ll note that I’ve removed most of my debugging output, which was pretty messy, but left in a cleaned-up version of the output that I added to indicate the failed XML read. If you’d like any additional debugging output, just let me know. (I do see that I missed a few bits of debugging output–the line that ends with “<<< Adding packages”, for example.)

Oddly, I got two differing sets of output on two consecutive runs–the log file seemed to suggest that some of the old debugging output was still present somewhere. In both cases I cleared out /.panda3d/ before running, I believe. The following is from the second run, which doesn’t seem to have the old output, but does have the new.

(I’m presuming that I can substitute my “packp3d1.9.p3d” from my distributable build for “packp3d.p3d” above. If not, which packp3d.p3d should I use? A copy from Panda 1.8?)

:downloader: [0x24402f0] begin GET [ file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/contents.xml?1431706098 ]
:downloader: [0x24414e0] begin GET [ file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/coreapi/linux_amd64/p3d_plugin.so ]
:downloader: [0x2455840] begin GET [ file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/images/images.xml ]
:downloader: [0x2455840] begin GET [ file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/panda3d/thaumaturge_1.9/linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.xml ]
:downloader: [0x2452530] begin GET [ file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/images/images.mf.pz ]
:downloader: [0x244d1a0] begin GET [ file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/egg/thaumaturge_1.9/linux_amd64/egg.thaumaturge_1.9.linux_amd64.xml ]
:downloader: [0x244d1a0] begin GET [ file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/panda3d/thaumaturge_1.9/linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.mf.pz ]
Installing Panda3D
:downloader: [0x244d1a0] begin GET [ file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/egg/thaumaturge_1.9/linux_amd64/egg.thaumaturge_1.9.linux_amd64.mf.pz ]
Installing Panda3D egg loader
Install complete.
:HostInfo: Downloading contents file [ file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/contents.xml?1431706111 ]

:downloader: [0x12c43d8] begin GET [ file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/contents.xml?1431706111 ]
:HostInfo(warning): Successfully downloaded file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/contents.xml?1431706111
:PackageInfo: panda3d downloading file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/panda3d/thaumaturge_1.9/linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.xml
:downloader: [0x12c4958] begin GET [ file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/panda3d/thaumaturge_1.9/linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.xml ]
:PackageInfo: Removing linux_amd64/libXext.so.6
:PackageInfo: Removing linux_amd64/libpandaphysics.so
:PackageInfo: Removing linux_amd64/libXrender.so.1
:PackageInfo: Removing linux_amd64/_ssl.x86_64-linux-gnu.so
:PackageInfo: Removing linux_amd64/libXxf86dga.so.1
:PackageInfo: Removing linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.xml
:PackageInfo: Removing linux_amd64/libCgGL.so
:PackageInfo: Removing linux_amd64/libpandagl.so
:PackageInfo: Removing linux_amd64/libogg.so.0
:PackageInfo: Removing linux_amd64/_vfsimporter.so
:PackageInfo: Removing linux_amd64/libp3dtoolconfig.so
:PackageInfo: Removing linux_amd64/libtinfo.so.5
:PackageInfo: Removing linux_amd64/libpanda.so
:PackageInfo: Removing linux_amd64/libp3direct.so
:PackageInfo: Removing linux_amd64/libfreetype.so.6
:PackageInfo: Removing linux_amd64/libcrypto.so.1.0.0
:PackageInfo: Removing linux_amd64/libz.so.1
:PackageInfo: Removing linux_amd64/libpython2.7.so.1.0
:PackageInfo: Removing linux_amd64/libp3dpython.so
:PackageInfo: Removing linux_amd64/libpandafx.so
:PackageInfo: Removing linux_amd64/libreadline.so.6
:PackageInfo: Removing linux_amd64/libp3tinydisplay.so
:PackageInfo: Removing linux_amd64/p3dpython
:PackageInfo: Removing linux_amd64/resource.x86_64-linux-gnu.so
:PackageInfo: Removing linux_amd64/libvorbis.so.0
:PackageInfo: Removing linux_amd64/readline.x86_64-linux-gnu.so
:PackageInfo: Removing linux_amd64/libXfixes.so.3
:PackageInfo: Removing linux_amd64/libpandaexpress.so
:PackageInfo: Removing linux_amd64/libssl.so.1.0.0
:PackageInfo: Removing linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.mf
:PackageInfo: Removing linux_amd64/Config.prc
:PackageInfo: Removing linux_amd64/libp3dtool.so
:PackageInfo: Removing linux_amd64/libstdc++.so.6
:PackageInfo: Removing linux_amd64/_hashlib.x86_64-linux-gnu.so
:PackageInfo: Removing linux_amd64/libvorbisfile.so.3
:PackageInfo: Removing linux_amd64/libpng12.so.0
:PackageInfo: Removing linux_amd64/libCg.so
:PackageInfo: Removing linux_amd64/usage.xml
:PackageInfo: Removing linux_amd64/datetime.x86_64-linux-gnu.so
:PackageInfo: Removing linux_amd64/libXcursor.so.1
:PackageInfo: Removing linux_amd64/libXrandr.so.2
:PackageInfo: Removing linux_amd64/libutil.so.1
:PackageInfo: Removing linux_amd64/panda3d/physics.so
:PackageInfo: Removing linux_amd64/panda3d/fx.so
:PackageInfo: Removing linux_amd64/panda3d/core.so
:PackageInfo: Removing linux_amd64/panda3d/direct.so
:PackageInfo: panda3d downloading file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/panda3d/thaumaturge_1.9/linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.mf.pz
:downloader: [0x12c4ad8] begin GET [ file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/panda3d/thaumaturge_1.9/linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.mf.pz ]
:PackageInfo: Uncompressing /home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/panda3d/thaumaturge_1.9/panda3d.thaumaturge_1.9.linux_amd64.mf.pz to /home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/panda3d/thaumaturge_1.9/panda3d.thaumaturge_1.9.linux_amd64.mf
:PackageInfo: Unpacking /home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/panda3d/thaumaturge_1.9/panda3d.thaumaturge_1.9.linux_amd64.mf

The only log file that appears in /.panda3d/log is “p3dcore.log”. The contents follow:

_root_dir = /home/ian/.panda3d, _temp_directory = /tmp/, platform = linux_amd64, host_url = file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage, verify_contents = 1
api_version = 16
read contents.xml, max_age = 5, expires in 4 s
Supported platforms: linux_amd64
Plugin version: 1.0.4c
Plugin distributor: thaumaturge
Core API host URL: file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage
Core API version: 1.0.4.2
Core API date: Fri May 15 18:01:22 2015

Creating P3DInstance 0x2448bb0:  console_output="1" auto_start="1"
setting background to download, splash_window = 0
_per_platform for images = 1
/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/images/images.xml is stale.
p3d_basename = packp3d1.9.p3d
send_notify(onpluginload)
p3d trusted
_matches_run_origin = 1
_matches_script_origin = 0
_auto_install = 1, _auto_start = 1, _stop_on_ready = 0
send_notify(onauth)
Migrating panda3d from platform "" to platform "linux_amd64"
_per_platform for panda3d = 1
/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/panda3d/thaumaturge_1.9/linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.xml is stale.
set_wparams: 1 800 600
notify: onpluginload 
Downloading file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/images/images.xml: 0M, 0x244a8d0
notify: onauth 
Downloaded file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/images/images.xml: 100%, 0x244a8d0, success = 1
File is incorrect: images.mf
report_package_info_ready: images
Selected install plan for images: 0 of 75332.3
Downloading file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/panda3d/thaumaturge_1.9/linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.xml: 0M, 0x244d1a0
Downloaded file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/panda3d/thaumaturge_1.9/linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.xml: 100%, 0x244d1a0, success = 1
File is incorrect: panda3d.thaumaturge_1.9.linux_amd64.mf
report_package_info_ready: panda3d
<<<<<<<<<<<<<<<<<<<<<<<<< Adding packages 
panda3d: asked for seq 22, we have seq 22
egg: asked for seq 22, we have seq 22
_per_platform for egg = 1
/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/egg/thaumaturge_1.9/linux_amd64/egg.thaumaturge_1.9.linux_amd64.xml is stale.
Downloading file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/images/images.mf.pz: 0M, 0x2463940
Downloaded file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/images/images.mf.pz: 100%, 0x2463940, success = 1
Spawning thread to handle images
Downloading file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/egg/thaumaturge_1.9/linux_amd64/egg.thaumaturge_1.9.linux_amd64.xml: 0M, 0x2473b40
Downloaded file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/egg/thaumaturge_1.9/linux_amd64/egg.thaumaturge_1.9.linux_amd64.xml: 100%, 0x2473b40, success = 1
File is incorrect: egg.thaumaturge_1.9.linux_amd64.mf
report_package_info_ready: egg
panda3d: asked for seq 22, we have seq 22
Beginning install of 2 packages, total 26999308 bytes required (0 previously downloaded).
send_notify(ondownloadbegin)
Installing panda3d, package 1 of 2, 21323264 bytes.
Selected install plan for panda3d: 0 of 2.2736e+07
send_notify(ondownloadnext)
notify: ondownloadbegin 
notify: ondownloadnext 
get_panda_script_object
Downloading file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/panda3d/thaumaturge_1.9/linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.mf.pz: 20.3M, 0x2453aa0
Successfully joined thread: 0
Spawning thread to handle images
Downloaded file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/panda3d/thaumaturge_1.9/linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.mf.pz: 100%, 0x2453aa0, success = 1
Spawning thread to handle panda3d
Successfully joined thread: 0
Done installing images: success = 1
Successfully joined thread: 0
Spawning thread to handle panda3d
Successfully joined thread: 0
Done installing panda3d: success = 1
Installing egg, package 2 of 2, 5676044 bytes.
Selected install plan for egg: 0 of 5.99523e+06
send_notify(ondownloadnext)
notify: ondownloadnext 
get_panda_script_object
Downloading file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/egg/thaumaturge_1.9/linux_amd64/egg.thaumaturge_1.9.linux_amd64.mf.pz: 5.4M, 0x244e110
Downloaded file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/egg/thaumaturge_1.9/linux_amd64/egg.thaumaturge_1.9.linux_amd64.mf.pz: 100%, 0x244e110, success = 1
Spawning thread to handle egg
Successfully joined thread: 0
Spawning thread to handle egg
Successfully joined thread: 0
Done installing egg: success = 1
send_notify(ondownloadcomplete)
send_notify(onready)
send_notify(inst_mgr)
send_notify(autostarting...)
setting background to launch, splash_window = 0
send_notify((setting background image))
Search path is /home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/egg/thaumaturge_1.9/linux_amd64:/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/panda3d/thaumaturge_1.9/linux_amd64
_p3dpython_exe: /home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/panda3d/thaumaturge_1.9/linux_amd64/p3dpython
Setting environment:
  XDG_VTNR=8
  SSH_AGENT_PID=1768
  XDG_SESSION_ID=c1
  CLUTTER_IM_MODULE=xim
  GPG_AGENT_INFO=/run/user/1000/keyring-e7eBGg/gpg:0:1
  TERM=xterm
  SHELL=/bin/bash
  VTE_VERSION=3409
  XDG_SESSION_COOKIE=bf7f4f93ff8902358cb08c61554bae9d-1431696769.352571-308363736
  WINDOWID=56623502
  GNOME_KEYRING_CONTROL=/run/user/1000/keyring-e7eBGg
  GTK_MODULES=gail:atk-bridge:overlay-scrollbar
  USER=ian
  LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
  SSH_AUTH_SOCK=/run/user/1000/keyring-e7eBGg/ssh
  SESSION_MANAGER=local/ian-Satellite-Pro-A300:@/tmp/.ICE-unix/1684,unix/ian-Satellite-Pro-A300:/tmp/.ICE-unix/1684
  USERNAME=ian
  DEFAULTS_PATH=/usr/share/gconf/cinnamon.default.path
  XDG_CONFIG_DIRS=/etc/xdg/xdg-cinnamon:/etc/xdg
  DESKTOP_SESSION=cinnamon
  QT_IM_MODULE=ibus
  QT_QPA_PLATFORMTHEME=appmenu-qt5
  GDM_XSERVER_LOCATION=local
  PWD=/home/ian/Documents/My Game Projects/P3D
  XMODIFIERS=@im=ibus
  GNOME_KEYRING_PID=1609
  LANG=en_ZA.UTF-8
  MANDATORY_PATH=/usr/share/gconf/cinnamon.mandatory.path
  MDM_XSERVER_LOCATION=local
  GDMSESSION=cinnamon
  SHLVL=1
  XDG_SEAT=seat0
  HOME=/home/ian
  GNOME_DESKTOP_SESSION_ID=this-is-deprecated
  XDG_SESSION_DESKTOP=cinnamon
  LOGNAME=ian
  QT4_IM_MODULE=xim
  XDG_DATA_DIRS=/usr/share/cinnamon:/usr/share/gnome:/usr/local/share/:/usr/share/:/usr/share/mdm/
  DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-7Uu5toi36w,guid=dffdbdd5c38fbe2a086d5f4a5555f584
  LESSOPEN=| /usr/bin/lesspipe %s
  MDMSESSION=cinnamon
  TEXTDOMAIN=im-config
  WINDOWPATH=8
  XDG_RUNTIME_DIR=/run/user/1000
  DISPLAY=:0
  MDM_LANG=en_ZA.UTF-8
  XDG_CURRENT_DESKTOP=X-Cinnamon
  GTK_IM_MODULE=ibus
  LESSCLOSE=/usr/bin/lesspipe %s %s
  TEXTDOMAINDIR=/usr/share/locale/
  COLORTERM=gnome-terminal
  XAUTHORITY=/home/ian/.Xauthority
  _=/usr/bin/panda3d
  PATH=/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/egg/thaumaturge_1.9/linux_amd64:/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/panda3d/thaumaturge_1.9/linux_amd64:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
  LD_LIBRARY_PATH=/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/egg/thaumaturge_1.9/linux_amd64:/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/panda3d/thaumaturge_1.9/linux_amd64
  DYLD_LIBRARY_PATH=/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/egg/thaumaturge_1.9/linux_amd64:/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/panda3d/thaumaturge_1.9/linux_amd64
  PYTHONPATH=/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/egg/thaumaturge_1.9/linux_amd64:/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/panda3d/thaumaturge_1.9/linux_amd64
  PYTHONHOME=
  PRC_PATH=/home/ian/.panda3d/prc:/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/egg/thaumaturge_1.9/linux_amd64:/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/panda3d/thaumaturge_1.9/linux_amd64
  PANDA_PRC_PATH=/home/ian/.panda3d/prc:/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/egg/thaumaturge_1.9/linux_amd64:/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/panda3d/thaumaturge_1.9/linux_amd64
  TEMP=/tmp/
  PANDA3D_ROOT=/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/panda3d/thaumaturge_1.9/linux_amd64
  EGG_ROOT=/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/egg/thaumaturge_1.9/linux_amd64
Attempting to start python from /home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/panda3d/thaumaturge_1.9/linux_amd64/p3dpython
Not changing working directory.
child still alive after 101 ms
P3dSession:rt_thread_run--reading 0x244d3e0
send_notify(started!(?))
notify: ondownloadcomplete 
notify: onready 
notify: inst_mgr 
notify: autostarting... 
notify: (setting background image) 
notify: started!(?) 
BinaryXML:read_xml: XNode is NULL
P3dSession:rt_thread_run: doc is NULL
P3dSession:rt_terminate: Termination requested 
send_notify(Main thread stopping)
notify: Main thread stopping 
notify: onpythonstop 
finish_instance: 0x2448bb0
Assigning 0x2448bb0->log_pathname = 
Python process has successfully stopped.
  signalled by 11, core = 128
Successfully joined thread: 0
P3D_finalize called
counts: 1 1 1 1

That helps a lot! This part is really important:

  signalled by 11, core = 128

11 means a SIGSEGV (segmentation fault) happened in the child process, and 128 means a core file was dumped.

The error message preceding it it saying it stopped “successfully”, although technically true (it did crash successfully, after all), is kind of misleading.

Now, look for a file named “core” (probably placed in the current directory) and run “gdb /home/ian/.panda3d/path/to/p3dpython core”, wait for it to load, and hit “bt” to get a traceback.

You may need to recompile the rtdist with “–optimize 3” or even lower to get meaningful debug info, as the default level 4 strips away a lot of debugging info.

Ah, excellent! :slight_smile:

Hmm… I’m not finding it. :confused:

A bit of quick searching suggests that Ubuntu (and some other Linux distributions) may by default prevent core dumps; I intend to look into this further tomorrow (it’s somewhat late here, and I’m tired).

Otherwise, just to check that I’m looking for the right thing: Would it just be named “core”, with no extension? Could it have some other name?

I’ll hopefully perform a clean build and a clean installation of that build tomorrow. Even if we don’t get a “core” file, there might be more output to look at.

It would just be named “core”. You can enable core dumps with “ulimit -c unlimited”.

Ah, I see–thank you. That should be set now, I believe.

When using “–optimize 2”, the distributable build fails with the following error:

[ 57%] Linking executable built_thaumaturge/bin/p3dcert
g++ -o built_thaumaturge/bin/p3dcert -Lbuilt_thaumaturge/lib -Lbuilt_thaumaturge/tmp built_thaumaturge/tmp/plugin_mkdir_complete.o built_thaumaturge/tmp/plugin_wstring_encode.o built_thaumaturge/tmp/plugin_p3dCert.o -pthread -L/usr/X11R6/lib -lssl -lcrypto -lwx_gtk2u_richtext-2.8 -lwx_gtk2u_aui-2.8 -lwx_gtk2u_xrc-2.8 -lwx_gtk2u_qa-2.8 -lwx_gtk2u_html-2.8 -lwx_gtk2u_adv-2.8 -lwx_gtk2u_core-2.8 -lwx_baseu_xml-2.8 -lwx_baseu_net-2.8 -lwx_baseu-2.8 -ldl
built_thaumaturge/tmp/plugin_p3dCert.o: In function `wxWindowBase::GetName() const':
p3dCert_wx.cxx:(.text._ZNK12wxWindowBase7GetNameEv[_ZNK12wxWindowBase7GetNameEv]+0x3b): undefined reference to `wxOnAssert(wchar_t const*, int, char const*, wchar_t const*, wchar_t const*)'
built_thaumaturge/tmp/plugin_p3dCert.o: In function `wxTopLevelWindowGTK::GetTitle() const':
p3dCert_wx.cxx:(.text._ZNK19wxTopLevelWindowGTK8GetTitleEv[_ZNK19wxTopLevelWindowGTK8GetTitleEv]+0x3b): undefined reference to `wxOnAssert(wchar_t const*, int, char const*, wchar_t const*, wchar_t const*)'
built_thaumaturge/tmp/plugin_p3dCert.o:(.data.rel.ro._ZTV10P3DCertApp[_ZTV10P3DCertApp]+0x120): undefined reference to `wxApp::OnAssertFailure(wchar_t const*, int, wchar_t const*, wchar_t const*, wchar_t const*)'
built_thaumaturge/tmp/plugin_p3dCert.o:(.data.rel.ro._ZTV10P3DCertApp[_ZTV10P3DCertApp]+0x128): undefined reference to `wxAppConsole::OnAssert(wchar_t const*, int, wchar_t const*, wchar_t const*)'
collect2: error: ld returned 1 exit status
Process exited with exit status 1 and signal code 0
Storing dependency cache.
Elapsed Time: 4 sec

Building with “–optimize 3” seems to work, however.

In fact, I can actually run packp3d1.9.p3d through Panda with this build–although the output seems to indicate that the mysterious “broken” XML message is still sent (note the line “BinaryXML:read_xml: XNode is NULL” in the log-file text below) and still prompts a “terminate” command, execution doesn’t seem to cease until packp3d is done, whether printing out its help text or pointing out that no arguments were given. I see no sign of a segmentation fault in these executions.

The “broken” XML message appears to arrive later in this build, after packp3d has finished executing; in fact, I see that P3DSession’s “rt_thread_run” method reads three times during execution, suggesting that other XML commands are being successfully sent. Is this “broken” message perhaps being sent intentionally as a means of “shutting down” Panda?

Here’s the output of running “panda”

The console output, with packp3d’s help text omitted for relative brevity:

:downloader: [0x1bf1638] begin GET [ file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/contents.xml?1431817950 ]
:downloader: [0x1bf1538] begin GET [ file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/coreapi/linux_amd64/p3d_plugin.so ]
:downloader: [0x1bfd5f8] begin GET [ file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/images/images.xml ]
:downloader: [0x1c13768] begin GET [ file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/panda3d/thaumaturge_1.9/linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.xml ]
:downloader: [0x1bffce8] begin GET [ file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/images/images.mf.pz ]
:downloader: [0x1c018d8] begin GET [ file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/egg/thaumaturge_1.9/linux_amd64/egg.thaumaturge_1.9.linux_amd64.xml ]
:downloader: [0x1bffce8] begin GET [ file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/panda3d/thaumaturge_1.9/linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.mf.pz ]
Installing Panda3D
:downloader: [0x1bffce8] begin GET [ file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/egg/thaumaturge_1.9/linux_amd64/egg.thaumaturge_1.9.linux_amd64.mf.pz ]
Installing Panda3D egg loader
Install complete.
:HostInfo: Downloading contents file [ file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/contents.xml?1431817963 ]

:downloader: [0x251aee8] begin GET [ file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/contents.xml?1431817963 ]
:HostInfo(warning): Successfully downloaded file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/contents.xml?1431817963
:PackageInfo: panda3d downloading file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/panda3d/thaumaturge_1.9/linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.xml
:downloader: [0x2547c28] begin GET [ file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/panda3d/thaumaturge_1.9/linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.xml ]
:PackageInfo: Removing linux_amd64/libXext.so.6
:PackageInfo: Removing linux_amd64/libpandaphysics.so
:PackageInfo: Removing linux_amd64/libXrender.so.1
:PackageInfo: Removing linux_amd64/_ssl.x86_64-linux-gnu.so
:PackageInfo: Removing linux_amd64/libXxf86dga.so.1
:PackageInfo: Removing linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.xml
:PackageInfo: Removing linux_amd64/libCgGL.so
:PackageInfo: Removing linux_amd64/libpandagl.so
:PackageInfo: Removing linux_amd64/libogg.so.0
:PackageInfo: Removing linux_amd64/_vfsimporter.so
:PackageInfo: Removing linux_amd64/libp3dtoolconfig.so
:PackageInfo: Removing linux_amd64/libtinfo.so.5
:PackageInfo: Removing linux_amd64/libpanda.so
:PackageInfo: Removing linux_amd64/libp3direct.so
:PackageInfo: Removing linux_amd64/libfreetype.so.6
:PackageInfo: Removing linux_amd64/libcrypto.so.1.0.0
:PackageInfo: Removing linux_amd64/libz.so.1
:PackageInfo: Removing linux_amd64/libpython2.7.so.1.0
:PackageInfo: Removing linux_amd64/libp3dpython.so
:PackageInfo: Removing linux_amd64/libpandafx.so
:PackageInfo: Removing linux_amd64/libreadline.so.6
:PackageInfo: Removing linux_amd64/libp3tinydisplay.so
:PackageInfo: Removing linux_amd64/p3dpython
:PackageInfo: Removing linux_amd64/resource.x86_64-linux-gnu.so
:PackageInfo: Removing linux_amd64/libvorbis.so.0
:PackageInfo: Removing linux_amd64/readline.x86_64-linux-gnu.so
:PackageInfo: Removing linux_amd64/libXfixes.so.3
:PackageInfo: Removing linux_amd64/libpandaexpress.so
:PackageInfo: Removing linux_amd64/libssl.so.1.0.0
:PackageInfo: Removing linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.mf
:PackageInfo: Removing linux_amd64/Config.prc
:PackageInfo: Removing linux_amd64/libp3dtool.so
:PackageInfo: Removing linux_amd64/libstdc++.so.6
:PackageInfo: Removing linux_amd64/_hashlib.x86_64-linux-gnu.so
:PackageInfo: Removing linux_amd64/libvorbisfile.so.3
:PackageInfo: Removing linux_amd64/libpng12.so.0
:PackageInfo: Removing linux_amd64/libCg.so
:PackageInfo: Removing linux_amd64/usage.xml
:PackageInfo: Removing linux_amd64/datetime.x86_64-linux-gnu.so
:PackageInfo: Removing linux_amd64/libXcursor.so.1
:PackageInfo: Removing linux_amd64/libXrandr.so.2
:PackageInfo: Removing linux_amd64/libutil.so.1
:PackageInfo: Removing linux_amd64/panda3d/physics.so
:PackageInfo: Removing linux_amd64/panda3d/fx.so
:PackageInfo: Removing linux_amd64/panda3d/core.so
:PackageInfo: Removing linux_amd64/panda3d/direct.so
:PackageInfo: panda3d downloading file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/panda3d/thaumaturge_1.9/linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.mf.pz
:downloader: [0x2528dd8] begin GET [ file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/panda3d/thaumaturge_1.9/linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.mf.pz ]
:PackageInfo: Uncompressing /home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/panda3d/thaumaturge_1.9/panda3d.thaumaturge_1.9.linux_amd64.mf.pz to /home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/panda3d/thaumaturge_1.9/panda3d.thaumaturge_1.9.linux_amd64.mf
:PackageInfo: Unpacking /home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/panda3d/thaumaturge_1.9/panda3d.thaumaturge_1.9.linux_amd64.mf
:PackageInfo: Package panda3d uses 153 MB
:HostInfo: Downloading contents file [ file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/contents.xml?1431817970 ]

:downloader: [0x256e628] begin GET [ file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/contents.xml?1431817970 ]
:HostInfo(warning): Successfully downloaded file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/contents.xml?1431817970
:PackageInfo: egg downloading file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/egg/thaumaturge_1.9/linux_amd64/egg.thaumaturge_1.9.linux_amd64.xml
:downloader: [0x2575dc8] begin GET [ file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/egg/thaumaturge_1.9/linux_amd64/egg.thaumaturge_1.9.linux_amd64.xml ]
:PackageInfo: Removing linux_amd64/libp3dtool.so.1.9
:PackageInfo: Removing linux_amd64/egg.prc
:PackageInfo: Removing linux_amd64/libp3ptloader.so
:PackageInfo: Removing linux_amd64/libpandaexpress.so.1.9
:PackageInfo: Removing linux_amd64/egg.thaumaturge_1.9.linux_amd64.mf
:PackageInfo: Removing linux_amd64/libpandaegg.so
:PackageInfo: Removing linux_amd64/libp3dtoolconfig.so.1.9
:PackageInfo: Removing linux_amd64/libpanda.so.1.9
:PackageInfo: Removing linux_amd64/usage.xml
:PackageInfo: Removing linux_amd64/egg.thaumaturge_1.9.linux_amd64.xml
:PackageInfo: Removing linux_amd64/panda3d/egg.so
:PackageInfo: egg downloading file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/egg/thaumaturge_1.9/linux_amd64/egg.thaumaturge_1.9.linux_amd64.mf.pz
:downloader: [0x2575dc8] begin GET [ file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/egg/thaumaturge_1.9/linux_amd64/egg.thaumaturge_1.9.linux_amd64.mf.pz ]
:PackageInfo: Uncompressing /home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/egg/thaumaturge_1.9/egg.thaumaturge_1.9.linux_amd64.mf.pz to /home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/egg/thaumaturge_1.9/egg.thaumaturge_1.9.linux_amd64.mf
:PackageInfo: Unpacking /home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/egg/thaumaturge_1.9/egg.thaumaturge_1.9.linux_amd64.mf
:PackageInfo: Package egg uses 32 MB
:AppRunner: Total Panda3D disk space used: 185 MB
:AppRunner: Configured max usage is: 2048 MB

[packp3d help text here]

:AppRunner: Normal exit.

The contents of p3dcore.log:


_root_dir = /home/ian/.panda3d, _temp_directory = /tmp/, platform = linux_amd64, host_url = file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage, verify_contents = 1
api_version = 16
read contents.xml, max_age = 5, expires in 5 s
Supported platforms: linux_amd64
Plugin version: 1.0.4c
Plugin distributor: thaumaturge
Core API host URL: file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage
Core API version: 1.0.4.2
Core API date: Sun May 17 00:44:28 2015

Creating P3DInstance 0x1bf9250:  console_output="1" auto_start="1"
setting background to download, splash_window = 0
_per_platform for images = 1
/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/images/images.xml is stale.
p3d_basename = packp3d1.9.p3d
send_notify(onpluginload)
p3d trusted
_matches_run_origin = 1
_matches_script_origin = 0
_auto_install = 1, _auto_start = 1, _stop_on_ready = 0
send_notify(onauth)
Migrating panda3d from platform "" to platform "linux_amd64"
_per_platform for panda3d = 1
/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/panda3d/thaumaturge_1.9/linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.xml is stale.
set_wparams: 1 800 600
notify: onpluginload 
Downloading file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/images/images.xml: 0M, 0x1bfb9b0
notify: onauth 
Downloaded file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/images/images.xml: 100%, 0x1bfb9b0, success = 1
File is incorrect: images.mf
report_package_info_ready: images
Selected install plan for images: 0 of 75332.3
Downloading file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/panda3d/thaumaturge_1.9/linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.xml: 0M, 0x1c018d0
Downloading file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/images/images.mf.pz: 0M, 0x1c15620
Downloaded file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/panda3d/thaumaturge_1.9/linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.xml: 100%, 0x1c018d0, success = 1
File is incorrect: panda3d.thaumaturge_1.9.linux_amd64.mf
report_package_info_ready: panda3d
<<<<<<<<<<<<<<<<<<<<<<<<< Adding packages 
panda3d: asked for seq 1, we have seq 1
egg: asked for seq 1, we have seq 1
_per_platform for egg = 1
/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/egg/thaumaturge_1.9/linux_amd64/egg.thaumaturge_1.9.linux_amd64.xml is stale.
Downloaded file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/images/images.mf.pz: 100%, 0x1c15620, success = 1
Spawning thread to handle images
Downloading file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/egg/thaumaturge_1.9/linux_amd64/egg.thaumaturge_1.9.linux_amd64.xml: 0M, 0x1c248e0
Downloaded file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/egg/thaumaturge_1.9/linux_amd64/egg.thaumaturge_1.9.linux_amd64.xml: 100%, 0x1c248e0, success = 1
File is incorrect: egg.thaumaturge_1.9.linux_amd64.mf
report_package_info_ready: egg
panda3d: asked for seq 1, we have seq 1
Beginning install of 2 packages, total 29059053 bytes required (0 previously downloaded).
send_notify(ondownloadbegin)
Installing panda3d, package 1 of 2, 23259078 bytes.
Selected install plan for panda3d: 0 of 2.48638e+07
send_notify(ondownloadnext)
notify: ondownloadbegin 
notify: ondownloadnext 
get_panda_script_object
Downloading file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/panda3d/thaumaturge_1.9/linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.mf.pz: 22.1M, 0x1c057c0
Successfully joined thread: 0
Spawning thread to handle images
Downloaded file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/panda3d/thaumaturge_1.9/linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.mf.pz: 100%, 0x1c057c0, success = 1
Spawning thread to handle panda3d
Successfully joined thread: 0
Done installing images: success = 1
Successfully joined thread: 0
Spawning thread to handle panda3d
Successfully joined thread: 0
Done installing panda3d: success = 1
Installing egg, package 2 of 2, 5799975 bytes.
Selected install plan for egg: 0 of 6.13308e+06
send_notify(ondownloadnext)
notify: ondownloadnext 
get_panda_script_object
Downloading file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/egg/thaumaturge_1.9/linux_amd64/egg.thaumaturge_1.9.linux_amd64.mf.pz: 5.5M, 0x1bfc160
Downloaded file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/egg/thaumaturge_1.9/linux_amd64/egg.thaumaturge_1.9.linux_amd64.mf.pz: 100%, 0x1bfc160, success = 1
Spawning thread to handle egg
Successfully joined thread: 0
Spawning thread to handle egg
Successfully joined thread: 0
Done installing egg: success = 1
send_notify(ondownloadcomplete)
send_notify(onready)
send_notify(inst_mgr)
send_notify(autostarting...)
setting background to launch, splash_window = 0
send_notify((setting background image))
Search path is /home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/egg/thaumaturge_1.9/linux_amd64:/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/panda3d/thaumaturge_1.9/linux_amd64
_p3dpython_exe: /home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/panda3d/thaumaturge_1.9/linux_amd64/p3dpython
Setting environment:
  XDG_VTNR=8
  SSH_AGENT_PID=1757
  XDG_SESSION_ID=c1
  CLUTTER_IM_MODULE=xim
  GPG_AGENT_INFO=/run/user/1000/keyring-JI0bRJ/gpg:0:1
  TERM=xterm
  SHELL=/bin/bash
  VTE_VERSION=3409
  XDG_SESSION_COOKIE=bf7f4f93ff8902358cb08c61554bae9d-1431804980.769951-1763138307
  WINDOWID=52428812
  GNOME_KEYRING_CONTROL=/run/user/1000/keyring-JI0bRJ
  GTK_MODULES=gail:atk-bridge:overlay-scrollbar
  USER=ian
  LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:
  SSH_AUTH_SOCK=/run/user/1000/keyring-JI0bRJ/ssh
  SESSION_MANAGER=local/ian-Satellite-Pro-A300:@/tmp/.ICE-unix/1680,unix/ian-Satellite-Pro-A300:/tmp/.ICE-unix/1680
  USERNAME=ian
  DEFAULTS_PATH=/usr/share/gconf/cinnamon.default.path
  XDG_CONFIG_DIRS=/etc/xdg/xdg-cinnamon:/etc/xdg
  DESKTOP_SESSION=cinnamon
  QT_IM_MODULE=ibus
  QT_QPA_PLATFORMTHEME=appmenu-qt5
  GDM_XSERVER_LOCATION=local
  PWD=/home/ian/Documents/My Game Projects/P3D
  XMODIFIERS=@im=ibus
  GNOME_KEYRING_PID=1606
  LANG=en_ZA.UTF-8
  MANDATORY_PATH=/usr/share/gconf/cinnamon.mandatory.path
  MDM_XSERVER_LOCATION=local
  GDMSESSION=cinnamon
  SHLVL=1
  XDG_SEAT=seat0
  HOME=/home/ian
  GNOME_DESKTOP_SESSION_ID=this-is-deprecated
  XDG_SESSION_DESKTOP=cinnamon
  LOGNAME=ian
  QT4_IM_MODULE=xim
  XDG_DATA_DIRS=/usr/share/cinnamon:/usr/share/gnome:/usr/local/share/:/usr/share/:/usr/share/mdm/
  DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-POdVY15nGG,guid=662da2b063e9940ccb0a81bb55579c37
  LESSOPEN=| /usr/bin/lesspipe %s
  MDMSESSION=cinnamon
  TEXTDOMAIN=im-config
  WINDOWPATH=8
  XDG_RUNTIME_DIR=/run/user/1000
  DISPLAY=:0
  MDM_LANG=en_ZA.UTF-8
  XDG_CURRENT_DESKTOP=X-Cinnamon
  GTK_IM_MODULE=ibus
  LESSCLOSE=/usr/bin/lesspipe %s %s
  TEXTDOMAINDIR=/usr/share/locale/
  COLORTERM=gnome-terminal
  XAUTHORITY=/home/ian/.Xauthority
  _=/usr/bin/panda3d
  PATH=/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/egg/thaumaturge_1.9/linux_amd64:/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/panda3d/thaumaturge_1.9/linux_amd64:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
  LD_LIBRARY_PATH=/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/egg/thaumaturge_1.9/linux_amd64:/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/panda3d/thaumaturge_1.9/linux_amd64
  DYLD_LIBRARY_PATH=/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/egg/thaumaturge_1.9/linux_amd64:/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/panda3d/thaumaturge_1.9/linux_amd64
  PYTHONPATH=/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/egg/thaumaturge_1.9/linux_amd64:/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/panda3d/thaumaturge_1.9/linux_amd64
  PYTHONHOME=
  PRC_PATH=/home/ian/.panda3d/prc:/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/egg/thaumaturge_1.9/linux_amd64:/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/panda3d/thaumaturge_1.9/linux_amd64
  PANDA_PRC_PATH=/home/ian/.panda3d/prc:/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/egg/thaumaturge_1.9/linux_amd64:/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/panda3d/thaumaturge_1.9/linux_amd64
  TEMP=/tmp/
  PANDA3D_ROOT=/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/panda3d/thaumaturge_1.9/linux_amd64
  EGG_ROOT=/home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/egg/thaumaturge_1.9/linux_amd64
Attempting to start python from /home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/panda3d/thaumaturge_1.9/linux_amd64/p3dpython
Not changing working directory.
child still alive after 101 ms
send_notify(started!(?))
notify: ondownloadcomplete 
notify: onready 
notify: inst_mgr 
notify: autostarting... 
notify: (setting background image) 
notify: started!(?) 
P3dSession:rt_thread_run--reading 0x1bfff20
P3dSession:rt_thread_run--reading 0x1bfff20
P3dSession:rt_thread_run--reading 0x1bfff20
application shares main object
notify: onpythonload 
BinaryXML:read_xml: XNode is NULL
P3dSession:rt_thread_run: doc is NULL
P3dSession:rt_terminate: Termination requested 
send_notify(Main thread stopping)
notify: Main thread stopping 
notify: onpythonstop 
finish_instance: 0x1bf9250
Assigning 0x1bf9250->log_pathname = 
Python process has successfully stopped.
  exited normally, status = 1
Successfully joined thread: 0
P3D_finalize called
counts: 1 1 1 1

This doesn’t allow me to use packp3d to build distributable games, however, as an attempt to do so produces the following message in the console output:

This script must be run using a version of Panda3D that has been built
for distribution.  Try using ppackage.p3d or packp3d.p3d instead.
If you are running this script for development purposes, you may also
set the Config variable panda-package-host-url to the URL you expect
to download these contents from (for instance, a file:// URL).

As a result, I have a new hypothesis regarding my troubles here: the Panda distribution system simply doesn’t like me. :stuck_out_tongue:

Ugh, OK. That means it works just fine with an optimize 3 build. Well, that does tell us there’s something different about an optimize 4 build that makes it fail like this.

Can you go back to our optimize 4 build? Maybe you can try running p3dpython manually and see if that crashes, like:

cd /home/rdb/.panda3d/hosts/c38de01794d1d18dcc4b07c03d2582cb/panda3d/rdb_1.9/linux_amd64
LD_LIBRARY_PATH=. ./p3dpython path/to/some.p3d

It’ll fail at some point, but hopefully it’ll crash before that.

Hmm… Maybe that in itself is a clue, and the issue is a matter of timing: This XML-communication mechanism is thread-based, so perhaps the “reading” thread is attempting to read before the message is actually ready. The “optimize 3” build might work as a result of slowing the “reading” thread down just enough for the message to arrive.

I’ve created the new build (I simply left out the “optimize” flag, rather than including “–optimize 4”). Since I note that you seem to indicate to run from the distributable’s directory, I ran “panda3d packp3d1.9.p3d -h” in order to install the distributable. However, I don’t see the p3dpython executable at my equivalent of the directory that you indicate, or indeed anywhere within the “.panda3d” directory… :confused:

I do have such an executable in my repository’s directory, specifically in “PandaRepository/trunk/built_thaumaturge/bin/”.

Running from there produced the following output:

Error reading 4096 bytes
BinaryXML:read_xml: XNode is NULL
Failed to import _vfsimporter:
ImportError: No module named _vfsimporter
Successfully joined thread: 0
Failure on startup.

It does seem to be getting its “broken” XML message, I note.

I don’t see a log file, although I may be looking in the wrong place: I don’t know whether Panda would place the log file in the usual directory when run this way.

Wait, p3dpython never even gets extracted? Your log seems to contradict that:

This indicates the return value of the p3dpython process. I’m really confused now. It’s supposed to be extracted somewhere in the ~/.panda3d directory and run before the process can quit with an error, of course.

I’m reminded that the log files seem to show a lot of messages indicating removal of files; indeed, going back up to the console output a few posts above, near the middle of the output, I see this message amongst a number of other removals:

:PackageInfo: Removing linux_amd64/p3dpython

And yet, that’s a successful, “optimize 3” run… o_0

(A quick check indicates that this line is present in the log from an unsuccessful run, further up.)

Furthermore, I note that subsequent runs repeat this pattern of installation and removal. Here’s the (fairly short) console output from a run that was not the first after Panda’s installation:

:downloader: [0x231d2b0] begin GET [ file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/panda3d/thaumaturge_1.9/linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.xml ]
:downloader: [0x2332280] begin GET [ file:///home/ian/PandaRepository/trunk/built_thaumaturge/stage/panda3d/thaumaturge_1.9/linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.mf.pz ]
Installing Panda3D
Installing Panda3D
Install complete.
:PackageInfo: Removing linux_amd64/libXext.so.6
:PackageInfo: Removing linux_amd64/libpandaphysics.so
:PackageInfo: Removing linux_amd64/libXrender.so.1
:PackageInfo: Removing linux_amd64/_ssl.x86_64-linux-gnu.so
:PackageInfo: Removing linux_amd64/libXxf86dga.so.1
:PackageInfo: Removing linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.xml
:PackageInfo: Removing linux_amd64/libCgGL.so
:PackageInfo: Removing linux_amd64/libpandagl.so
:PackageInfo: Removing linux_amd64/libogg.so.0
:PackageInfo: Removing linux_amd64/_vfsimporter.so
:PackageInfo: Removing linux_amd64/libp3dtoolconfig.so
:PackageInfo: Removing linux_amd64/libtinfo.so.5
:PackageInfo: Removing linux_amd64/libpanda.so
:PackageInfo: Removing linux_amd64/libp3direct.so
:PackageInfo: Removing linux_amd64/libfreetype.so.6
:PackageInfo: Removing linux_amd64/libcrypto.so.1.0.0
:PackageInfo: Removing linux_amd64/libz.so.1
:PackageInfo: Removing linux_amd64/libpython2.7.so.1.0
:PackageInfo: Removing linux_amd64/libp3dpython.so
:PackageInfo: Removing linux_amd64/libpandafx.so
:PackageInfo: Removing linux_amd64/libreadline.so.6
:PackageInfo: Removing linux_amd64/libp3tinydisplay.so
:PackageInfo: Removing linux_amd64/p3dpython
:PackageInfo: Removing linux_amd64/resource.x86_64-linux-gnu.so
:PackageInfo: Removing linux_amd64/libvorbis.so.0
:PackageInfo: Removing linux_amd64/readline.x86_64-linux-gnu.so
:PackageInfo: Removing linux_amd64/libXfixes.so.3
:PackageInfo: Removing linux_amd64/libpandaexpress.so
:PackageInfo: Removing linux_amd64/libssl.so.1.0.0
:PackageInfo: Removing linux_amd64/panda3d.thaumaturge_1.9.linux_amd64.mf
:PackageInfo: Removing linux_amd64/Config.prc
:PackageInfo: Removing linux_amd64/libp3dtool.so
:PackageInfo: Removing linux_amd64/libstdc++.so.6
:PackageInfo: Removing linux_amd64/_hashlib.x86_64-linux-gnu.so
:PackageInfo: Removing linux_amd64/libvorbisfile.so.3
:PackageInfo: Removing linux_amd64/libpng12.so.0
:PackageInfo: Removing linux_amd64/libCg.so
:PackageInfo: Removing linux_amd64/usage.xml
:PackageInfo: Removing linux_amd64/datetime.x86_64-linux-gnu.so
:PackageInfo: Removing linux_amd64/libXcursor.so.1
:PackageInfo: Removing linux_amd64/libXrandr.so.2
:PackageInfo: Removing linux_amd64/libutil.so.1
:PackageInfo: Removing linux_amd64/panda3d/physics.so
:PackageInfo: Removing linux_amd64/panda3d/fx.so
:PackageInfo: Removing linux_amd64/panda3d/core.so
:PackageInfo: Removing linux_amd64/panda3d/direct.so
:PackageInfo: Unpacking /home/ian/.panda3d/hosts/b2a93ccb73f723420c491b3644b690a8/panda3d/thaumaturge_1.9/panda3d.thaumaturge_1.9.linux_amd64.mf

That’s an error thrown by Python, which proves that it runs inside p3dpython (the fact that you see that proves p3dpython works correctly). It has to…

Wait a second, is the issue that packp3d is pulling out the rug from under itself, deleting the Panda3D installation that it’s running on? I’m trying to imagine why it does this. The Python class PackageInfo must have a really good reason to delete the panda3d package, which should already be made properly up-to-date by the runtime.

Does PackageInfo still try to remove anything if you make sure to delete ~/.panda3d/ before running packp3d, so that you’re absolutely sure that the runtime installs a fresh copy?

It might be worth around this location in PackageInfo.py some debug prints to see why it thinks that these files should be deleted.

All right, I’ve managed to deal with the Panda installation being immediately removed, at least via a quick hack: in essence, it appears to be that when removing filenames from the “contents” list in “__checkArchiveStatus”, most of the filenames in “contents” are prepended with the platform directory, while those passed into “__removeFileFromList” lack it.

However, this doesn’t seem to solve the main problem, and the “broken” XML message seems to still be sent. :confused:

I tried the above suggestion of running p3dpython manually from the relevant directory in .panda3d now that it’s no longer being deleted, but the output was similar to that produced by my previous attempt (which was made from the “stage” directory within the distributable’s “built” directory, I believe):

Failed to import VFSImporter:
Traceback (most recent call last):
  File "VFSImporter", line 4, in <module>
ImportError: No module named core
Successfully joined thread: 0
Failure on startup.

I’m considering taking directory comparisons between 1.9 and 1.8, and undoing some of the changes between the latter and the former (especially those involved in the inclusion of the “per-platform” option). This is likely to be tedious, but from what I’ve seen many of the changes are innocuous-seeming and may be skipped. To the best of my knowledge, I should compare “direct/src/p3d/” and “direct/src/plugin/”–but are there any other directories that I should look at?

sigh No luck thus far. :confused:

I went almost as far as trying a complete reversion to 1.8’s versions of the “p3d” and “plugin” directories, but doing so falls afoul of changes beyond those directories, which I’ve thus far not wanted to deal with.

All right, presuming that there are no other directories that I should look at, let’s approach this from another direction: how do optimise levels three and four differ? While I doubt that it’s the optimisations themselves that are causing the problem, the nature of the changes made might point us in the right direction…

I’d like to report that the issue appears to be resolved, thanks to work from rdb and David! :slight_smile:

(This is as of the (pretty recent) version that I’ve been building, of course.)

There is one caveat for anyone who wants to build their own version of the runtime distributable: On my machine, at least, (and noting that I’m building on Ubuntu 14.04) it seems that having the SDK installed when building the distributable may result in a distributable that doesn’t work correctly. Simply uninstalling the SDK for the duration of the build seems to correct the problem, and installing the SDK after the build has completed seems to incur no further problems.