{"action":"created","issue":{"url":"https://api.github.com/repos/ni/VireoSDK/issues/536","repository_url":"https://api.github.com/repos/ni/VireoSDK","labels_url":"https://api.github.com/repos/ni/VireoSDK/issues/536/labels{/name}","comments_url":"https://api.github.com/repos/ni/VireoSDK/issues/536/comments","events_url":"https://api.github.com/repos/ni/VireoSDK/issues/536/events","html_url":"https://github.com/ni/VireoSDK/issues/536","id":377980655,"node_id":"MDU6SXNzdWUzNzc5ODA2NTU=","number":536,"title":"AddressSanitizer detected issues in native tests","user":{"login":"tchipley","id":30246495,"node_id":"MDQ6VXNlcjMwMjQ2NDk1","avatar_url":"https://avatars1.githubusercontent.com/u/30246495?v=4","gravatar_id":"","url":"https://api.github.com/users/tchipley","html_url":"https://github.com/tchipley","followers_url":"https://api.github.com/users/tchipley/followers","following_url":"https://api.github.com/users/tchipley/following{/other_user}","gists_url":"https://api.github.com/users/tchipley/gists{/gist_id}","starred_url":"https://api.github.com/users/tchipley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tchipley/subscriptions","organizations_url":"https://api.github.com/users/tchipley/orgs","repos_url":"https://api.github.com/users/tchipley/repos","events_url":"https://api.github.com/users/tchipley/events{/privacy}","received_events_url":"https://api.github.com/users/tchipley/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-11-06T18:38:30Z","updated_at":"2018-11-06T18:39:03Z","closed_at":null,"author_association":"NONE","body":"Building the native executable and running the native test sute on macOS with AddressSantizer enabled detected a couple of issues. I've put some details on each of the issues found in the comments, and should have a PR up with fixes today.\r\n\r\n**Steps to reproduce**\r\nAdd `CFLAGS += -fsanitize=address` and `LDFLAGS += -fsanitize=address` to make-it/Makefile, then `make native` with a compiler that supports AddressSanitizer (any recent clang or GCC should), and run the test suite (`make testnative`). A number of tests will crash and report errors."},"comment":{"url":"https://api.github.com/repos/ni/VireoSDK/issues/comments/436361290","html_url":"https://github.com/ni/VireoSDK/issues/536#issuecomment-436361290","issue_url":"https://api.github.com/repos/ni/VireoSDK/issues/536","id":436361290,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNjM2MTI5MA==","user":{"login":"tchipley","id":30246495,"node_id":"MDQ6VXNlcjMwMjQ2NDk1","avatar_url":"https://avatars1.githubusercontent.com/u/30246495?v=4","gravatar_id":"","url":"https://api.github.com/users/tchipley","html_url":"https://github.com/tchipley","followers_url":"https://api.github.com/users/tchipley/followers","following_url":"https://api.github.com/users/tchipley/following{/other_user}","gists_url":"https://api.github.com/users/tchipley/gists{/gist_id}","starred_url":"https://api.github.com/users/tchipley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tchipley/subscriptions","organizations_url":"https://api.github.com/users/tchipley/orgs","repos_url":"https://api.github.com/users/tchipley/repos","events_url":"https://api.github.com/users/tchipley/events{/privacy}","received_events_url":"https://api.github.com/users/tchipley/received_events","type":"User","site_admin":false},"created_at":"2018-11-06T18:39:03Z","updated_at":"2018-11-06T18:39:03Z","author_association":"NONE","body":"TooManyDimensions.via: Buffer overflow in `Vireo::ArrayType` constructor\r\n\r\n```\r\n==4845==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffee547525c at pc 0x00010ac62198 bp 0x7ffee5474e50 sp 0x7ffee5474600\r\nREAD of size 64 at 0x7ffee547525c thread T0\r\n    #0 0x10ac62197 in __asan_memcpy (libclang_rt.asan_osx_dynamic.dylib:x86_64+0x4e197)\r\n    #1 0x10a9cbbd4 in Vireo::ArrayType::ArrayType(Vireo::TypeManager*, Vireo::TypeCommon*, int, int*) TypeAndDataManager.cpp:1693\r\n    #2 0x10a9cb552 in Vireo::ArrayType::ArrayType(Vireo::TypeManager*, Vireo::TypeCommon*, int, int*) TypeAndDataManager.cpp:1683\r\n    #3 0x10a9cb41f in Vireo::ArrayType::New(Vireo::TypeManager*, Vireo::TypeCommon*, int, int*) TypeAndDataManager.cpp:1676\r\n    #4 0x10a98b9ff in Vireo::TDViaParser::ParseArray() TDCodecVia.cpp:594\r\n    #5 0x10a987528 in Vireo::TDViaParser::ParseType(Vireo::TypeCommon*) TDCodecVia.cpp:319\r\n    #6 0x10a98a617 in Vireo::TDViaParser::ParseDefine() TDCodecVia.cpp:452\r\n    #7 0x10a9874a1 in Vireo::TDViaParser::ParseType(Vireo::TypeCommon*) TDCodecVia.cpp:313\r\n    #8 0x10a987ca3 in Vireo::TDViaParser::ParseREPL() TDCodecVia.cpp:156\r\n    #9 0x10a997ea6 in Vireo::TDViaParser::StaticRepl(Vireo::TypeManager*, Vireo::SubString*) TDCodecVia.cpp:1848\r\n    #10 0x10a78acff in main main.cpp:70\r\n    #11 0x7fff6ccf2114 in start (libdyld.dylib:x86_64+0x1114)\r\n\r\nAddress 0x7ffee547525c is located in stack of thread T0 at offset 124 in frame\r\n    #0 0x10a98b57f in Vireo::TDViaParser::ParseArray() TDCodecVia.cpp:565\r\n\r\n  This frame has 3 object(s):\r\n    [32, 48) 'token' (line 566)\r\n    [64, 124) 'dimensionLengths' (line 568)\r\n    [160, 164) 'dimensionLength' (line 577) <== Memory access at offset 124 partially underflows this variable\r\nHINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext\r\n      (longjmp and C++ exceptions *are* supported)\r\nSUMMARY: AddressSanitizer: stack-buffer-overflow (libclang_rt.asan_osx_dynamic.dylib:x86_64+0x4e197) in __asan_memcpy\r\nShadow bytes around the buggy address:\r\n  0x1fffdca8e9f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\r\n  0x1fffdca8ea00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\r\n  0x1fffdca8ea10: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 f8 f8 f3 f3\r\n  0x1fffdca8ea20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\r\n  0x1fffdca8ea30: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1\r\n=>0x1fffdca8ea40: 00 00 f2 f2 00 00 00 00 00 00 00[04]f2 f2 f2 f2\r\n  0x1fffdca8ea50: f8 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00\r\n  0x1fffdca8ea60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\r\n  0x1fffdca8ea70: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 f2 f2 f2\r\n  0x1fffdca8ea80: 00 00 f2 f2 00 00 f2 f2 f8 f8 f8 f8 f8 f8 f8 f8\r\n  0x1fffdca8ea90: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8\r\nShadow byte legend (one shadow byte represents 8 application bytes):\r\n  Addressable:           00\r\n  Partially addressable: 01 02 03 04 05 06 07 \r\n  Heap left redzone:       fa\r\n  Freed heap region:       fd\r\n  Stack left redzone:      f1\r\n  Stack mid redzone:       f2\r\n  Stack right redzone:     f3\r\n  Stack after return:      f5\r\n  Stack use after scope:   f8\r\n  Global redzone:          f9\r\n  Global init order:       f6\r\n  Poisoned by user:        f7\r\n  Container overflow:      fc\r\n  Array cookie:            ac\r\n  Intra object redzone:    bb\r\n  ASan internal:           fe\r\n  Left alloca redzone:     ca\r\n  Right alloca redzone:    cb\r\n==4845==ABORTING\r\n```"}}
{"actor":{"display_login":"tchipley"}}