Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Many memory problems in test runs #191

Open
edwardhartnett opened this issue Dec 1, 2022 · 1 comment
Open

Many memory problems in test runs #191

edwardhartnett opened this issue Dec 1, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@edwardhartnett
Copy link
Contributor

test 1
    Start 1: test_degrib2_int

1: Test command: /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/build/tests/test_degrib2_int
1: Working Directory: /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/build/tests
1: Test timeout computed to be: 1500
1:  Testing degrib2 level and date/time descriptions...
1: =================================================================
1: ==13748==ERROR: AddressSanitizer: global-buffer-overflow on address 0x55bac89fd2dc at pc 0x55bac89efad6 bp 0x7ffce4e65ed0 sp 0x7ffce4e65ec0
1: READ of size 4 at 0x55bac89fd2dc thread T0
1:     #0 0x55bac89efad5 in prvtime_ /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/src/degrib2/prvtime.F90:85
1:     #1 0x55bac89e58d0 in test_degrib2_int /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/tests/test_degrib2_int.F90:23
1:     #2 0x55bac89e6863 in main /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/tests/test_degrib2_int.F90:49
1:     #3 0x7fec638b5d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)
1:     #4 0x7fec638b5e3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f)
1:     #5 0x55bac89e5404 in _start (/home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/build/tests/test_degrib2_int+0x5404)
1: 
1: 0x55bac89fd2dc is located 4 bytes to the left of global variable 'ipos2' defined in '/home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/src/degrib2/prvtime.F90:28:40' (0x55bac89fd2e0) of size 800
1: 0x55bac89fd2dc is located 44 bytes to the right of global variable '*.LPBX0' defined in '<built-in>' (0x55bac89fd240) of size 112
1: SUMMARY: AddressSanitizer: global-buffer-overflow /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/src/degrib2/prvtime.F90:85 in prvtime_
1: Shadow bytes around the buggy address:
1:   0x0ab7d9137a00: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
1:   0x0ab7d9137a10: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
1:   0x0ab7d9137a20: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
1:   0x0ab7d9137a30: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
1:   0x0ab7d9137a40: f9 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00
1: =>0x0ab7d9137a50: 00 00 00 00 00 00 f9 f9 f9 f9 f9[f9]00 00 00 00
1:   0x0ab7d9137a60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
1:   0x0ab7d9137a70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
1:   0x0ab7d9137a80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
1:   0x0ab7d9137a90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
1:   0x0ab7d9137aa0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
1: Shadow byte legend (one shadow byte represents 8 application bytes):
1:   Addressable:           00
1:   Partially addressable: 01 02 03 04 05 06 07 
1:   Heap left redzone:       fa
1:   Freed heap region:       fd
1:   Stack left redzone:      f1
1:   Stack mid redzone:       f2
1:   Stack right redzone:     f3
1:   Stack after return:      f5
1:   Stack use after scope:   f8
1:   Global redzone:          f9
1:   Global init order:       f6
1:   Poisoned by user:        f7
1:   Container overflow:      fc
1:   Array cookie:            ac
1:   Intra object redzone:    bb
1:   ASan internal:           fe
1:   Left alloca redzone:     ca
1:   Right alloca redzone:    cb
1:   Shadow gap:              cc
1: ==13748==ABORTING
1/7 Test #1: test_degrib2_int .................***Failed    0.52 sec
 Testing degrib2 level and date/time descriptions...
=================================================================
==13748==ERROR: AddressSanitizer: global-buffer-overflow on address 0x55bac89fd2dc at pc 0x55bac89efad6 bp 0x7ffce4e65ed0 sp 0x7ffce4e65ec0
READ of size 4 at 0x55bac89fd2dc thread T0
    #0 0x55bac89efad5 in prvtime_ /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/src/degrib2/prvtime.F90:85
    #1 0x55bac89e58d0 in test_degrib2_int /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/tests/test_degrib2_int.F90:23
    #2 0x55bac89e6863 in main /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/tests/test_degrib2_int.F90:49
    #3 0x7fec638b5d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)
    #4 0x7fec638b5e3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f)
    #5 0x55bac89e5404 in _start (/home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/build/tests/test_degrib2_int+0x5404)

0x55bac89fd2dc is located 4 bytes to the left of global variable 'ipos2' defined in '/home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/src/degrib2/prvtime.F90:28:40' (0x55bac89fd2e0) of size 800
0x55bac89fd2dc is located 44 bytes to the right of global variable '*.LPBX0' defined in '<built-in>' (0x55bac89fd240) of size 112
SUMMARY: AddressSanitizer: global-buffer-overflow /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/src/degrib2/prvtime.F90:85 in prvtime_
Shadow bytes around the buggy address:
  0x0ab7d9137a00: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
  0x0ab7d9137a10: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
  0x0ab7d9137a20: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
  0x0ab7d9137a30: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
  0x0ab7d9137a40: f9 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00
=>0x0ab7d9137a50: 00 00 00 00 00 00 f9 f9 f9 f9 f9[f9]00 00 00 00
  0x0ab7d9137a60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ab7d9137a70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ab7d9137a80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ab7d9137a90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0ab7d9137aa0: 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
==13748==ABORTING

test 2
    Start 2: run_cnvgrib_tests.sh

2: Test command: /usr/bin/bash "run_cnvgrib_tests.sh"
2: Working Directory: /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/build/tests
2: Test timeout computed to be: 1500
2: 
2: *** Running cnvgrib test
2: =================================================================
2: ==13751==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6060000000bc at pc 0x55dfa5b1c713 bp 0x7ffecbf76ca0 sp 0x7ffecbf76c90
2: READ of size 4 at 0x6060000000bc thread T0
2:     #0 0x55dfa5b1c712 in makepds_ /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/src/cnvgrib/makepds.F90:111
2:     #1 0x55dfa5b093ef in cnv21_ /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/src/cnvgrib/cnv21.F90:89
2:     #2 0x55dfa5b0f31a in cnvgrib /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/src/cnvgrib/cnvgrib.F90:242
2:     #3 0x55dfa5b0f624 in main /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/src/cnvgrib/cnvgrib.F90:256
2:     #4 0x7f6546da6d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)
2:     #5 0x7f6546da6e3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f)
2:     #6 0x55dfa5ae3674 in _start (/home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/build/src/cnvgrib/cnvgrib+0x9674)
2: 
2: 0x6060000000bc is located 0 bytes to the right of 60-byte region [0x606000000080,0x6060000000bc)
2: allocated by thread T0 here:
2:     #0 0x7f6547707867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
2:     #1 0x55dfa5b35e56 in gf_unpack4_ /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/g2/src/gf_unpack4.F90:90
2: 
2: SUMMARY: AddressSanitizer: heap-buffer-overflow /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/src/cnvgrib/makepds.F90:111 in makepds_
2: Shadow bytes around the buggy address:
2:   0x0c0c7fff7fc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2:   0x0c0c7fff7fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2:   0x0c0c7fff7fe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2:   0x0c0c7fff7ff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
2:   0x0c0c7fff8000: fa fa fa fa 00 00 00 00 00 00 04 fa fa fa fa fa
2: =>0x0c0c7fff8010: 00 00 00 00 00 00 00[04]fa fa fa fa fd fd fd fd
2:   0x0c0c7fff8020: fd fd fd fa fa fa fa fa fd fd fd fd fd fd fd fd
2:   0x0c0c7fff8030: fa fa fa fa fd fd fd fd fd fd fd fd fa fa fa fa
2:   0x0c0c7fff8040: fd fd fd fd fd fd fd fa fa fa fa fa fd fd fd fd
2:   0x0c0c7fff8050: fd fd fd fd fa fa fa fa fd fd fd fd fd fd fd fa
2:   0x0c0c7fff8060: fa fa fa fa fd fd fd fd fd fd fd fa fa fa fa fa
2: Shadow byte legend (one shadow byte represents 8 application bytes):
2:   Addressable:           00
2:   Partially addressable: 01 02 03 04 05 06 07 
2:   Heap left redzone:       fa
2:   Freed heap region:       fd
2:   Stack left redzone:      f1
2:   Stack mid redzone:       f2
2:   Stack right redzone:     f3
2:   Stack after return:      f5
2:   Stack use after scope:   f8
2:   Global redzone:          f9
2:   Global init order:       f6
2:   Poisoned by user:        f7
2:   Container overflow:      fc
2:   Array cookie:            ac
2:   Intra object redzone:    bb
2:   ASan internal:           fe
2:   Left alloca redzone:     ca
2:   Right alloca redzone:    cb
2:   Shadow gap:              cc
2: ==13751==ABORTING
2/7 Test #2: run_cnvgrib_tests.sh .............***Failed    0.10 sec

*** Running cnvgrib test
=================================================================
==13751==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6060000000bc at pc 0x55dfa5b1c713 bp 0x7ffecbf76ca0 sp 0x7ffecbf76c90
READ of size 4 at 0x6060000000bc thread T0
    #0 0x55dfa5b1c712 in makepds_ /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/src/cnvgrib/makepds.F90:111
    #1 0x55dfa5b093ef in cnv21_ /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/src/cnvgrib/cnv21.F90:89
    #2 0x55dfa5b0f31a in cnvgrib /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/src/cnvgrib/cnvgrib.F90:242
    #3 0x55dfa5b0f624 in main /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/src/cnvgrib/cnvgrib.F90:256
    #4 0x7f6546da6d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)
    #5 0x7f6546da6e3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f)
    #6 0x55dfa5ae3674 in _start (/home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/build/src/cnvgrib/cnvgrib+0x9674)

0x6060000000bc is located 0 bytes to the right of 60-byte region [0x606000000080,0x6060000000bc)
allocated by thread T0 here:
    #0 0x7f6547707867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
    #1 0x55dfa5b35e56 in gf_unpack4_ /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/g2/src/gf_unpack4.F90:90

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/src/cnvgrib/makepds.F90:111 in makepds_
Shadow bytes around the buggy address:
  0x0c0c7fff7fc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c0c7fff7fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c0c7fff7fe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c0c7fff7ff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c0c7fff8000: fa fa fa fa 00 00 00 00 00 00 04 fa fa fa fa fa
=>0x0c0c7fff8010: 00 00 00 00 00 00 00[04]fa fa fa fa fd fd fd fd
  0x0c0c7fff8020: fd fd fd fa fa fa fa fa fd fd fd fd fd fd fd fd
  0x0c0c7fff8030: fa fa fa fa fd fd fd fd fd fd fd fd fa fa fa fa
  0x0c0c7fff8040: fd fd fd fd fd fd fd fa fa fa fa fa fd fd fd fd
  0x0c0c7fff8050: fd fd fd fd fa fa fa fa fd fd fd fd fd fd fd fa
  0x0c0c7fff8060: fa fa fa fa fd fd fd fd fd fd fd fa fa fa fa fa
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
==13751==ABORTING

test 3
    Start 3: run_copygb_tests.sh

3: Test command: /usr/bin/bash "run_copygb_tests.sh"
3: Working Directory: /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/build/tests
3: Test timeout computed to be: 1500
3: 
3: *** Running copygb test
3: =================================================================
3: ==13755==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fffd2fb2b5f at pc 0x55b4afdd382a bp 0x7fffd2fb2160 sp 0x7fffd2fb2150
3: READ of size 1 at 0x7fffd2fb2b5f thread T0
3:     #0 0x55b4afdd3829 in ncbase_ /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/src/grbindex/grbindex.f:214
3:     #1 0x55b4afdd27c7 in wrgi1h_ /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/src/grbindex/grbindex.f:163
3:     #2 0x55b4afdd44db in grbindex /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/src/grbindex/grbindex.f:111
3:     #3 0x55b4afdd4cfe in main /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/src/grbindex/grbindex.f:131
3:     #4 0x7f32dd1b2d8f  (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)
3:     #5 0x7f32dd1b2e3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f)
3:     #6 0x55b4afdd2464 in _start (/home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/build/src/grbindex/grbindex+0x3464)
3: 
3: Address 0x7fffd2fb2b5f is located in stack of thread T0 at offset 207 in frame
3:     #0 0x55b4afdd38f8 in grbindex /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/src/grbindex/grbindex.f:65
3: 
3:   This frame has 13 object(s):
3:     [48, 52) 'ios' (line 82)
3:     [64, 68) 'iret' (line 106)
3:     [80, 84) 'irgi' (line 102)
3:     [96, 100) 'iw' (line 112)
3:     [112, 116) 'kw' (line 113)
3:     [128, 132) 'mnum' (line 101)
3:     [144, 148) 'nlen' (line 102)
3:     [160, 164) 'nnum' (line 102)
3:     [176, 180) '<unknown>'
3:     [192, 196) '<unknown>'
3:     [208, 464) 'cgb' (line 67) <== Memory access at offset 207 underflows this variable
3:     [528, 784) 'cgi' (line 67)
3:     [848, 1148) 'carg' (line 70)
3: HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork
3:       (longjmp and C++ exceptions *are* supported)
3: SUMMARY: AddressSanitizer: stack-buffer-overflow /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/src/grbindex/grbindex.f:214 in ncbase_
3: Shadow bytes around the buggy address:
3:   0x10007a5ee510: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3:   0x10007a5ee520: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3:   0x10007a5ee530: 00 00 00 00 f3 f3 f3 f3 f3 f3 f3 f3 f3 f3 f3 f3
3:   0x10007a5ee540: f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00
3:   0x10007a5ee550: 00 00 f1 f1 f1 f1 f1 f1 04 f2 04 f2 04 f2 04 f2
3: =>0x10007a5ee560: 04 f2 04 f2 04 f2 04 f2 04 f2 04[f2]00 00 00 00
3:   0x10007a5ee570: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3:   0x10007a5ee580: 00 00 00 00 00 00 00 00 00 00 00 00 f2 f2 f2 f2
3:   0x10007a5ee590: f2 f2 f2 f2 00 00 00 00 00 00 00 00 00 00 00 00
3:   0x10007a5ee5a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
3:   0x10007a5ee5b0: 00 00 00 00 f2 f2 f2 f2 f2 f2 f2 f2 00 00 00 00
3: Shadow byte legend (one shadow byte represents 8 application bytes):
3:   Addressable:           00
3:   Partially addressable: 01 02 03 04 05 06 07 
3:   Heap left redzone:       fa
3:   Freed heap region:       fd
3:   Stack left redzone:      f1
3:   Stack mid redzone:       f2
3:   Stack right redzone:     f3
3:   Stack after return:      f5
3:   Stack use after scope:   f8
3:   Global redzone:          f9
3:   Global init order:       f6
3:   Poisoned by user:        f7
3:   Container overflow:      fc
3:   Array cookie:            ac
3:   Intra object redzone:    bb
3:   ASan internal:           fe
Address 0x7ffcdaaf931f is located in stack of thread T0 at offset 303 in frame
    #0 0x55e8e058d8bc in grb2index /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/src/grb2index/grb2index.F90:58

  This frame has 14 object(s):
    [48, 52) 'ios' (line 82)
    [64, 68) 'iret' (line 106)
    [80, 84) 'irgi' (line 102)
    [96, 100) 'iw' (line 113)
    [112, 116) 'kw' (line 114)
    [128, 132) 'mnum' (line 101)
    [144, 148) 'nlen' (line 102)
    [160, 164) 'nmess' (line 102)
    [176, 180) 'nnum' (line 102)
    [192, 196) 'numtot' (line 110)
    [208, 272) 'cbuf' (line 61)
    [304, 560) 'cgb' (line 60) <== Memory access at offset 303 underflows this variable
    [624, 880) 'cgi' (line 60)
    [944, 1244) 'carg' (line 62)
HINT: this may be a false positive if your program uses some custom stack unwind mechanism, swapcontext or vfork
      (longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-buffer-overflow /home/runner/work/NCEPLIBS-grib_util/NCEPLIBS-grib_util/grib_utils/src/grb2index/grb2index.F90:217 in ncbase_
Shadow bytes around the buggy address:
  0x10001b557210: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10001b557220: f3 f3 f3 f3 f3 f3 f3 f3 f3 f3 f3 f3 f3 f3 f3 f3
  0x10001b557230: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1
  0x10001b557240: f1 f1 f1 f1 04 f2 04 f2 04 f2 04 f2 04 f2 04 f2
  0x10001b557250: 04 f2 04 f2 04 f2 04 f2 00 00 00 00 00 00 00 00
=>0x10001b557260: f2 f2 f2[f2]00 00 00 00 00 00 00 00 00 00 00 00
  0x10001b557270: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10001b557280: 00 00 00 00 f2 f2 f2 f2 f2 f2 f2 f2 00 00 00 00
  0x10001b557290: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10001b5572a0: 00 00 00 00 00 00 00 00 00 00 00 00 f2 f2 f2 f2
  0x10001b5572b0: f2 f2 f2 f2 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
==13764==ABORTING


0% tests passed, 7 tests failed out of 7

Total Test time (real) =   1.80 sec

The following tests FAILED:
	  1 - test_degrib2_int (Failed)
	  2 - run_cnvgrib_tests.sh (Failed)
	  3 - run_copygb_tests.sh (Failed)
	  4 - run_copygb2_tests.sh (Failed)
	  5 - run_degrib2_tests.sh (Failed)
	  6 - run_grbindex_tests.sh (Failed)
	  7 - run_grb2index_tests.sh (Failed)
@edwardhartnett edwardhartnett added the bug Something isn't working label Dec 1, 2022
@edwardhartnett edwardhartnett self-assigned this Dec 1, 2022
@edwardhartnett
Copy link
Contributor Author

OK, some progress. After #223 is merged, at least degrib2 has no memory problems, as shown in this address sanitizer run:

Test project /home/ed/NCEPLIBS-grib_util/b
    Start 1: test_degrib2_int
1/8 Test #1: test_degrib2_int .................   Passed    0.02 sec
    Start 2: run_cnvgrib_tests.sh
2/8 Test #2: run_cnvgrib_tests.sh .............***Failed    0.22 sec
    Start 3: run_copygb_tests.sh
3/8 Test #3: run_copygb_tests.sh ..............***Failed    0.23 sec
    Start 4: run_degrib2_tests.sh
4/8 Test #4: run_degrib2_tests.sh .............   Passed    0.65 sec
    Start 5: run_grbindex_tests.sh
5/8 Test #5: run_grbindex_tests.sh ............***Failed    0.16 sec
    Start 6: run_grb2index_tests.sh
6/8 Test #6: run_grb2index_tests.sh ...........***Failed    0.18 sec
    Start 7: run_ftp_tests.sh
7/8 Test #7: run_ftp_tests.sh .................***Failed    0.22 sec
    Start 8: run_all_ftp_tests.sh
8/8 Test #8: run_all_ftp_tests.sh .............   Passed  105.34 sec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant