bustub2020 icon indicating copy to clipboard operation
bustub2020 copied to clipboard

Lab2 has bugs.

Open fhkong opened this issue 2 years ago • 2 comments

Hi, I have done the my own lab2, and has passed all test code in gradescope. But there is a question in my code that I can't understand, Why the time of crabing latch is larger than just use a global mutex ?

With this doubt, I test your source code. Unfortunately, I found your code has a bug as shown in following, and also has the problem of the time of latch and mutex.

Running main() from gmock_main.cc
[==========] Running 7 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 7 tests from BPlusTreeConcurrentTest
[ RUN      ] BPlusTreeConcurrentTest.InsertTest1
[       OK ] BPlusTreeConcurrentTest.InsertTest1 (608 ms)
[ RUN      ] BPlusTreeConcurrentTest.InsertTest2
[       OK ] BPlusTreeConcurrentTest.InsertTest2 (394 ms)
[ RUN      ] BPlusTreeConcurrentTest.DeleteTest1
[       OK ] BPlusTreeConcurrentTest.DeleteTest1 (103 ms)
[ RUN      ] BPlusTreeConcurrentTest.DeleteTest2
[       OK ] BPlusTreeConcurrentTest.DeleteTest2 (106 ms)
[ RUN      ] BPlusTreeConcurrentTest.MixTest1
[       OK ] BPlusTreeConcurrentTest.MixTest1 (19748 ms)
[ RUN      ] BPlusTreeConcurrentTest.MixTest2
/home/fhkong/bustub2020-lab2/test/storage/grading_b_plus_tree_checkpoint_2_concurrent_test.cpp:446: Failure
Expected equality of these values:
  size
    Which is: 599
  perserved_keys.size()
    Which is: 600
[  FAILED  ] BPlusTreeConcurrentTest.MixTest2 (14673 ms)
[ RUN      ] BPlusTreeConcurrentTest.MixTest3
[       OK ] BPlusTreeConcurrentTest.MixTest3 (18888 ms)
[----------] 7 tests from BPlusTreeConcurrentTest (54520 ms total)

[----------] Global test environment tear-down
[==========] 7 tests from 1 test suite ran. (54520 ms total)
[  PASSED  ] 6 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] BPlusTreeConcurrentTest.MixTest2

fhkong avatar Aug 22 '22 07:08 fhkong

Thanks for your issue. However, it has been too long since I finsih the lab. I have forgotten the details of this profect, and I'm not going to update this project nor fix bugs in it. I'm afraid you would find out the reason on your own. Good luck!

Yiyuan-Dong avatar Aug 22 '22 08:08 Yiyuan-Dong

Lab3 has bugs too

Running main() from gmock_main.cc
[==========] Running 5 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 5 tests from LockManagerTest
[ RUN      ] LockManagerTest.BasicTest
2022-08-24 07:24:37 [others/bustub2020/src/include/concurrency/lock_manager.h:62:LockManager] INFO  - Cycle detection thread launched
2022-08-24 07:24:37 [others/bustub2020/src/include/concurrency/lock_manager.h:69:~LockManager] INFO  - Cycle detection thread stopped
[       OK ] LockManagerTest.BasicTest (50 ms)
[ RUN      ] LockManagerTest.TwoPLTest
2022-08-24 07:24:37 [others/bustub2020/src/include/concurrency/lock_manager.h:62:LockManager] INFO  - Cycle detection thread launched
2022-08-24 07:24:37 [others/bustub2020/src/include/concurrency/lock_manager.h:69:~LockManager] INFO  - Cycle detection thread stopped
[       OK ] LockManagerTest.TwoPLTest (50 ms)
[ RUN      ] LockManagerTest.UpgradeLockTest
2022-08-24 07:24:37 [others/bustub2020/src/include/concurrency/lock_manager.h:62:LockManager] INFO  - Cycle detection thread launched
2022-08-24 07:24:37 [others/bustub2020/src/include/concurrency/lock_manager.h:69:~LockManager] INFO  - Cycle detection thread stopped
[       OK ] LockManagerTest.UpgradeLockTest (50 ms)
[ RUN      ] LockManagerTest.GraphEdgeTest
2022-08-24 07:24:37 [others/bustub2020/src/include/concurrency/lock_manager.h:62:LockManager] INFO  - Cycle detection thread launched
2022-08-24 07:24:37 [others/bustub2020/src/include/concurrency/lock_manager.h:69:~LockManager] INFO  - Cycle detection thread stopped
[       OK ] LockManagerTest.GraphEdgeTest (50 ms)
[ DISABLED ] LockManagerTest.DISABLED_BasicCycleTest
[ RUN      ] LockManagerTest.BasicDeadlockDetectionTest
2022-08-24 07:24:37 [others/bustub2020/src/include/concurrency/lock_manager.h:62:LockManager] INFO  - Cycle detection thread launched
Segmentation fault

It costs me a lot of time to find the bug ...

yinghaoyu avatar Aug 24 '22 07:08 yinghaoyu