View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0002206 | Spring engine | Lua | public | 2010-11-05 08:41 | 2010-11-21 02:15 |
| Reporter | Assigned To | ||||
| Priority | normal | Severity | crash | Reproducibility | always |
| Status | closed | Resolution | no change required | ||
| Product Version | 0.82.6.1 | ||||
| Summary | 0002206: another way of Lua crashing spring.exe Spring.GiveOrderToUnit in DrawWorldPreUnit | ||||
| Description | using GiveOrderToUnit in DrawWorldPreUnit crashes spring.exe should such things even be reported or is it so stupid nobody would try anyway? | ||||
| Additional Information | widget: function widget:GetInfo() return { name = "ground normals", desc = "some stuff with ground normals", author = "knorke", date = "5 Nov 2010", license = "GNU GPL, v2 or later or horse", layer = 0, enabled = true, -- loaded by default? } end local unit = nil function widget:UnitFinished(unitID, unitDefID, teamID) unit=unitID end function widget:DrawWorldPreUnit() if (unit==nil) then return end local x,y,z=Spring.GetUnitPosition (unit) gl.LineWidth(5.0) local gnx,gny,gnz = Spring.GetGroundNormal (x,z) gl.DrawGroundCircle (x,Spring.GetGroundHeight(x, z),z, 50, 16) Spring.Echo ("->" .. gnx .." " .. gny .. " " .. gnz) for d = 0, 100, 50 do local x2=x+(gnx*d) local y2=y+(gny*d) local z2=z+(gnz*d) gl.DrawGroundCircle (x2,Spring.GetGroundHeight(x2, z2),z2, 10, 16) end Spring.GiveOrderToUnit(unit, CMD.MOVE , {x2, y2, z2 }, {}) end infolog: --blablablabla-- [ 0] Finalizing... [ 0] Connection attempt from unnamed [ 0] -> Version: 0.82.6.1 (0.82.6.1) [ 0] -> Connection established (given id 0) [ 0] Player unnamed finished loading and is now ingame [ 0] GameID: 1fb5d34caa7ff56111fab4df2e2f9a16 [ 0] unnamed added point: Start 0 [ 0] ->0.0042341877706349 0.99998652935028 0.00070566195063293 [ 15] ->0.0042341877706349 0.99998652935028 0.00070566195063293 [ 23] ->0.0042341877706349 0.99998652935028 0.00070566195063293 [ 23] Spring 0.82.6.1 (0.82.6.1) has crashed. [ 23] Exception: Access violation (0xc0000005) [ 23] Exception Address: 0x0090a7a5 [ 23] DLL information: [ 23] 0x00400000 spring [ 23] 0x7c910000 ntdll [ 23] 0x7c800000 kernel32 [ 23] 0x10000000 DevIL [ 23] 0x77be0000 MSVCRT [ 23] 0x77da0000 ADVAPI32 [ 23] 0x77e50000 RPCRT4 [ 23] 0x68fc0000 GLU32 [ 23] 0x5f0d0000 OPENGL32 [ 23] 0x77ef0000 GDI32 [ 23] 0x7e360000 USER32 [ 23] 0x736d0000 DDRAW [ 23] 0x73b30000 DCIMAN32 [ 23] 0x76c50000 IMAGEHLP [ 23] 0x6fbc0000 mingwm10 [ 23] 0x7e670000 SHELL32 [ 23] 0x77f40000 SHLWAPI [ 23] 0x71a10000 WS2_32 [ 23] 0x71a00000 WS2HELP [ 23] 0x61b80000 zlib1 [ 23] 0x70780000 vorbisfile [ 23] 0x68140000 ogg [ 23] 0x64cc0000 vorbis [ 23] 0x6b600000 OpenAL32 [ 23] 0x76af0000 WINMM [ 23] 0x66fc0000 freetype6 [ 23] 0x62aa0000 glew32 [ 23] 0x01190000 SDL [ 23] 0x7c340000 MSVCR71 [ 23] 0x76330000 IMM32 [ 23] 0x773a0000 comctl32 [ 23] 0x5d450000 comctl32 [ 23] 0x73e70000 dsound [ 23] 0x774b0000 ole32 [ 23] 0x77bd0000 VERSION [ 23] 0x76bf0000 WINTRUST [ 23] 0x77a50000 CRYPT32 [ 23] 0x77af0000 MSASN1 [ 23] 0x72c90000 wdmaud [ 23] 0x72c80000 msacm32 [ 23] 0x77bb0000 MSACM32 [ 23] 0x77ba0000 midimap [ 23] 0x746a0000 MSCTF [ 23] 0x75250000 msctfime [ 23] 0x770f0000 OLEAUT32 [ 23] 0x69500000 nvoglnt [ 23] 0x72210000 DINPUT [ 23] 0x68d90000 HID [ 23] 0x778f0000 SETUPAPI [ 23] 0x719b0000 mswsock [ 23] 0x66710000 hnetcfg [ 23] 0x719f0000 wshtcpip [ 23] 0x73e40000 KsUser [ 23] 0x59dd0000 DBGHELP [ 23] Stacktrace: [ 23] (0) F:\Spiele\Spring_81\spring.exe [0x0050A7A5] [ 23] (1) F:\Spiele\Spring_81\spring.exe [0x0050AAAE] [ 23] (2) F:\Spiele\Spring_81\spring.exe [0x00510978] [ 23] (3) F:\Spiele\Spring_81\spring.exe [0x004F426B] [ 23] (4) F:\Spiele\Spring_81\spring.exe [0x00504BF5] [ 23] (5) F:\Spiele\Spring_81\spring.exe [0x0050AF08] [ 23] (6) F:\Spiele\Spring_81\spring.exe [0x004F9E94] [ 23] (7) F:\Spiele\Spring_81\spring.exe [0x0002956E] [ 23] (8) F:\Spiele\Spring_81\spring.exe [0x0002B400] [ 23] (9) F:\Spiele\Spring_81\spring.exe [0x005869F1] [ 23] (10) F:\Spiele\Spring_81\spring.exe [0x00591D39] [ 23] (11) F:\Spiele\Spring_81\spring.exe [0x00592064] [ 23] (12) F:\Spiele\Spring_81\spring.exe [0x00592840] [ 23] (13) F:\Spiele\Spring_81\spring.exe [0x000010A7] [ 23] (14) F:\Spiele\Spring_81\spring.exe [0x00001123] [ 23] (15) E:\WINDOWS\system32\kernel32.dll(RegisterWaitForInputIdle+0x49) [0x7C816FF7] dont be fooled by foldername, it is actually: Spring 0.82.6.1 (0.82.6.1) Build date/time: Oct 15 2010 20:04:51 | ||||
| Tags | No tags attached. | ||||
| Checked infolog.txt for Errors | |||||
|
|
"should such things even be reported" not when it is clearly a PEBKAC case (take a good look at your code again, and pay special attention to the scope of the *2 variables you pass to GiveOrderToUnit) function widget:DrawWorldPreUnit() local x,y,z=Spring.GetUnitPosition (unit) for d = 0, 100, 50 do local x2=x+(gnx*d) local y2=y+(gny*d) local z2=z+(gnz*d) end Spring.GiveOrderToUnit(unit, CMD.MOVE , {x2, y2, z2}, {}) end |