What does this error signify?

Revision en1, by roycf123, 2022-10-21 07:38:38

Hello guys,

I recently submitted a problem which generated the following error:

Diagnostics detected issues [cpp.clang++-diagnose]: =================================================================
==3304==ERROR: AddressSanitizer: global-buffer-overflow on address 0x00282658 at pc 0x00161cd6 bp 0x1085faf4 sp 0x1085faf0
READ of size 1 at 0x00282658 thread T0
    #0 0x161cd5 in solve K:\codeforces71\098eeebfbac393649f6c79d4673741ac\compile-36d3577b3eaacceb8ba51a42a87e5d9a\p71.cpp:45
    #1 0x162380 in main K:\codeforces71\098eeebfbac393649f6c79d4673741ac\compile-36d3577b3eaacceb8ba51a42a87e5d9a\p71.cpp:59
    #2 0x1dbda1 in __scrt_common_main_seh f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:283
    #3 0x7633343c in BaseThreadInitThunk+0x11 (C:\Windows\syswow64\kernel32.dll+0x7dd7343c)
    #4 0x770f9831 in RtlInitializeExceptionChain+0x62 (C:\Windows\SysWOW64\ntdll.dll+0x7dea9831)
    #5 0x770f9804 in RtlInitializeExceptionChain+0x35 (C:\Windows\SysWOW64\ntdll.dll+0x7dea9804)

0x00282658 is located 40 bytes to the left of global variable 'std::num_get<char>::id' defined in 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.11.25503\include\xlocnum:1231:60' (0x282680) of size 4
0x00282658 is located 0 bytes to the right of global variable 's' defined in 'p71.cpp:32:12' (0x282640) of size 24
SUMMARY: AddressSanitizer: global-buffer-overflow K:\codeforces71\098eeebfbac393649f6c79d4673741ac\compile-36d3577b3eaacceb8ba51a42a87e5d9a\p71.cpp:45 in solve
Shadow bytes around the buggy address:
  0x30050470: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x30050480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x30050490: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x300504a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x300504b0: 00 00 00 00 00 00 00 00 00 00 00 f9 f9 f9 f9 f9
=>0x300504c0: 00 00 00 f9 f9 f9 f9 f9 00 00 00[f9]f9 f9 f9 f9
  0x300504d0: 04 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9
  0x300504e0: 04 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9
  0x300504f0: 04 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9
  0x30050500: 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00
  0x30050510: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
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
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==3304==ABORTING

I looked up online and found an article saying this arises due to segmentation fault. When I declared all variables globally, the error persisted.

The only difference was that instead of WA I got RTE. Could someone pls help me with this issue?

P.S: The submission ID is #177257400 and the problem statement is this

Tags greedy, implementations

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English roycf123 2022-10-21 07:38:38 3371 Initial revision (published)