Shield collision destroying the last piece of debris does not open tunnels.

Issue #117 resolved
Henrik Danielsson created an issue

Crashed into the last piece of debree, lost a shield face, debree got destroyed, I ended up all alone with nowhere to go... :(

Log from last run:

Died
InputStorm: Loaded bindings from slot 2 in 894us.
FPSStorm: Framerate now capped to 60FPS (0.0166667 seconds).
ALSA lib pcm.c:7963:(snd_pcm_recover) underrun occurred
FPSStorm: Stats: 66,5 max, 60 min, 66,5 avg, 2/2 on target (100%)
Restarting...
Restarting universe.
Placed 27 spheres, placing tunnels...
Placed 75 tunnels.
Entered sphere 0,142857
New game started
InputStorm: Loaded bindings from slot 2 in 262us.
FPSStorm: Framerate now capped to 60FPS (0.0166667 seconds).
FPSStorm: Stats: 66,75 max, 60 min, 66,5 avg, 2/2 on target (100%)
FPSStorm: Framerate now capped to 60FPS (0.0166667 seconds).
InputStorm: Loaded bindings from slot 1 in 685us.
WARNING: New debris has point further from centroid than old.
WARNING: No valid debris to create, retrying.
WARNING: New debris has point further from centroid than old.
WARNING: No valid debris to create, retrying.
DEBUG: Got 8 points, score now: 8
Collision check exception: bad lexical cast: source type value could not be interpreted as target at '0.1' in 'MULTIPOLYGON(((-1  0.1, 0 -1.4, 1  0.2,-1  0.2)),((-0.4 -0.6,-0.2 -0.6,-0.2 -0.8, 0.2 -0.8, 0.2 -0.6'
DEBUG: Got 7 points, score now: 15
DEBUG: Got 9 points, score now: 24
DEBUG: Got 7 points, score now: 31
DEBUG: Got 7 points, score now: 38
DEBUG: 0 powerups left in this sphere.
DEBUG: Got 7 points, score now: 45
DEBUG: Got 8 points, score now: 53
Saving high score 53 to highscore.save
High score saved successfully.
FPSStorm: Stats: 66,75 max, 60 min, 66,5132 avg, 19/19 on target (100%)
Opened menu
InputStorm: Loaded bindings from slot 4 in 303us.
FPSStorm: Framerate now capped to 60FPS (0.0166667 seconds).
Entered the main menu
Entered the options menu
Entered the help menu
Closed menu
FPSStorm: Framerate now capped to 60FPS (0.0166667 seconds).
InputStorm: Loaded bindings from slot 1 in 992us.
Saving high score 53 to highscore.save
High score saved successfully.
FPSStorm: Stats: 66,75 max, 60 min, 66,5227 avg, 11/11 on target (100%)
Opened menu
InputStorm: Loaded bindings from slot 4 in 273us.
FPSStorm: Framerate now capped to 60FPS (0.0166667 seconds).
Entered the main menu
Entered the options menu
Entered the help menu
Quitting the game.
Closed menu
Exiting at player's request.
Have a nice day!
Player stats: deaths                        1
Player stats: shots fired / hit / accuracy  32 / 13 / 40,625%
Player stats: worlds completed              0
Player stats: portals entered / backtracked 0 / 0
Player stats: weapons collected / killed    0 / 0
Player stats: powerups collected / killed   0 / 0
Saving settings to sphereFACE.cfg
Settings saved successfully.
Player ship destroyed.
InputStorm: Shutting down.
SoundStorm: Stopping streamer thread...
SoundStorm: Shutdown complete.

Comments (22)

  1. Riot

    I've been unable to reproduce this despite trying repeatedly. But a relevant part of the log might be the bad lexical cast:
    Collision check exception: bad lexical cast: source type value could not be interpreted as target at '0.1' in 'MULTIPOLYGON(((-1 0.1, 0 -1.4, 1 0.2,-1 0.2)),((-0.4 -0.6,-0.2 -0.6,-0.2 -0.8, 0.2 -0.8, 0.2 -0.6'

  2. Henrik Danielsson reporter

    Turns out it happens for me every time I've destroyed any piece of debris with the shields, not just the last one.
    If I only destroy them using the weapons I don't get the exception and all is fine. Once I've collided with one piece, the exception occurs and I'm unable to unlock the tunnels (everything stays blue) once all other pieces are gone.

    This is on Arch Linux 64 bit btw.

  3. Riot

    I've still been completely unable to reproduce this even once, on any operating system, despite extensive testing with the 64bit linux version. It's possible that the exception was a heistenbug due to the previous version of Boost which we've now moved past. If this doesn't recur in the next beta release, we'll consider it resolved - until then setting this on hold/

  4. Henrik Danielsson reporter

    Sadly, I can still reproduce it with the latest version.
    Did it on the first try, in the first sphere, after colliding with two pieces (I'm really terrible at his game hehe).

    Currently I'm using this "void sphere" to see if I can get a buffer overflow before the ship can achieve Warp 10. It has only been accelerating for half an hour so far, but still going strong! ;)

  5. Riot

    There should be no buffer overflows. You won't break the game no matter how long you fly or how fast.

    However, I'm concerned about this shield business. Is it still associated with a Collision check exception: bad lexical cast in the log? Does that happen at the moment the last piece of debris is destroyed? Does a score get announced to go with it?

    Also are you using the standalone executable or the packaged version with libc6 etc?

  6. Henrik Danielsson reporter

    If I crash into the first asteroid so it splits, there's no score. If I hit a smaller one which completely disintegrates I do get a score.
    Crashing into an asteroid which only split does not appear to trigger the bug, but crashing into the small ones trigger the exception and prevents exiting.
    I'm stuck at a total of 48/58 or 51/75 (same level), but the log says it saved the highscore as the higher number.

    I've been using the 28MB 64bit version without bundled libc.

    The Linux 64bit with bundled libc version has the exact same issues with both when using the launch script and when launched directly.
    (Btw the launch script kills all sound on my machine, including the game sounds, but I suppose that's for the other issue...)

    The Windows version under WINE does not give me this problem. I just noticed that version almost always gives me a poweverup on the first level. I have yet to see that in either of the Linux versions.

    EDIT: In case it wasn't clear from the log, the exception is thrown whenever I first crash into the debris and the debris is taken out.

    EDIT Again: Determining the exact point at which I get the exception is difficult as this version seems to throw SIGFPE (something about arithmetic or floating point errors) when I hit Ctrl+Alt+D to show the Enlightenment desktop so I can get at the terminal output, but I'm fairly sure the collision error happens when first destroying a small piece of debris.

    My latest log, again stuck.

    ALSA lib pcm_dsnoop.c:606:(snd_pcm_dsnoop_open) unable to open slave
    ALSA lib pcm_dmix.c:1029:(snd_pcm_dmix_open) unable to open slave
    ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
    ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
    ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
    ALSA lib pcm_dmix.c:1029:(snd_pcm_dmix_open) unable to open slave
    SoundStorm: PortAudio V19-devel (built Dec 11 2014 22:02:49) build 1899
      0 HDA ATI SB: ALC892 Digital (hw:0,1) Ch 2in 2out 44100Hz [fd]
      1 HDA ATI SB: ALC892 Alt Analog (hw:0,2) Ch 2in 0out 44100Hz [in only]
      2 HDA NVidia: HDMI 0 (hw:1,3) Ch 0in 8out 44100Hz [out only]
      3 HDA NVidia: HDMI 0 (hw:1,7) Ch 0in 8out 44100Hz [out only]
      4 HDA NVidia: HDMI 0 (hw:1,8) Ch 0in 8out 44100Hz [out only]
      5 HDA NVidia: HDMI 0 (hw:1,9) Ch 0in 8out 44100Hz [out only]
      6 iec958 Ch 0in 2out 44100Hz [out only]
      7 spdif Ch 2in 2out 44100Hz [fd]
      8 pulse Ch 32in 32out 44100Hz [fd]
     *9 default Ch 32in 32out 44100Hz [sysdef in] [sysdef out] [apidef in] [apidef out] [fd]
    SoundStorm: Requesting realtime scheduling from ALSA on card -1
    SoundStorm: Initialised.
    LanguageStorm: Language sv_SE not available, falling back to sv
    LanguageStorm: Default language is Swedish (sv).
    ParticleSystem: Heap usage:          42MB
    ParticleSystem: System memory usage: 55MB (1GB avail. of 15GB total)
    sphereFACE version Beta 6.5.6005.33140 master:380bf84 Release for 64bit Linux
    Compiled Jan 18 2016 11:52:37 with GCC 5.3.1 20160101 and Boost 1_60
    MemoryStorm: Stack available 8MB
    MemoryStorm: Physical usage 56MB, 1GB available of 15GB
    MemoryStorm: Virtual usage 466MB, 1GB available of 15GB
    New FOV ratio: 5.67128
    Loading settings from sphereFACE.cfg
    New FOV ratio: 5.67128
    Settings loaded successfully.
    Loading theme from sphereFACE.theme
    Theme loaded successfully.
    SoundStorm: Starting streamer thread...
    Initialising graphics...
    Oculus: Initialising Oculus Rift...
    Oculus: Device not found
    Oculus: Sensor not found
    Monitors: 1
    Monitor 0 (primary)
      Name: DVI-I-3
      Physical size: 376 301
      Position: 0 0
      Mode: 1280 1024 60
    GL_VERSION:                  4.5.0 NVIDIA 358.16
    GL_VENDOR:                   NVIDIA Corporation
    GL_RENDERER:                 GeForce GTX 470/PCIe/SSE2
    GL_SHADING_LANGUAGE_VERSION: 4.50 NVIDIA
    GL version major 4 minor 5 revision 0 API 196609 profile  204802
    GL antialiasing mode: 8 buffers: 1, samples: 8
    GL depth buffer: 24 bits
    Graphics initialised.
    New window size [1280,1024] aspect ratio 1.25
    InputStorm: Key bindings:             523KB
    InputStorm: Mouse button bindings:    8KB
    InputStorm: Joystick axis bindings:   9KB
    InputStorm: Joystick button bindings: 60KB
    InputStorm: Initialised in 922us.
    DEBUG: No joysticks connected, not binding joystick controls.
    InputStorm: Saved bindings to slot 0 in 787us.
    InputStorm: Saved bindings to slot 1 in 788us.
    InputStorm: Loaded bindings from slot 0 in 254us.
    InputStorm: Saved bindings to slot 2 in 843us.
    InputStorm: Loaded bindings from slot 0 in 268us.
    InputStorm: Saved bindings to slot 3 in 808us.
    InputStorm: Loaded bindings from slot 0 in 264us.
    InputStorm: Saved bindings to slot 4 in 1ms.
    Mouse captured in window
    Controls bound in 6.38365ms.
    Loading high score from highscore.save
    High score loaded successfully: 58
    Initialisation complete.
    Restarting universe.
    Placed 26 spheres, placing tunnels...
    Placed 72 tunnels.
    Entered sphere 0,142857
    New game started
    Fading in...
    InputStorm: Loaded bindings from slot 2 in 338us.
    FPSStorm: Framerate now capped to 60FPS (0.0166667 seconds).
    Cursor entered the window
    Mouse already captured in window
    Pressed a key to fast forward transition
    FPSStorm: Framerate now capped to 60FPS (0.0166667 seconds).
    InputStorm: Loaded bindings from slot 1 in 894us.
    DEBUG: Got 1 points, score now: 1
    DEBUG: Got 9 points, score now: 10
    Collision check exception: bad lexical cast: source type value could not be interpreted as target at '0.1' in 'MULTIPOLYGON(((-1  0.1, 0 -1.4, 1  0.2,-1  0.2)),((-0.4 -0.6,-0.2 -0.6,-0.2
     -0.8, 0.2 -0.8, 0.2 -0.6'
    Saving high score 58 to highscore.save
    High score saved successfully.
    FPSStorm: Stats: 66,75 max, 60 min, 66,625 avg, 2/2 on target (100%)
    Opened menu
    InputStorm: Loaded bindings from slot 4 in 403us.
    FPSStorm: Framerate now capped to 60FPS (0.0166667 seconds).
    Entered the main menu
    Entered the options menu
    Entered the help menu
    Cursor left the window
    Mouse released from window
    InputStorm: Saved bindings to slot 5 in 904us.
    InputStorm: Loaded bindings from slot 3 in 285us.
    Cursor left the window
    Cursor entered the window
    FPSStorm: Stats: 66,5 max, 60 min, 66,1786 avg, 7/7 on target (100%)
    Closed menu
    FPSStorm: Framerate now capped to 60FPS (0.0166667 seconds).
    InputStorm: Loaded bindings from slot 1 in 357us.
    DEBUG: Got 9 points, score now: 19
    DEBUG: Got 7 points, score now: 26
    DEBUG: Got 7 points, score now: 33
    DEBUG: Got 8 points, score now: 41
    DEBUG: Got 7 points, score now: 48
    Collision check exception: bad lexical cast: source type value could not be interpreted as target at '0.1' in 'MULTIPOLYGON(((-1  0.1, 0 -1.4, 1  0.2,-1  0.2)),((-0.4 -0.6,-0.2 -0.6,-0.2 -0.8, 0.2 -0.8, 0.2 -0.6'
    Saving high score 58 to highscore.save
    High score saved successfully.
    FPSStorm: Stats: 66,5 max, 60 min, 66,2812 avg, 8/8 on target (100%)
    Opened menu
    InputStorm: Loaded bindings from slot 4 in 310us.
    FPSStorm: Framerate now capped to 60FPS (0.0166667 seconds).
    Entered the main menu
    Entered the options menu
    Entered the help menu
    FPSStorm: Stats: 66,5 max, 60 min, 66,5 avg, 1/1 on target (100%)
    Closed menu
    FPSStorm: Framerate now capped to 60FPS (0.0166667 seconds).
    InputStorm: Loaded bindings from slot 1 in 313us.
    Saving high score 58 to highscore.save
    High score saved successfully.
    FPSStorm: Stats: 66,75 max, 60 min, 66,75 avg, 1/1 on target (100%)
    Opened menu
    InputStorm: Loaded bindings from slot 4 in 312us.
    FPSStorm: Framerate now capped to 60FPS (0.0166667 seconds).
    Entered the main menu
    Entered the options menu
    Entered the help menu
    Quitting the game.
    Closed menu
    Exiting at player's request.
    Have a nice day!
    Player stats: deaths                        0
    Player stats: shots fired / hit / accuracy  12 / 7 / 58,3333%
    Player stats: worlds completed              0
    Player stats: portals entered / backtracked 0 / 0
    Player stats: weapons collected / killed    0 / 0
    Player stats: powerups collected / killed   0 / 0
    Saving settings to sphereFACE.cfg
    Settings saved successfully.
    Saving theme to sphereFACE.theme
    Theme saved successfully.
    Player ship destroyed.
    InputStorm: Shutting down.
    SoundStorm: Stopping streamer thread...
    SoundStorm: Shutdown complete.
    
  7. Henrik Danielsson reporter

    Hey guys!

    Just wanted to say this issue persists in Beta 7.5.7151.39714. :(

    ..and btw, opening the browser on quit is just plain evil...

  8. Riot

    This is odd; we still haven't been able to reproduce the issue anywhere, but as such we haven't changed anything that may be causing it either, which is why it's not been updated since you last posted. Can you confirm that it still occurs with the bundled libc package as well?

  9. Henrik Danielsson reporter

    Yes, that version has it as well. No dropped upgrades or tunnel unlocks on the first level, except with the Windows version through WINE.

  10. Riot

    Okay, we've tried to reproduce this issue on an Arch install of our own, still with no success. Kind of stumped at this point.

    Could you do pacman -Qo $(ldd sphereFACE | cut -sd ' ' -f 3) to show the versions of each of your dynamically linked libraries, please? For future reference, here's the version from our team member's Arch machine: http://hastebin.com/kewapahozi.txt

    Do you have any thoughts about what else might be different with your setup? There's no possibility of a memory error here or something hardware related, is there?

  11. Henrik Danielsson reporter

    Heh, strange.

    I added my info here: http://hastebin.com/ovosufafuh.coffee

    At a glance I just noticed I'm using nVidia's libgl, not Mesa. And I'm loading fewer libraries than you are. o.O?

    I just tried the non-bundled 64bit version at work too (Also Arch). Intel CPU instead of AMD, and a lot newer GPU (GeForce 950 vs my old 740 at home). Reproduced it on the first attempt in the first sphere.
    Doubt it's hardware since this computer is brand new and the oldest parts at home are at least 5-10 years old.

    I can try it on my old Eeepc 901 laptop when I get home too, it's is running Arch too, but 32bit. Also have a Windows 10 laptop but haven't tried to reproduce it there since the Windows version works fine through WINE.

    Could it be rounding errors or differences in the random number generators (since it also affects the chance of drops)?

    If you have a version with extremely verbose logging I could try that too if it helps you spot the difference.

    Am I the only one with issues like this so far? If so, I'm impressed by you not simply dropping it. ;)

  12. Riot

    You're the only one having reported this, so the fact you have more than one machine producing the same result is remarkable in itself. It could be a random number generator issue, but we're just using the standard library Mersenne Twister which should be identical if your libc6 and libstdc++ are identical. Some strange floating point behaviour on the CPU may be a culprit, but that seems improbable across multiple machines - Arch seems to be the common factor, but we've been unable to reproduce it on our Arch install either which is what's confusing.

    The 32bit build on the itch.io is out of date currently so may exhibit an older version of the bug, probably no point trying that just now.

    The core of the issue appears to be the exception we catch with Collision check exception: bad lexical cast: source type value could not be interpreted as target at '0.1' in 'MULTIPOLYGON(((-1 0.1, 0 -1.4, 1 0.2,-1 0.2)),((-0.4 -0.6,-0.2 -0.6,-0.2 -0.8, 0.2 -0.8, 0.2 -0.6' - this is from Boost Geometry, but again your local Boost libraries would have no impact on this, because there are no dynamic links involved. It really should behave identically on all x86_64 systems in this regard.

    The collision check logic happens in Boost, and that's where the exception comes from - we can try to build a more instrumented version that would identify the origin of the difference; I'll try to get that done next. It would be a lot simpler for us to test it if we could duplicate the problem locally, of course!

  13. Henrik Danielsson reporter

    Really? That's great! May I ask if/how you were able to reproduce it, or if you found what could [theoretically?] be the cause?
    Just interested as a programmer since this has been a very puzzling bug from a user perspective and I'm sure it's at least as weird from the programmer perspective.

    Btw, I was able to replicate it on yet another Arch setup with much newer hardware than I had before, so this potential fix will really help me enjoy the game!

  14. Riot

    @TwoD we still hadn't been able to reproduce it, no - however, we've changed a lot of that code path now, substituting a new input system in the back-end and resolving a number of memory leaks and stale pointer issues around the armour handling system. There were a few cases of undefined behaviour that we've now cleaned up which could have been causing this as a side effect. I'm just considering this issue resolved since we've seen no evidence of it on any of our tests since the fixes - there's a possibility it may be something else, and still recur, in which case please reopen this issue and we'll continue to investigate.

    We'll be releasing the new update for testing later today.

  15. Riot

    replacing runtime wkt reading with cpp construction for all outlines, and removing runtime rescaling where possible. May also incidentally resolve #117 if it wasn't already resolved.

    → <<cset 57b1190feefd>>

  16. Riot

    @TwoD So, for the record, we've found the original root cause of this, and why we weren't able to reproduce - it's a locale issue!

    The chain of events leading to it were as follows: You'd destroy the last piece of debris by whatever means, and at this point it would try to spawn a powerup from the collision check function. The powerup would, during construction, attempt to read some inline WKT to determine its shape (this was an inefficiency we've got rid of since). However, because your locale presumably specifies decimals as 0,1 rather than 0.1, that WKT reading would try to be cleverly locale-dependent and fail with an exception in the powerup's constructor. This exception would then propagate outwards and be mistakenly understood to be an exception in the collision check algorithm itself. The collision function would then exit early, and fail to complete its other effects, such as checking if the sphere is complete and unlocking it upon completion.

  17. Henrik Danielsson reporter

    @SlowRiot Wow! I believe that's spot on!
    I just got home from a business trip so I haven't had time to try the latest release yet but I wouldn't be surprised if that does indeed fix it.

    Thank you for the detailed explanation, very interesting! Will test later today.
    EDIT: Just noted the change was committed after the release was made so I suppose it'll be in the RC?

  18. Riot

    It will be in the RC1 yes, but we're actually experimenting with moving to rolling releases on Linux only for the rest of the release cycle until public release - we're already set up for nightly builds and deploys on Linux, and it's useful to get tester feedback as frequently as possible, so these fixes will be in tonight's build. They're automatically updated now on itch.io, and if you use the itch client, they'll update for you as soon as there are any new versions.

    Windows and OS X users will just have to wait, though.

  19. Log in to comment