{"action":"created","issue":{"url":"https://api.github.com/repos/pioneerspacesim/pioneer/issues/2403","repository_url":"https://api.github.com/repos/pioneerspacesim/pioneer","labels_url":"https://api.github.com/repos/pioneerspacesim/pioneer/issues/2403/labels{/name}","comments_url":"https://api.github.com/repos/pioneerspacesim/pioneer/issues/2403/comments","events_url":"https://api.github.com/repos/pioneerspacesim/pioneer/issues/2403/events","html_url":"https://github.com/pioneerspacesim/pioneer/issues/2403","id":18475906,"number":2403,"title":"SIGFPE from terrain generation not having well-defined bounds","user":{"login":"lwho","id":1851410,"avatar_url":"https://avatars.githubusercontent.com/u/1851410?v=3","gravatar_id":"","url":"https://api.github.com/users/lwho","html_url":"https://github.com/lwho","followers_url":"https://api.github.com/users/lwho/followers","following_url":"https://api.github.com/users/lwho/following{/other_user}","gists_url":"https://api.github.com/users/lwho/gists{/gist_id}","starred_url":"https://api.github.com/users/lwho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lwho/subscriptions","organizations_url":"https://api.github.com/users/lwho/orgs","repos_url":"https://api.github.com/users/lwho/repos","events_url":"https://api.github.com/users/lwho/events{/privacy}","received_events_url":"https://api.github.com/users/lwho/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pioneerspacesim/pioneer/labels/Crash%20or%20hang","name":"Crash or hang","color":"c70000"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2013-08-23T15:21:34Z","updated_at":"2016-05-25T13:13:51Z","closed_at":"2016-05-25T10:34:12Z","body":"This was originally reported in #2399 by @walterar\r\n\r\nI was able to reproduce the crash with clean master ef56f0c4d6427fdfd54eccd78edf6e4807f93fc5 as follows:\r\n\r\n- Start on Patterson's Mine, just add the following to `buttonDefs ` in `data/ui/MainMenu.lua` and select it on start:\r\n`        { t(\"Start at Patterson's Mine\"),    function () Game.StartGame(SystemPath.New(12,4,-5,1,8))   setupPlayerWave() end },`\r\n\r\n- Do the following in LUA console:\r\n```lua\r\np = Game.player\r\nplanet = p.frameBody\r\ns = Space.SpawnShipLanded(\"wave\", planet, math.deg2rad(7.1717977797), math.deg2rad(-172.82820222029))\r\ns:AIFlyTo(p)\r\n```\r\n\r\nand it will immediately crash:\r\n\r\n```\r\nProgram received signal SIGFPE, Arithmetic exception.\r\n0x00000000005bbf91 in fastfloor (x=-6171278444.9345226) at ../../src/perlin.cpp:55\r\n55      static int fastfloor( const double x ) { return int(x > 0 ? x : x - 1); }\r\n(gdb) bt\r\n#0  0x00000000005bbf91 in fastfloor (x=-6171278444.9345226) at ../../src/perlin.cpp:55\r\n#1  0x00000000005bc090 in noise (x=-582540794.27544403, y=587133946.82504165, z=-4629607121.8382912) at ../../src/perlin.cpp:117\r\n#2  0x0000000000658c5f in noise (p=...) at ../../../src/terrain/../perlin.h:11\r\n#3  0x0000000000658e90 in TerrainNoise::billow_octavenoise (octaves=0, roughness=0.13030215574804646, lacunarity=4.4139197324889681, \r\n    p=...) at ../../../src/terrain/TerrainNoise.h:132\r\n#4  0x0000000000658de3 in TerrainHeightFractal<TerrainHeightBarrenRock2>::GetHeight (this=0xbd4c880, p=...)\r\n    at ../../../src/terrain/TerrainHeightBarrenRock2.cpp:26\r\n#5  0x00000000005a5f26 in GeoSphere::GetHeight (this=0xbd4c700, p=...) at ../../src/GeoSphere.h:39\r\n#6  0x00000000005a5e7d in TerrainBody::GetTerrainHeight (this=0xbd4c3f0, pos_=...) at ../../src/TerrainBody.cpp:129\r\n#7  0x0000000000550cc8 in Ship::Blastoff (this=0xc9b6d40) at ../../src/Ship.cpp:660\r\n#8  0x0000000000556396 in LaunchShip (ship=0xc9b6d40) at ../../src/ShipAICmd.cpp:194\r\n#9  0x000000000055ba11 in AICmdFormation::TimeStepUpdate (this=0x1cba3080) at ../../src/ShipAICmd.cpp:1102\r\n#10 0x000000000054b29c in Ship::AITimeStep (this=0xc9b6d40, timeStep=0.0166666675) at ../../src/Ship-AI.cpp:77\r\n#11 0x000000000055d55f in ShipController::StaticUpdate (this=0xb4b2420, timeStep=0.0166666675) at ../../src/ShipController.cpp:18\r\n#12 0x0000000000552863 in Ship::StaticUpdate (this=0xc9b6d40, timeStep=0.0166666675) at ../../src/Ship.cpp:961\r\n#13 0x000000000057c511 in Space::TimeStep (this=0xbdac960, step=0.0166666675) at ../../src/Space.cpp:769\r\n#14 0x000000000046a034 in Game::TimeStep (this=0xbdac650, step=0.0166666675) at ../../src/Game.cpp:240\r\n#15 0x0000000000514a74 in Pi::MainLoop () at ../../src/Pi.cpp:1001\r\n#16 0x000000000051469f in Pi::Start () at ../../src/Pi.cpp:937\r\n#17 0x00000000005bbdb4 in main (argc=1, argv=0x7fffffffdfb8) at ../../src/main.cpp:58\r\n```\r\n\r\nAs you see, `x` has a value that doesn't fit into an `int` letting the cast fail."},"comment":{"url":"https://api.github.com/repos/pioneerspacesim/pioneer/issues/comments/221571778","html_url":"https://github.com/pioneerspacesim/pioneer/issues/2403#issuecomment-221571778","issue_url":"https://api.github.com/repos/pioneerspacesim/pioneer/issues/2403","id":221571778,"user":{"login":"fluffyfreak","id":825083,"avatar_url":"https://avatars.githubusercontent.com/u/825083?v=3","gravatar_id":"","url":"https://api.github.com/users/fluffyfreak","html_url":"https://github.com/fluffyfreak","followers_url":"https://api.github.com/users/fluffyfreak/followers","following_url":"https://api.github.com/users/fluffyfreak/following{/other_user}","gists_url":"https://api.github.com/users/fluffyfreak/gists{/gist_id}","starred_url":"https://api.github.com/users/fluffyfreak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fluffyfreak/subscriptions","organizations_url":"https://api.github.com/users/fluffyfreak/orgs","repos_url":"https://api.github.com/users/fluffyfreak/repos","events_url":"https://api.github.com/users/fluffyfreak/events{/privacy}","received_events_url":"https://api.github.com/users/fluffyfreak/received_events","type":"User","site_admin":false},"created_at":"2016-05-25T13:13:51Z","updated_at":"2016-05-25T13:13:51Z","body":"No it's just done in the cameras*(/CameraController)*"}}
{"actor":{"display_login":"fluffyfreak"}}