Segfault in Terrain::getHeight
Seen while playing the Level 6 challenge.
Thread 1 "lugaru" received signal SIGSEGV, Segmentation fault.
0x00000000004ff580 in Terrain::getHeight (this=0x7434c0 <terrain>, pointx=-nan(0x400000), pointz=-nan(0x400000)) at /home/akien/Projects/lugaru/lugaru/Source/Terrain.cpp:830
830 triangle[0].y = heightmap[tilex][tiley];
(gdb) bt
#0 0x00000000004ff580 in Terrain::getHeight (this=0x7434c0 <terrain>, pointx=-nan(0x400000), pointz=-nan(0x400000)) at /home/akien/Projects/lugaru/lugaru/Source/Terrain.cpp:830
#1 0x00000000004b68f7 in Person::FootLand (this=0x6c1ca40, whichfoot=leftfoot, opacity=1) at /home/akien/Projects/lugaru/lugaru/Source/Person.cpp:1861
#2 0x000000000047972f in Game::Tick () at /home/akien/Projects/lugaru/lugaru/Source/GameTick.cpp:5739
#3 0x0000000000408e3b in DoUpdate () at /home/akien/Projects/lugaru/lugaru/Source/main.cpp:407
#4 0x00000000004094bb in main (argc=0, argv=0x7fffffffdc08) at /home/akien/Projects/lugaru/lugaru/Source/main.cpp:661
(gdb) bt full
#0 0x00000000004ff580 in Terrain::getHeight (this=0x7434c0 <terrain>, pointx=-nan(0x400000), pointz=-nan(0x400000)) at /home/akien/Projects/lugaru/lugaru/Source/Terrain.cpp:830
tilex = -2147483648
tiley = -2147483648
startpoint = {x = -nan(0x400000), y = -1000, z = -nan(0x400000)}
endpoint = {x = -nan(0x400000), y = 1000, z = -nan(0x400000)}
intersect = {x = 101.799751, y = 13.564209, z = 104.777313}
triangle = {{x = -2.14748365e+09, y = 13.5733337, z = -2.14748365e+09}, {x = 102, y = 13.4799995, z = 105}, {x = 101, y = 13.7966671, z = 105}}
#1 0x00000000004b68f7 in Person::FootLand (this=0x6c1ca40, whichfoot=leftfoot, opacity=1) at /home/akien/Projects/lugaru/lugaru/Source/Person.cpp:1861
terrainlight = {x = 0.67930758, y = 0.67930758, z = 0.735045075}
footvel = {x = 0, y = 0.800000012, z = 0}
footpoint = {x = -nan(0x400000), y = 80.9341736, z = -nan(0x400000)}
#2 0x000000000047972f in Game::Tick () at /home/akien/Projects/lugaru/lugaru/Source/GameTick.cpp:5739
absflatfacing = {x = -0.238310188, y = 0, z = 0.971189082}
oldtargetyaw = 191.828751
i = 1
talkdelay = -186.581009
hotspotvisual = {0 <repeats 40 times>}
oldviewer = {x = 614.71991, y = 82.6275101, z = 629.502441}
vel = {2.49077272, -0.33995682, 0.0403909087}
upvector = {x = -0.142304897, y = 0.939692557, z = 0.311009943}
respawnkeydown = false
movekey = true
gLoc = {614.71991, 82.6275101, 629.502441}
ori = {0.39097935, -0.342020214, -0.854492426, 0.142304897, 0.939692557, -0.311009943}
oldwinfreeze = 0
facing = {x = -0.39097935, y = -0.342020214, z = 0.854492426}
flatfacing = {x = -0.238310188, y = 0, z = 0.971189082}
target = -2
#3 0x0000000000408e3b in DoUpdate () at /home/akien/Projects/lugaru/lugaru/Source/main.cpp:407
i = 1
sps = 200
count = 3
oldmult = 0.0136000011
#4 0x00000000004094bb in main (argc=0, argv=0x7fffffffdc08) at /home/akien/Projects/lugaru/lugaru/Source/main.cpp:661
e = {type = 771, common = {type = 771, timestamp = 242250}, window = {type = 771, timestamp = 242250, windowID = 2, event = 100 'd', padding1 = 0 '\000', padding2 = 0 '\000',
padding3 = 0 '\000', data1 = 37089104, data2 = 0}, key = {type = 771, timestamp = 242250, windowID = 2, state = 100 'd', repeat = 0 '\000', padding2 = 0 '\000',
padding3 = 0 '\000', keysym = {scancode = 37089104, sym = 0, mod = 27904, unused = 2541518668}}, edit = {type = 771, timestamp = 242250, windowID = 2,
text = "d\000\000\000P\357\065\002\000\000\000\000\000m75L\177|\227\320\351\065\002\000\000\000\000p\352\065\002", start = 0, length = -10416}, text = {type = 771,
timestamp = 242250, windowID = 2, text = "d\000\000\000P\357\065\002\000\000\000\000\000m75L\177|\227\320\351\065\002\000\000\000\000p\352\065\002"}, motion = {type = 771,
timestamp = 242250, windowID = 2, which = 100, state = 37089104, x = 0, y = 892824832, xrel = -1753448628, yrel = 37087696}, button = {type = 771, timestamp = 242250,
windowID = 2, which = 100, button = 80 'P', state = 239 '\357', clicks = 53 '5', padding1 = 2 '\002', x = 0, y = 892824832}, wheel = {type = 771, timestamp = 242250,
windowID = 2, which = 100, x = 37089104, y = 0, direction = 892824832}, jaxis = {type = 771, timestamp = 242250, which = 2, axis = 100 'd', padding1 = 0 '\000',
padding2 = 0 '\000', padding3 = 0 '\000', value = -4272, padding4 = 565}, jball = {type = 771, timestamp = 242250, which = 2, ball = 100 'd', padding1 = 0 '\000',
padding2 = 0 '\000', padding3 = 0 '\000', xrel = -4272, yrel = 565}, jhat = {type = 771, timestamp = 242250, which = 2, hat = 100 'd', value = 0 '\000', padding1 = 0 '\000',
padding2 = 0 '\000'}, jbutton = {type = 771, timestamp = 242250, which = 2, button = 100 'd', state = 0 '\000', padding1 = 0 '\000', padding2 = 0 '\000'}, jdevice = {
type = 771, timestamp = 242250, which = 2}, caxis = {type = 771, timestamp = 242250, which = 2, axis = 100 'd', padding1 = 0 '\000', padding2 = 0 '\000', padding3 = 0 '\000',
value = -4272, padding4 = 565}, cbutton = {type = 771, timestamp = 242250, which = 2, button = 100 'd', state = 0 '\000', padding1 = 0 '\000', padding2 = 0 '\000'}, cdevice = {
type = 771, timestamp = 242250, which = 2}, adevice = {type = 771, timestamp = 242250, which = 2, iscapture = 100 'd', padding1 = 0 '\000', padding2 = 0 '\000',
padding3 = 0 '\000'}, quit = {type = 771, timestamp = 242250}, user = {type = 771, timestamp = 242250, windowID = 2, code = 100, data1 = 0x235ef50,
data2 = 0x977c7f4c35376d00}, syswm = {type = 771, timestamp = 242250, msg = 0x6400000002}, tfinger = {type = 771, timestamp = 242250, touchId = 429496729602,
fingerId = 37089104, x = 6.83314283e-07, y = -8.15862628e-25, dx = 1.33648807e-37, dy = 0, pressure = 1.33650601e-37}, mgesture = {type = 771, timestamp = 242250,
touchId = 429496729602, dTheta = 1.33664592e-37, dDist = 0, x = 6.83314283e-07, y = -8.15862628e-25, numFingers = 59856, padding = 565}, dgesture = {type = 771,
timestamp = 242250, touchId = 429496729602, gestureId = 37089104, numFingers = 892824832, error = -8.15862628e-25, x = 1.33648807e-37, y = 0}, drop = {type = 771,
timestamp = 242250, file = 0x6400000002 <error: Cannot access memory at address 0x6400000002>, windowID = 37089104},
padding = "\003\003\000\000J\262\003\000\002\000\000\000d\000\000\000P\357\065\002\000\000\000\000\000m75L\177|\227\320\351\065\002\000\000\000\000p\352\065\002\000\000\000\000P\327\377\377\377\177\000"}
gameDone = false
gameFocused = true
stats = {buffer_max = 1, options_max = 9}
parse = {op_count = 0, nonop_count = 0, nonop_args = 0x0, err = false}
Looks like some integer overflow.