]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commit
fix ASAN for DeleteFilesInRange test case rocksdb-5.9.2 v5.9.2
authorAndrew Kryczka <andrewkr@fb.com>
Thu, 7 Dec 2017 19:07:44 +0000 (11:07 -0800)
committerAndrew Kryczka <andrewkr@fb.com>
Thu, 7 Dec 2017 19:47:51 +0000 (11:47 -0800)
commit004237e62790320d8e630456cbeb6f4a1f3579c2
tree1fc6e9cacf451ec661bff550543c3eeab3b0a21d
parentea3a279bbe573b43ec08760081aa225438d841ac
fix ASAN for DeleteFilesInRange test case

Summary:
error message was

```
==3095==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7ffd18216c40 at pc 0x0000005edda1 bp 0x7ffd18215550 sp 0x7ffd18214d00
...
Address 0x7ffd18216c40 is located in stack of thread T0 at offset 1952 in frame
     #0 internal_repo_rocksdb/db_compaction_test.cc:1520 rocksdb::DBCompactionTest_DeleteFileRangeFileEndpointsOverlapBug_Test::TestBody()
```

It was unsafe to have slices referring to the temporary string objects' buffers, as those strings were destroyed before the slices were used. Fixed it by assigning the strings returned by `Key()` to local variables.
Closes https://github.com/facebook/rocksdb/pull/3238

Differential Revision: D6507864

Pulled By: ajkr

fbshipit-source-id: dd07de1a0070c6748c1ab4f3d7bd31f9a81889d0
db/db_compaction_test.cc