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

Unit test failed because of error "pure virtual method called" #2927

Closed
doitian opened this issue Aug 10, 2021 · 0 comments · Fixed by #2924
Closed

Unit test failed because of error "pure virtual method called" #2927

doitian opened this issue Aug 10, 2021 · 0 comments · Fixed by #2924
Labels
t:bug Type: This doesn't seem right.

Comments

@doitian
Copy link
Member

doitian commented Aug 10, 2021

Environment

  • CKB version: v0.100.0-pre
  • Chain: N/A
  • Operating system: Linux
  • Arch: x64
  • Installation: Built from source

Describe the bug

Unit test sometimes failed because of "pure virtual method called" recently, such as in this ci check.

As recommended by @xxuejie , I try to reproduce it using rr.

  • Find out the test binary file like /home/ian/codebase/nervos/ckb/target/debug/deps/ckb_sync-60892a517e6c0f11

  • Run it and record using rr in a loop until the error occurs.

    while rr record /home/ian/codebase/nervos/ckb/target/debug/deps/ckb_sync-60892a517e6c0f11; do
        sleep 1
    done
    
  • Remember the last test case before the test quits. Now replay it in the debugger.

    rr replay --debugger rust-gdb
    gdb> break ckb_sync::synchronizer::tests::test_process_new_block
    gdb> run
    gdb> next
    

After several next, the error occurs again, then check the backtrace (attached below).

From the backtrace, we can see that the root cause is RocksDB. The test quits without closing the database first, as mentioned in the comment facebook/rocksdb#649 (comment) . The database is opened by TestNode. The test node does not exit gracefully, which leads to the error.

Attachments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t:bug Type: This doesn't seem right.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant