View Issue Details

IDProjectCategoryView StatusLast Update
0002975FSSCPtablespublic2013-12-07 06:13
ReporterEchelon9 Assigned ToEchelon9  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.7.0 
Target Version3.7.1 
Summary0002975: AddressSanitizer: global-buffer-overflow in HudGaugeLeadSight::render()
DescriptionReported by AddressSanitizer, a memory error detector for C/C++, in FS2Open builds based on trunk r10204.

ERROR: AddressSanitizer: global-buffer-overflow on address 0x000104cc0688 at pc 0x1009b32fd bp 0x7fff5fbfc0b0 sp 0x7fff5fbfc0a8
READ of size 4 at 0x000104cc0688 thread T0
==31500==WARNING: Trying to symbolize code, but external symbolizer is not initialized!
    #0 0x1009b32fc in HudGaugeLeadSight::render hudtarget.cpp:4291
    0000001 0x100cc5331 in hud_render_gauges hud.cpp:1820
    0000002 0x100cc3f6e in hud_render_all hud.cpp:1759
    0000003 0x10016f384 in game_render_hud freespace.cpp:4175
    0000004 0x100173c2c in game_frame freespace.cpp:4447
    0000005 0x100178a9b in game_do_frame freespace.cpp:4815
    0000006 0x1001846d0 in game_do_state freespace.cpp:6495
    0000007 0x1007be722 in gameseq_process_events gamesequence.cpp:409
    0000008 0x10018b108 in game_main freespace.cpp:7062
    ....
Steps To Reproduce1. Utilise a version of Clang that supports AddressSantizer (https://code.google.com/p/address-sanitizer/wiki/AddressSanitizer).
2. Build with -fsanitize=address C/C++ flag
3. Run the game with Diaspora. Play through Flight, and as soon as you leave the launch tube hit H to hostile target.
Additional InformationERROR: AddressSanitizer: global-buffer-overflow on address 0x000104cc0688 at pc 0x1009b32fd bp 0x7fff5fbfc0b0 sp 0x7fff5fbfc0a8
READ of size 4 at 0x000104cc0688 thread T0
==31500==WARNING: Trying to symbolize code, but external symbolizer is not initialized!
    #0 0x1009b32fc in HudGaugeLeadSight::render hudtarget.cpp:4291
    0000001 0x100cc5331 in hud_render_gauges hud.cpp:1820
    0000002 0x100cc3f6e in hud_render_all hud.cpp:1759
    0000003 0x10016f384 in game_render_hud freespace.cpp:4175
    0000004 0x100173c2c in game_frame freespace.cpp:4447
    0000005 0x100178a9b in game_do_frame freespace.cpp:4815
    0000006 0x1001846d0 in game_do_state freespace.cpp:6495
    0000007 0x1007be722 in gameseq_process_events gamesequence.cpp:409
    0000008 0x10018b108 in game_main freespace.cpp:7062
    0000009 0x10018c876 in SDL_main freespace.cpp:7196
    0000010 0x100003171 in -[SDLMain applicationDidFinishLaunching:] SDLMain.m:300
    #11 0x7fff8df88fcb in __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ (in CoreFoundation) + 11
    0000012 0x7fff8de7cc5c in _CFXNotificationPost (in CoreFoundation) + 2892
    0000013 0x7fff85e6d4a9 in -[NSNotificationCenter postNotificationName:object:userInfo:] (in Foundation) + 67
    0000014 0x7fff8ae42b78 in -[NSApplication _postDidFinishNotification] (in AppKit) + 288
    0000015 0x7fff8ae428ab in -[NSApplication _sendFinishLaunchingNotification] (in AppKit) + 194
    0000016 0x7fff8ae3f795 in -[NSApplication(NSAppleEventHandling) _handleAEOpenEvent:] (in AppKit) + 569
    0000017 0x7fff8ae3f1ea in -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] (in AppKit) + 241
    0000018 0x7fff85e8bea9 in -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] (in Foundation) + 293
    0000019 0x7fff85e8bd1c in _NSAppleEventManagerGenericHandler (in Foundation) + 105
    0000020 0x7fff8d19fe1e in aeDispatchAppleEvent(AEDesc const*, AEDesc*, unsigned int, unsigned char*) (in AE) + 380
    0000021 0x7fff8d19fc31 in dispatchEventAndSendReply(AEDesc const*, AEDesc*) (in AE) + 30
    0000022 0x7fff8d19fb35 in aeProcessAppleEvent (in AE) + 314
    0000023 0x7fff8aa4f5f0 in AEProcessAppleEvent (in HIToolbox) + 55
    0000024 0x7fff8ae3b0f5 in _DPSNextEvent (in AppKit) + 1025
    0000025 0x7fff8ae3a8da in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in AppKit) + 121
    0000026 0x7fff8ae2e9cb in -[NSApplication run] (in AppKit) + 552
    0000027 0x100005261 in CustomApplicationMain SDLMain.m:227
    0000028 0x100004d3a in main SDLMain.m:377
    0000029 0x100001d03 in start (in FS2_Open (debug)) + 51
    0000030 0x0 in 0x0

0x000104cc0688 is located 259144 bytes to the right of global variable 'Weapons' from 'fs2open/trunk/fs2_open/code/weapon/weapons.cpp' (0x104b39040) of size 1344000
SUMMARY: AddressSanitizer: global-buffer-overflow ??:0 ??
Shadow bytes around the buggy address:
  0x100020998080: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
  0x100020998090: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
  0x1000209980a0: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
  0x1000209980b0: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
  0x1000209980c0: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
=>0x1000209980d0: f9[f9]f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
  0x1000209980e0: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
  0x1000209980f0: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
  0x100020998100: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
  0x100020998110: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
  0x100020998120: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable: 00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone: fa
  Heap right redzone: fb
  Freed heap region: fd
  Stack left redzone: f1
  Stack mid redzone: f2
  Stack right redzone: f3
  Stack partial redzone: f4
  Stack after return: f5
  Stack use after scope: f8
  Global redzone: f9
  Global init order: f6
  Poisoned by user: f7
  Contiguous container OOB:fc
  ASan internal: fe
==31500==ABORTING
TagsNo tags attached.

Activities

Echelon9

2013-12-07 06:13

developer   ~0015511

Fix committed to trunk@10205.

Related Changesets

fs2open: trunk r10205

2013-12-07 01:44

Echelon9


Ported: N/A

Details Diff
Fix Mantis 2975: AddressSanitizer: global-buffer-overflow in HudGaugeLeadSight::render() Affected Issues
0002975
mod - /trunk/fs2_open/code/hud/hudtarget.cpp Diff File

Issue History

Date Modified Username Field Change
2013-12-07 05:50 Echelon9 New Issue
2013-12-07 05:50 Echelon9 Status new => assigned
2013-12-07 05:50 Echelon9 Assigned To => Echelon9
2013-12-07 06:13 Echelon9 Changeset attached => fs2open trunk r10205
2013-12-07 06:13 Echelon9 Note Added: 0015511
2013-12-07 06:13 Echelon9 Status assigned => resolved
2013-12-07 06:13 Echelon9 Resolution open => fixed