ivansafrin/Polycode — Issue #87: Linux version now crashes on load default.pak
Author: mcclure
Created: 2012-01-14 20:30:56+00:00
State: open

Running a home-built Polycode e089bf39d53f with some patches. When I run an app built against the Linux version, it crashes while trying to load default.pak. In gdb, I see:

```
(gdb) run
Starting program: /home/mcc/work/p/nauts/package/lin/Luanauts/Luanauts
[Thread debugging using libthread_db enabled]
AL already initialized
[New Thread 0xb7fb7b70 (LWP 31561)]
[Thread 0xb7fb7b70 (LWP 31561) exited]
[New Thread 0xb7fb7b70 (LWP 31562)]
AL lib: pulseaudio.c:331: PulseAudio returned minreq > tlength/2; expect break up
[New Thread 0xb37b5b70 (LWP 31563)]
OpenAL initialized...
Creating new core services instance...
[New Thread 0xb2d73b70 (LWP 31566)]
[Thread 0xb2d73b70 (LWP 31566) exited]
[New Thread 0xb24c6b70 (LWP 31567)]
Added archive: Internal/default.pak
Adding texture default

Program received signal SIGSEGV, Segmentation fault.
0x0040ab40 in __printf_fp () from /lib/i386-linux-gnu/libc.so.6
(gdb) bt
#0 0x0040ab40 in __printf_fp () from /lib/i386-linux-gnu/libc.so.6
#1 0x00408a6b in vfprintf () from /lib/i386-linux-gnu/libc.so.6
#2 0x00424e44 in vsprintf () from /lib/i386-linux-gnu/libc.so.6
#3 0x0040e25b in sprintf () from /lib/i386-linux-gnu/libc.so.6
#4 0x00c05099 in packspu_GetString () from /usr/lib/VBoxOGLpackspu.so
#5 0x00b33b43 in cr_glGetString ()
from /usr/lib/i386-linux-gnu/dri/vboxvideo_dri.so
#6 0x001d6794 in ?? () from /usr/lib/i386-linux-gnu/libGLU.so.1
#7 0x001e1610 in gluBuild2DMipmaps () from /usr/lib/i386-linux-gnu/libGLU.so.1
#8 0x080f0068 in Polycode::OpenGLTexture::recreateFromImageData() ()
#9 0x080f01c0 in Polycode::OpenGLTexture::OpenGLTexture(unsigned int, unsigned int, char*, bool, bool, int, int) ()
#10 0x080e6171 in Polycode::OpenGLRenderer::createTexture(unsigned int, unsigned int, char*, bool, bool, int) ()
#11 0x080a9036 in Polycode::MaterialManager::createTexture(int, int, char*, bool, bool, int) ()
#12 0x080a922a in Polycode::MaterialManager::createTextureFromFile(Polycode::String const&, bool, bool) ()
#13 0x080c1d9e in Polycode::ResourceManager::parseTextures(Polycode::String const&, bool) ()
#14 0x080c255c in Polycode::ResourceManager::addDirResource(Polycode::String const&, bool) ()
#15 0x0805108b in PolycodeTemplateApp::PolycodeTemplateApp (this=0x8280058,
---Type to continue, or q to quit---
view=0x8280028) at ../../PolycodeTemplate/PolycodeTemplateApp.mm:51
#16 0x08050def in main (argc=1, argv=0xbffff334)
at ../../PolycodeTemplate/main.cpp:8
```

It is very unlikely any of my patches would have an effect on texture loading code so I think this is a problem in Polycode.

When I was building against 9e99457a4371, I did not have this problem. Have you tested the Linux version recently?