2025-07-20 19:46 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002036Spring engineLinuxpublic2010-08-24 11:19
Reporterpfudd 
Assigned Tohoijui 
PrioritynormalSeveritycrashReproducibilityalways
StatusresolvedResolutionfixed 
Product Version0.82.3+git 
Target VersionFixed in Version0.82.4 
Summary0002036: SigSegV just as com captures enemy const vehicle
DescriptionThe construction vehicle was building a laser turret, my commander tried to capture it. I can't tell, but I think it had just succeeded in capturing when the screen disappeared and a sigsegv dialog box popped up.

Mod: balanced annihiliation
Map: small divide
AI: Skirmish AI: AAI 0.9

OS: Fedora 12
Fresh download of spring from git, compiled yesterday
Additional Informationusing default configuration source "/home/croot/.springrc"
[CMyMath::Init] CPU SSE mask: 112, flags:
    SSE 1.0: 1, SSE 2.0: 1
    SSE 3.0: 0, SSSE 3.0: 0
    SSE 4.1: 0, SSE 4.2: 0
    SSE 4.0A: 0, SSE 5.0A: 0
    using streflop SSE FP-math mode, CPU supports SSE instructions
OS: Linux
OS: 32bit native mode
LogOutput initialized.
Spring 0.82+.3.0
Build date/time: Aug 14 2010 20:55:11
Available log subsystems: CollisionVolume, unit, ArchiveScanner, VFS-detail, VFS, Sound
Enabled log subsystems: Sound
Enable or disable log subsystems using the LogSubsystems configuration key
  or the SPRING_LOG_SUBSYSTEMS environment variable (both comma separated).
Using read-write data directory: /home/croot/.spring/
Using read-only data directory: /usr/local/share/games/spring/
Scanning: /usr/local/share/games/spring/base
Scanning: /home/croot/.spring/mods
Supported Video modes: 1600x1200, 1400x1050, 1280x1024, 1280x960, 1152x864, 1024x768, 960x720, 928x696, 896x672, 832x624, 800x600, 720x400, 640x512, 640x480, 640x400, 640x350, 576x432, 512x384, 416x312, 400x300, 360x200, 320x240, 320x200, 320x175
Video mode set to 1024x768/32bit
SDL: 1.2.13
GL: 1.5.8 NVIDIA 96.43.16
GL: NVIDIA Corporation
GL: GeForce4 MX 440/AGP/SSE2
GLSL: 1.20 NVIDIA via Cg compiler
GLEW: 1.5.1
Joysticks found: 0
Joystick 0 not found
Connecting to local server
Starting GameServer: 16 ms
Starting demo recording
Using map SmallDivide
Recording demo demos/20100815_142741_SmallDivide_0.82+.3.sdf
Using mod Balanced Annihilation V7.14
Sound: OpenAL info:
Sound: Vendor: OpenAL Community
Sound: Version: 1.1 ALSOFT 1.12.854
Sound: Renderer: OpenAL Soft
Sound: AL Extensions: AL_EXTX_buffer_sub_data AL_EXT_DOUBLE AL_EXT_EXPONENT_DISTANCE AL_EXT_FLOAT32 AL_EXT_IMA4 AL_EXT_LINEAR_DISTANCE AL_EXT_MCFORMATS AL_EXT_MULAW AL_EXT_MULAW_MCFORMATS AL_EXT_OFFSET AL_EXTX_sample_buffer_object AL_EXT_source_distance_model AL_LOKI_quadriphonic
Sound: ALC Extensions: ALC_ENUMERATE_ALL_EXT ALC_ENUMERATION_EXT ALC_EXT_CAPTURE ALC_EXT_disconnect ALC_EXT_EFX ALC_EXT_thread_local_context
Sound: ALC_EXT_EFX found (required for air absorption): yes
Sound: Device: PulseAudio Software
Using mod archive BA714.sd7
Loading client data: 100 ms
User number 0 (team 0, allyteam 0)
Sound: Available Devices:
Sound: PulseAudio Software
Sound: ALSA Software
Sound: PortAudio Software
Sound: air absorption disabled
Sound: parsed 25 sounds from gamedata/sounds.lua
Loading sounds: 1 ms
Camera and mouse: 142 ms
Parsing unit icons
Loading GameData Definitions
Loading all definitions: 0.886000
Loading GameData Definitions: 972 ms
Parsing Map Information
Loading SMF
Loading Map
Calculating smooth height mesh
Calculating smooth mesh: 130 ms
Number of damage types: 40
Creating unit textures
framebuffer not valid!
Loading weapon definitions
Loading unit definitions
Loading feature definitions
Initializing map features
Reading estimate path costs
[CPathManager] pathing data checksum: c0247d49
shadows disabled or required OpenGL extension missing
Loading .smt tile-file "maps/SmallDivide.smt"
Loading 4898 tiles from file 1/1
Reading tiles
Reading tile map
generating MipMaps: 3 ms
Creating Projectile Textures
[LoadModelShaders] OpenGL ARB extensions missing for advanced unit shading
Creating sky
Loading console: 1 ms
Loading LuaRules
Loaded gadget: No Self-D <unit_prevent_share_selfd.lua>
Loaded gadget: Air Release <unit_air_release_manager.lua>
Loaded gadget: AirPlantParents <unit_air_plants.lua>
Loaded gadget: DirectControl <unit_direct_control.lua>
Loaded gadget: DragonsDisguise <unit_set_neutral.lua>
Loaded gadget: DroppedStartPos <unit_fix_dropped_startpos.lua>
Loaded gadget: FinishedBuilding <unit_finished_building.lua>
Loaded gadget: MissileControl <unit_missile_delay.lua>
Loaded gadget: Napalm <lups_napalm.lua>
Loaded gadget: No Land Damage <unit_no_land_damage.lua>
Loaded gadget: No Self Pwn <unit_noselfpwn.lua>
Loaded gadget: NoCost <cmd_nocost.lua>
Loaded gadget: PassiveBuilders <unit_passive_builders.lua>
Loaded gadget: Prevent Lab Hax <unit_prevent_lab_hax.lua>
Loaded gadget: Prevent Load Hax <unit_prevent_load_hax.lua>
Loaded gadget: Prevent Range Hax <unit_prevent_range_hax.lua>
Loaded gadget: Prevent Strange Orders <unit_prevent_strange_orders.lua>
Loaded gadget: Reclaim Fix <unit_reclaim_fix.lua>
Loaded gadget: ShieldDrain <unit_shield_watch.lua>
Loaded gadget: Shockwaves <lups_shockwaves.lua>
Loaded gadget: Spawn <init_game_spawn.lua>
Loaded gadget: Start Point Remover Gadget <init_start_point_remover_gadget.lua>
Loaded gadget: fx_reclaim_shards <fx_reclaim_shards.lua>
Loaded gadget: lups_wrapper.lua <lups_wrapper.lua>
Loaded gadget: Area Attack <areaattack.lua>
Loaded gadget: C Is For Control <comiscontrol.lua>
Loaded gadget: Team Com Ends <teamcomends.lua>
Loaded gadget: LupsSyncedManager <lups_manager.lua>
Loaded gadget: Mex Upgrader Gadget <unit_mex_upgrader.lua>
Loaded gadget: Air Release <unit_air_release_manager.lua>
Loaded gadget: AirPlantParents <unit_air_plants.lua>
Loaded gadget: DragonsDisguise <unit_set_neutral.lua>
Loaded gadget: DroppedStartPos <unit_fix_dropped_startpos.lua>
Loaded gadget: FinishedBuilding <unit_finished_building.lua>
Loaded gadget: MissileControl <unit_missile_delay.lua>
Loaded gadget: Napalm <lups_napalm.lua>
Loaded gadget: NoCost <cmd_nocost.lua>
Loaded gadget: PassiveBuilders <unit_passive_builders.lua>
Loaded gadget: Reclaim Fix <unit_reclaim_fix.lua>
Loaded gadget: ShieldDrain <unit_shield_watch.lua>
Loaded gadget: Shockwaves <lups_shockwaves.lua>
Loaded gadget: Start Point Remover Gadget <init_start_point_remover_gadget.lua>
Loaded gadget: fx_reclaim_shards <fx_reclaim_shards.lua>
Loaded gadget: mo_enemywrecks <mo_enemywrecks.lua>
Loaded gadget: mo_greenfields <mo_greenfields.lua>
Loaded gadget: mo_noowner <mo_noowner.lua>
Loaded gadget: mo_noshare <mo_noshare.lua>
Loaded gadget: mo_nowrecks <mo_nowrecks.lua>
Loaded gadget: Area Attack <areaattack.lua>
Loaded gadget: C Is For Control <comiscontrol.lua>
Loaded gadget: LupsSyncedManager <lups_manager.lua>
Loaded gadget: Mex Upgrader Gadget <unit_mex_upgrader.lua>
Loaded gadget: Lups <lups_wrapper.lua>
Loading LuaGaia
Loading LuaUI
Using LUAUI_DIRNAME = LuaUI/
Reloaded ctrlpanel with: LuaUI/ctrlpanel.txt
LuaUI: bound F11 to the widget selector
LuaUI: bound CTRL+F11 to tweak mode
Hardware is incompatible with Xray shader requirements
blur api: texture error
Hardware is incompatible with Xray shader requirements
Loaded widget from mod: Red_UI_Framework <red_ui_framework.lua>
blur api: your hardware is missing the necessary RenderToTexture feature
Loaded widget from mod: BlurApi <api_gfx_blur.lua>
Loaded widget from mod: MexUpg Helper <helper.lua>
Loaded widget from mod: Red Tooltip <gui_red_tooltip.lua>
Loaded widget from mod: HealthBars <unit_healthbars.lua>
Loaded widget from mod: Ally Resource Bars <gui_ally_res.lua>
Loaded widget from mod: BuildETA <gui_build_eta.lua>
Loaded widget from mod: Auto First Build Facing <autofirstbuildfacing.lua>
Loaded widget from mod: Autoquit <autoquit.lua>
Loaded widget from mod: Build Split <cmd_buildsplit.lua>
Loaded widget from mod: CustomIcons <unit_customicons.lua>
Loaded widget from mod: Defense Range <gui_defenserange.lua>
Loaded widget from mod: Loop Select <unit_loop_select.lua>
Loaded widget from mod: GameTypeInfo <gui_game_type_info.lua>
Loaded widget from mod: MohoExploiter <unit_moho_exploiter.lua>
Loaded widget from mod: Ghost Site <unit_ghostsite.lua>
Loaded widget from mod: MoreSounds <unit_more_sounds.lua>
Loaded widget from mod: NoDuplicateOrders <cmd_no_duplicate_orders.lua>
Loaded widget from mod: Pause Screen <gui_pausescreen.lua>
Loaded widget from mod: Point Tracker <gui_point_tracker.lua>
Loaded widget from mod: ReclaimInfo <gui_reclaiminfo.lua>
Loaded widget from mod: Share Tracker <unit_share_tracker.lua>
Loaded widget from mod: Transporting <gui_transporting.lua>
Loaded widget from mod: Red_Drawing <red_ui_framework_drawing.lua>
Loaded widget from mod: Red Build/Order Menu <gui_red_buildordermenu.lua>
Loaded widget from mod: Red Console <gui_red_console.lua>
Loaded widget from mod: Take Reminder <gui_take_remind.lua>
Loaded widget from mod: Red Resource Bars <gui_red_resourcebars.lua>
Loaded widget from mod: Attack AoE <gui_attack_aoe.lua>
Loaded widget from mod: Red Minimap <gui_red_minimap.lua>
Loaded widget from mod: BA Waypoint Dragger <unit_waypoint_dragger_2.lua>
Loaded widget from mod: Select n Center! <gui_center_n_select.lua>
Loaded widget from mod: LupsManager <gfx_lups_manager.lua>
Loaded widget from mod: BA_AllyCursors <gui_ba_ally_cursors.lua>
Loaded widget from user: Mouse Buildspacing <gui_buildspacing.lua>
Loaded widget from mod: Lups <lups_wrapper.lua>
LolUI is now known as RedUI: if you prefer the old LolUI this can be downloaded to your local widgets
Loaded widget from mod: LolUI <lolui.lua>
Loaded widget from mod: CustomFormations2 <unit_customformations2.lua>
LuaUI v0.3
Finalizing...
Connection attempt from pdragon
 -> Version: 0.82+.3.0
 -> Connection established (given id 0)
Player pdragon finished loading and is now ingame
GameID: dc5b684c5e585ce6eec31ad31cdf4421
pdragon added point: Start 0
<SkirmishAI: AAI 0.9 (team 1)>: land map detected
<SkirmishAI: AAI 0.9 (team 1)>: AAI loaded
Skirmish AI "Enemy" took over control of team 1
Buildings set to face South
Switching to FPS style camera
Switching to Overhead (TA) style camera
Switching to FPS style camera
Switching to Overhead (TA) style camera
Segmentation fault (SIGSEGV) in spring 0.82+.3.0
Stacktrace:
spring() [0x8525317]
[0x63a400]
# NOTE: above line shows no path -> not translating
/usr/local/share/games/spring/AI/Skirmish/AAI/0.9/libSkirmishAI.so(+0x2251c) [0x41d51c]
/usr/local/share/games/spring/AI/Skirmish/AAI/0.9/libSkirmishAI.so(+0x21b0e) [0x41cb0e]
/usr/local/share/games/spring/AI/Skirmish/AAI/0.9/libSkirmishAI.so(+0x4e005) [0x449005]
/usr/local/share/games/spring/AI/Skirmish/AAI/0.9/libSkirmishAI.so(+0x4d9b5) [0x4489b5]
/usr/local/share/games/spring/AI/Skirmish/AAI/0.9/libSkirmishAI.so(handleEvent+0xfe) [0x431bde]
spring() [0x8575476]
spring() [0x858b91f]
spring() [0x85892d5]
spring() [0x8584567]
spring() [0x8467f10]
spring() [0x84c0012]
spring() [0x845bb03]
spring() [0x80ec6fb]
spring() [0x81027b5]
spring() [0x8108661]
spring() [0x84e660b]
spring() [0x84edabd]
spring() [0x8507e53]
spring() [0x85083db]
/lib/libc.so.6(__libc_start_main+0xe6) [0x976bb6]
spring() [0x8085da1]
This stack trace indicates a problem with a Skirmish AI library.
Translated Stacktrace:
addr2line: 'spring/spring': No such file
/home/croot/rpmbuild/SOURCES/spring/AI/Skirmish/AAI/AAI.cpp:456
/home/croot/rpmbuild/SOURCES/spring/AI/Skirmish/AAI/AAI.cpp:906
/home/croot/rpmbuild/SOURCES/spring/AI/Wrappers/LegacyCpp/Event/AIUnitGivenEvent.h:35
/home/croot/rpmbuild/SOURCES/spring/AI/Wrappers/LegacyCpp/AIAI.cpp:174
/home/croot/rpmbuild/SOURCES/spring/AI/Skirmish/AAI/AIExport.cpp:94
addr2line: 'spring/spring': No such file
??:0
addr2line: 'spring/spring': No such file
Spring crashed Segmentation fault (SIGSEGV)
AL lib: ALc.c:1818: alcCloseDevice(): deleting 251 Buffer(s)
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files

-Relationships
+Relationships

-Notes

~0005292

hoijui (reporter)

thanks.. nice report! :-)

the problem seems to be:
when the unit is captured, the engine assigns it to the new team, and then sends out the unit-captured event. The AI then wants to mark it as destroyed (for its team), and therefore, needs to remove it from some lists (eg, from list of builders, if it is a builder). so it does:
unitDestroyed(unitId) {
   if (getUnitDef(unitId)->def_>isBuilder) builders->remove(unit);
}

but becasue the AI is not cheating, and the unit is not marked as dead and still around, but marked as belonging to an other team, the getUnitDef(unitId) call returns NULL.
The AI can not buffer the required info, cause it also requires stuff like unit-death position, for example.


possible solutions:
1. engine internally: instead of transferring a unit, mark the old one as dead, and create a new one for the new team (would get a new unitId)
2. mark the unit as being team-changed, as long as the team-change/captured event is being processed

The first solution may have more wide-spread consequences, while being a bit cleaner in my eyes.

~0005293

Kloot (developer)

3. maintain a mapping from unitID to an AAIUnit structure holding the UnitDef*, position, and other needed information inside AAI

~0005296

hoijui (reporter)

hmm.. though that is a time intensive solution, and possibly had to be repeated for other AIs.

i would prefer if we could solve it in the engine, would be cleaner if done right. i do not like any of these 3 solutions though :/

4. engine internally, send the event in two phases (applies for given and captured):
   1) oldTeam->UnitCaptured()
   2) unit.team = newTeam
   3) newTeam->UnitCaptured()

~0005298

jK (developer)

Last edited: 2010-08-16 19:58

So it is an AI bug that it calls the UnitDestroyed internally instead of handling the UnitCaptured event individual?
AFAIK the UnitCaptured event gets the unitdef as argument (so it's done in Lua).

~0005362

hoijui (reporter)

Last edited: 2010-08-24 10:27

aehm...
fact is, that the unit is not controlled by the team anymore, which means it has to de-register the unit in some internal places, for which some AIs need the unitDef (which is viable). if i copy the code from unit-destroyed into unit-captured, we would see the same bug, so no... that is not the problem, no AI bug.
The C AI interface does not allow such a thing like passing over a unitDef directly, and even that would not solve the problem, as the unit-def would not be all you may need from a unit when it got captured.
the problem is, that the unit should still belong to the old team, when the old team gets the unit-captured event, internally.
4. still seems to be the best solution.

edit:
It is an overall more save solution for this event, not just for AI.

~0005365

hoijui (reporter)

..aaha :D
UnitCaptured & UnitGiven already work exactly as described in 4. :D
doh!
so i just have to do better proxying.

~0005366

hoijui (reporter)

should be fixed by:
http://github.com/spring/spring/commit/4ec46124991469bb8f40da0d770c3c258418499a

Did a test with AAI, giving and capturing from an to the AI, and by the AI team (using /cheat & /team 1).
+Notes

-Issue History
Date Modified Username Field Change
2010-08-15 23:55 pfudd New Issue
2010-08-16 14:47 hoijui Note Added: 0005292
2010-08-16 15:09 Kloot Note Added: 0005293
2010-08-16 17:00 hoijui Note Added: 0005296
2010-08-16 19:58 jK Note Added: 0005298
2010-08-16 19:58 jK Note Edited: 0005298
2010-08-24 10:21 hoijui Note Added: 0005362
2010-08-24 10:27 hoijui Note Edited: 0005362
2010-08-24 11:08 hoijui Note Added: 0005365
2010-08-24 11:19 hoijui Note Added: 0005366
2010-08-24 11:19 hoijui Status new => resolved
2010-08-24 11:19 hoijui Fixed in Version => 0.82.4
2010-08-24 11:19 hoijui Resolution open => fixed
2010-08-24 11:19 hoijui Assigned To => hoijui
+Issue History