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

Small bugs in test cases #4167

Closed
JaySon-Huang opened this issue Mar 1, 2022 · 0 comments · Fixed by #4168
Closed

Small bugs in test cases #4167

JaySon-Huang opened this issue Mar 1, 2022 · 0 comments · Fixed by #4168
Labels
severity/minor type/bug The issue is confirmed as a bug.

Comments

@JaySon-Huang
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

2. What did you expect to see? (Required)

3. What did you see instead (Required)

[452/990] PageFileTest.PageFileLink (2893 ms)
[2022/03/01 15:57:38.362 +08:00] [INFO] [PathCapacityMetrics.cpp:70] ["PathCapacityMetrics:Init capacity [path=/tiflash/tmp/] [capacity=0.00 B]"] [thread_id=1]
[2022/03/01 15:57:38.405 +08:00] [INFO] [<unknown>] ["RegionPersister:RegionPersister running in normal mode"] [thread_id=1]
[2022/03/01 15:57:38.405 +08:00] [INFO] [PageStorage.cpp:186] ["PageStorage:RegionPersister begin to restore data from disk. [path=/tiflash/tmp/kvstore] [num_writers=4]"] [thread_id=1]
[2022/03/01 15:57:38.406 +08:00] [INFO] [PageStorage.cpp:340] ["PageStorage:RegionPersister restore 0 pages, write batch sequence: 0, 0 puts and 0 refs and 0 deletes and 0 upserts"] [thread_id=1]
[2022/03/01 15:57:38.406 +08:00] [INFO] [KVStore.cpp:45] ["KVStore:Restored 0 regions"] [thread_id=1]
[2022/03/01 15:57:38.407 +08:00] [INFO] [<unknown>] ["RegionTable:Start to restore"] [thread_id=1]
[2022/03/01 15:57:38.407 +08:00] [INFO] [<unknown>] ["RegionTable:Restore 0 tables"] [thread_id=1]
�[0;33mNote: Google Test filter = PageFileTest.PageFileLink
�[m�[0;32m[==========] �[mRunning 1 test from 1 test case.
�[0;32m[----------] �[mGlobal test environment set-up.
�[0;32m[----------] �[m1 test from PageFileTest
�[0;32m[ RUN      ] �[mPageFileTest.PageFileLink
=================================================================
==18196==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7ffe811fe3a0 at pc 0x0000058fd377 bp 0x7ffe811fd690 sp 0x7ffe811fce58
READ of size 1024 at 0x7ffe811fe3a0 thread T0
    #0 0x58fd376 in __asan_memcpy /llvm-project/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp:22:3
    #1 0x5a82865 in DB::ReadBuffer::read(char*, unsigned long) /home/jenkins/agent/workspace/tiflash-sanitizer-daily/tics/dbms/src/IO/ReadBuffer.h:135:13
    #2 0x5a82865 in DB::ReadBuffer::readStrict(char*, unsigned long) /home/jenkins/agent/workspace/tiflash-sanitizer-daily/tics/dbms/src/IO/ReadBuffer.h:146:18
    #3 0xcb77e4e in DB::PS::V2::PageMetaFormat::genWriteData(DB::WriteBatch&, DB::PS::V2::PageFile&, DB::PS::V2::PageEntriesEdit&) /home/jenkins/agent/workspace/tiflash-sanitizer-daily/tics/dbms/src/Storages/Page/V2/PageFile.cpp:147:36
    #4 0xcb8974c in DB::PS::V2::PageFile::Writer::write(DB::WriteBatch&, DB::PS::V2::PageEntriesEdit&, std::__1::shared_ptr<DB::WriteLimiter> const&) /home/jenkins/agent/workspace/tiflash-sanitizer-daily/tics/dbms/src/Storages/Page/V2/PageFile.cpp:755:36
    #5 0x91a673c in DB::PS::V2::tests::PageFileTest_PageFileLink_Test::TestBody() /home/jenkins/agent/workspace/tiflash-sanitizer-daily/tics/dbms/src/Storages/Page/V2/tests/gtest_page_file.cpp:196:5
...

Address 0x7ffe811fe3a0 is located in stack of thread T0 at offset 448 in frame
    #0 0x91a4a4f in DB::PS::V2::tests::PageFileTest_PageFileLink_Test::TestBody() /home/jenkins/agent/workspace/tiflash-sanitizer-daily/tics/dbms/src/Storages/Page/V2/tests/gtest_page_file.cpp:166
...
...
[452/990] PageFileTest.PageFileLink returned/aborted with exit code 1 (2893 ms)

https://github.com/pingcap/tics/blob/4954a24c0f15f9327fff1591778cd61c64b8e8dd/dbms/src/Storages/Page/V2/tests/gtest_page_file.cpp#L177-L192
https://github.com/pingcap/tics/blob/4954a24c0f15f9327fff1591778cd61c64b8e8dd/dbms/src/Storages/Page/V2/tests/gtest_page_file.cpp#L228-L243

c_buff1, c_buff2 use after scoped

4. What is your TiFlash version? (Required)

@JaySon-Huang JaySon-Huang added the type/bug The issue is confirmed as a bug. label Mar 1, 2022
ti-chi-bot pushed a commit that referenced this issue Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/minor type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant