The Keywords feature of libdap is hosed

Description

Here's an asan trace:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 Please send `modules/gateway_module/tests/gateway_handlerTest.log' and all information you think might help: To: <support@opendap.org> Subject: [bes 3.19.1] gateway_handlerTest: 2 3 4 7 8 9 10 failed You may investigate any problem if you feel able to do so, in which case the test suite provides a good starting point. Its output may be found below `modules/gateway_module/tests/gateway_handlerTest.dir'. make[1]: *** [check-local] Error 1 make: *** [check-am] Error 2 edamame:tests jimg$ ./gateway_handlerTest 2 -v ## ---------------------------------------------- ## ## bes 3.19.1 test suite: bes.conf besstandalone. ## ## ---------------------------------------------- ## 2. gateway_handlerTest.at:14: testing BESCMD $abs_srcdir/gateway/fnoc1.nc.nc.dds.bescmd ... ./gateway_handlerTest.at:14: besstandalone $repeat -c $abs_builddir/bes.conf -i $input --- /dev/null 2018-03-01 16:57:14.000000000 -0700 +++ /Users/jimg/src/opendap/hyrax_git/bes/modules/gateway_module/tests/gateway_handlerTest.dir/at-groups/2/stderr 2018-03-01 16:57:15.000000000 -0700 @@ -0,0 +1,77 @@ +================================================================= +==64620==ERROR: AddressSanitizer: container-overflow on address 0x60f000003c40 at pc 0x000101f2177b bp 0x7ffeee404980 sp 0x7ffeee404128 +WRITE of size 24 at 0x60f000003c40 thread T0 + #0 0x101f2177a in wrap_memset (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x1a77a) + #1 0x1057f02df in std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >::__construct_at_end(unsigned long) (libdap.25.dylib:x86_64+0xad2df) + #2 0x105869d2f in std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >::vector(unsigned long) (libdap.25.dylib:x86_64+0x126d2f) + #3 0x10585bbdc in std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >::vector(unsigned long) (libdap.25.dylib:x86_64+0x118bdc) + #4 0x1058b4eca in libdap::Keywords::Keywords() (libdap.25.dylib:x86_64+0x171eca) + #5 0x1058b82e4 in libdap::Keywords::Keywords() (libdap.25.dylib:x86_64+0x1752e4) + #6 0x105766453 in libdap::DDS::DDS(libdap::BaseTypeFactory*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) (libdap.25.dylib:x86_64+0x23453) + #7 0x105767394 in libdap::DDS::DDS(libdap::BaseTypeFactory*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) (libdap.25.dylib:x86_64+0x24394) + #8 0x105424b31 in BESDDSResponseHandler::execute(BESDataHandlerInterface&) BESDDSResponseHandler.cc:72 + #9 0x101e2906f in BESXMLInterface::execute_data_request_plan() BESXMLInterface.cc:282 + #10 0x1018b0b44 in BESInterface::execute_request(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) BESInterface.cc:362 + #11 0x10181b14e in StandAloneClient::executeCommand(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) StandAloneClient.cc:237 + #12 0x101818ce9 in StandAloneClient::executeCommands(std::__1::basic_ifstream<char, std::__1::char_traits<char> >&, int) StandAloneClient.cc:349 + #13 0x1017fea7c in StandAloneApp::run() StandAloneApp.cc:248 + #14 0x101b1fde4 in BESApp::main(int, char**) BESApp.cc:58 + #15 0x101801c67 in main StandAloneApp.cc:342 + #16 0x7fff50e29114 in start (libdyld.dylib:x86_64+0x1114) + +0x60f000003c40 is located 0 bytes inside of 168-byte region [0x60f000003c40,0x60f000003ce8) +allocated by thread T0 here: + #0 0x101f6b0ab in wrap__Znwm (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x640ab) + #1 0x10190c6a6 in std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >::allocate(unsigned long) new:226 + #2 0x105869d17 in std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >::vector(unsigned long) (libdap.25.dylib:x86_64+0x126d17) + #3 0x10585bbdc in std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >::vector(unsigned long) (libdap.25.dylib:x86_64+0x118bdc) + #4 0x1058b4eca in libdap::Keywords::Keywords() (libdap.25.dylib:x86_64+0x171eca) + #5 0x1058b82e4 in libdap::Keywords::Keywords() (libdap.25.dylib:x86_64+0x1752e4) + #6 0x105766453 in libdap::DDS::DDS(libdap::BaseTypeFactory*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) (libdap.25.dylib:x86_64+0x23453) + #7 0x105767394 in libdap::DDS::DDS(libdap::BaseTypeFactory*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) (libdap.25.dylib:x86_64+0x24394) + #8 0x105424b31 in BESDDSResponseHandler::execute(BESDataHandlerInterface&) BESDDSResponseHandler.cc:72 + #9 0x101e2906f in BESXMLInterface::execute_data_request_plan() BESXMLInterface.cc:282 + #10 0x1018b0b44 in BESInterface::execute_request(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) BESInterface.cc:362 + #11 0x10181b14e in StandAloneClient::executeCommand(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) StandAloneClient.cc:237 + #12 0x101818ce9 in StandAloneClient::executeCommands(std::__1::basic_ifstream<char, std::__1::char_traits<char> >&, int) StandAloneClient.cc:349 + #13 0x1017fea7c in StandAloneApp::run() StandAloneApp.cc:248 + #14 0x101b1fde4 in BESApp::main(int, char**) BESApp.cc:58 + #15 0x101801c67 in main StandAloneApp.cc:342 + #16 0x7fff50e29114 in start (libdyld.dylib:x86_64+0x1114) + +HINT: if you don't care about these errors you may set ASAN_OPTIONS=detect_container_overflow=0. +If you suspect a false positive see also: https://github.com/google/sanitizers/wiki/AddressSanitizerContainerOverflow. +SUMMARY: AddressSanitizer: container-overflow (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x1a77a) in wrap_memset +Shadow bytes around the buggy address: + 0x1c1e00000730: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd + 0x1c1e00000740: fd fd fd fa fa fa fa fa fa fa fa fa fd fd fd fd + 0x1c1e00000750: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd + 0x1c1e00000760: fd fa fa fa fa fa fa fa fa fa fd fd fd fd fd fd + 0x1c1e00000770: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fa +=>0x1c1e00000780: fa fa fa fa fa fa fa fa[fc]fc fc fc fc fc fc fc + 0x1c1e00000790: fc fc fc fc fc fc fc fc fc fc fc fc fc fa fa fa + 0x1c1e000007a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + 0x1c1e000007b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + 0x1c1e000007c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + 0x1c1e000007d0: fa fa fa fa fa fa fa fa fa fa fa 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 +==64620==ABORTING +/Users/jimg/src/opendap/hyrax_git/bes/modules/gateway_module/tests/gateway_handlerTest.dir/at-groups/2/test-source: line 88: 64620 Abort trap: 6 besstandalone $repeat -c $abs_builddir/bes.conf -i $input stdout: ./gateway_handlerTest.at:14: exit code was 134, expected 0 2. gateway_handlerTest.at:14: FAILED (gateway_handlerTest.at:14)

Environment

None

Status

Assignee

James Gallagher

Reporter

James Gallagher

Labels

None

Story Points

None

Epic Link

Components

Sprint

None

Priority

High
Configure