wootguy / Glitch-Life

Randomizes Sven Co-op maps
http://forums.svencoop.com/showthread.php/42021-Glitch-Life-program
36 stars 8 forks source link

Segmentation fault on Linux when sound randomisation is used #6

Closed incognico closed 8 years ago

incognico commented 8 years ago

As soon as I change 5) Sound Mode to anything other than "Do not change" I get a segfault of gsrand after starting.

Found 1 of 1 maps

Finding content...
Segmentation fault (core dumped)

It crashes almost instantly after "Finding content...". All other corruptions work fine but sound crashes.

I've tried different versions of llvm to complile gsrand, no difference. Somehow I have problems running it in lldb, gdb says the following: 0x00007ffff72241da in strlen () from /lib/x86_64-linux-gnu/libc.so.6

CC @Yoplitein

Yoplitein commented 8 years ago

There appears to be incorrect data in the masterSize array. On line 5696 in masterList.h change 2 to 1.

Yoplitein commented 8 years ago

I'm surprised this doesn't also segfault on Windows. I guess the CRT's strlen is more robust?

wootguy commented 8 years ago

I guess so. I wish it wasn't so I could trust my testing on Windows.

Windows 8+ also seems to initialize memory differently, which makes it impossible to reproduce problems like this without a different OS (or compiler/runtime?).

Yoplitein commented 8 years ago

You might try MinGW.

incognico commented 8 years ago

Works now with the small change. But isn't it supposed to find my custom sounds and use them as replacement for the maps sounds? I see

Finding non-default content... Sounds ------------- 0 (10 excluded)

while I have almost 7000 sound files in sound/

wootguy commented 8 years ago

MinGW worked, and so did the masterSize change.

For the custom sound problem, yes, it should be finding your custom sounds. Which content folder are they in (svencoop, svencoop_addon, svencoop_downloads, svencoop_hd)? I forgot svencoop_hd was a thing, so the program doesn't search there.

Edit: Also, where is the program located? It looks like it couldn't even find the default sounds (~5000 should be excluded).

incognico commented 8 years ago

Using svencoop_addon. It only finds 10 sounds, every time. Sound scanning finishing way too quickly too. Could there be problematic files in the sound folder or am I hitting any limits or something?

wootguy commented 8 years ago

Nope, there aren't any hard-coded limits, and sound files aren't checked for validity. Maybe the *nix code is ignoring subdirectories when finding content?

incognico commented 8 years ago

There are way more at the root of sound/. Well at least the segfault is fixed fow now.

Yoplitein commented 8 years ago

It's an issue of case sensitivity. Working on a fix.

Yoplitein commented 8 years ago

7