Skip to content

Conversation

fanquake
Copy link
Member

@fanquake fanquake commented Mar 29, 2023

Similar to #27298. Working for me on x86_64 and solves the issue I currently see with TSAN on aarch64 with master (6882828):

crc32c/src/crc32c_arm64.cc:101:26: runtime error: load of misaligned address 0xffff84400406 for type 'uint64_t' (aka 'unsigned long'), which requires 8 byte alignment
0xffff84400406: note: pointer points here
 b9 c5 22 00 01 01  1a 6c 65 76 65 6c 64 62  2e 42 79 74 65 77 69 73  65 43 6f 6d 70 61 72 61  74 6f
             ^ 
    #0 0xaaaaaddaf0b4 in crc32c::ExtendArm64(unsigned int, unsigned char const*, unsigned long) src/./src/crc32c/src/crc32c_arm64.cc:101:26
    #1 0xaaaaadd2c838 in leveldb::crc32c::Value(char const*, unsigned long) src/./leveldb/util/crc32c.h:20:60
    #2 0xaaaaadd2c838 in leveldb::log::Reader::ReadPhysicalRecord(leveldb::Slice*) src/./src/leveldb/db/log_reader.cc:246:29
    #3 0xaaaaadd2ba9c in leveldb::log::Reader::ReadRecord(leveldb::Slice*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) src/./src/leveldb/db/log_reader.cc:72:38
    #4 0xaaaaadd41710 in leveldb::VersionSet::Recover(bool*) src/./src/leveldb/db/version_set.cc:910:19
    #5 0xaaaaadcf9fec in leveldb::DBImpl::Recover(leveldb::VersionEdit*, bool*) src/./src/leveldb/db/db_impl.cc:320:18
    #6 0xaaaaadd12068 in leveldb::DB::Open(leveldb::Options const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, leveldb::DB**) src/./src/leveldb/db/db_impl.cc:1487:20
    #7 0xaaaaad314e80 in CDBWrapper::CDBWrapper(DBParams const&) src/./src/dbwrapper.cpp:156:30
    #8 0xaaaaace94880 in CBlockTreeDB::CBlockTreeDB(DBParams const&) src/./txdb.h:89:23
    #9 0xaaaaace94880 in std::_MakeUniq<CBlockTreeDB>::__single_object std::make_unique<CBlockTreeDB, DBParams>(DBParams&&) /usr/bin/../lib/gcc/aarch64-linux-gnu/11/../../../../include/c++/11/bits/unique_ptr.h:962:34
    #10 0xaaaaace94880 in ChainTestingSetup::ChainTestingSetup(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<char const*, std::allocator<char const*> > const&) src/./src/test/util/setup_common.cpp:188:51
    #11 0xaaaaace95da0 in TestingSetup::TestingSetup(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<char const*, std::allocator<char const*> > const&, bool, bool) src/./src/test/util/setup_common.cpp:243:7
    #12 0xaaaaace96730 in TestChain100Setup::TestChain100Setup(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<char const*, std::allocator<char const*> > const&, bool, bool) src/./src/test/util/setup_common.cpp:274:7
    #13 0xaaaaac1ddbc8 in blockfilter_index_tests::BuildChainTestingSetup::BuildChainTestingSetup() src/./src/test/blockfilter_index_tests.cpp:26:8
    #14 0xaaaaac1ddbc8 in blockfilter_index_tests::blockfilter_index_initial_sync::blockfilter_index_initial_sync() src/./src/test/blockfilter_index_tests.cpp:112:1
    #15 0xaaaaac1ddbc8 in blockfilter_index_tests::blockfilter_index_initial_sync_invoker() src/./src/test/blockfilter_index_tests.cpp:112:1
    #16 0xaaaaabf08f7c in boost::function0<void>::operator()() const /usr/include/boost/function/function_template.hpp:763:14
    #17 0xaaaaabf95468 in boost::detail::forward::operator()() /usr/include/boost/test/impl/execution_monitor.ipp:1388:32
    #18 0xaaaaabf95468 in boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) /usr/include/boost/function/function_template.hpp:137:18
    #19 0xaaaaabf8e12c in boost::function0<int>::operator()() const /usr/include/boost/function/function_template.hpp:763:14
    #20 0xaaaaabe7be14 in boost::execution_monitor::catch_signals(boost::function<int ()> const&) /usr/include/boost/test/impl/execution_monitor.ipp:903:16
    #21 0xaaaaabe7c1c0 in boost::execution_monitor::execute(boost::function<int ()> const&) /usr/include/boost/test/impl/execution_monitor.ipp:1301:16
    #22 0xaaaaabe6f47c in boost::execution_monitor::vexecute(boost::function<void ()> const&) /usr/include/boost/test/impl/execution_monitor.ipp:1397:5
    #23 0xaaaaabe75124 in boost::unit_test::unit_test_monitor_t::execute_and_translate(boost::function<void ()> const&, unsigned long) /usr/include/boost/test/impl/unit_test_monitor.ipp:49:9
    #24 0xaaaaabed19fc in boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /usr/include/boost/test/impl/framework.ipp:815:44
    #25 0xaaaaabed0f6c in boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /usr/include/boost/test/impl/framework.ipp:784:58
    #26 0xaaaaabed0f6c in boost::unit_test::framework::state::execute_test_tree(unsigned long, unsigned long, boost::unit_test::framework::state::random_generator_helper const*) /usr/include/boost/test/impl/framework.ipp:784:58
    #27 0xaaaaabe73878 in boost::unit_test::framework::run(unsigned long, bool) /usr/include/boost/test/impl/framework.ipp:1721:29
    #28 0xaaaaabe9d244 in boost::unit_test::unit_test_main(boost::unit_test::test_suite* (*)(int, char**), int, char**) /usr/include/boost/test/impl/unit_test_main.ipp:250:9
    #29 0xffff8f0773f8  (/lib/aarch64-linux-gnu/libc.so.6+0x273f8) (BuildId: f37f3aa07c797e333fd106472898d361f71798f5)
    #30 0xffff8f0774c8 in __libc_start_main (/lib/aarch64-linux-gnu/libc.so.6+0x274c8) (BuildId: f37f3aa07c797e333fd106472898d361f71798f5)
    #31 0xaaaaabda55ac in _start (/home/fedora/ci_scratch/ci/scratch/build/bitcoin-aarch64-unknown-linux-gnu/src/test/test_bitcoin+0x10e55ac) (BuildId: b7909adaefd9db6cd6a7c4d3d40207cf6bdaf4b3)

SUMMARY: UndefinedBehaviorSanitizer: misaligned-pointer-use crc32c/src/crc32c_arm64.cc:101:26 in

@fanquake fanquake added the Tests label Mar 29, 2023
@DrahtBot
Copy link
Contributor

DrahtBot commented Mar 29, 2023

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK dergoegge, MarcoFalke

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #27084 (ci: A few fixes of ccache issues by hebasto)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@maflcko
Copy link
Member

maflcko commented Mar 29, 2023

You will probably need to do the same for fuzz asan?

@maflcko
Copy link
Member

maflcko commented Mar 29, 2023

Also, need to edit Cirrus CI to do the same

@fanquake
Copy link
Member Author

You will probably need to do the same for fuzz asan?

Will add.

Also, need to edit Cirrus CI to do the same

Can we even do this for native_asan given there is no 2304-lto image listed here: https://cloud.google.com/compute/docs/images/os-details#ubuntu_lts ?

@fanquake fanquake changed the title ci: use LLVM/clang-16 in ASAN job ci: use LLVM/clang-16 in native_asan job Mar 29, 2023
@fanquake
Copy link
Member Author

native_fuzz split into #27363, as that is not blocked up upstream image issues/decisions.

@Sjors
Copy link
Member

Sjors commented Mar 30, 2023

I haven't tried to reproduce the original issue, since I don't have an aarch64 machine, but this works for me on Ubuntu 22.10 with AMD Ryzen 7950X, Docker version 23.0.2:

MAKEJOBS="-j32" CCACHE_SIZE=1G FILE_ENV="ci/test/00_setup_env_native_asan.sh" ./ci/test_run_all.sh

@fanquake fanquake marked this pull request as draft March 31, 2023 09:17
@maflcko maflcko self-requested a review March 31, 2023 12:18
@DrahtBot DrahtBot removed the request for review from maflcko March 31, 2023 12:19
@DrahtBot DrahtBot mentioned this pull request Apr 3, 2023
16 tasks
@maflcko maflcko added this to the 26.0 milestone Apr 17, 2023
@fanquake
Copy link
Member Author

Lunar should be released on the 20th, https://discourse.ubuntu.com/t/lunar-lobster-release-schedule/27284, and hopefully the Gioogle Cloud images will be available shortly after that.

@fanquake
Copy link
Member Author

Ubuntu 23.04 has been released: https://lists.ubuntu.com/archives/ubuntu-announce/2023-April/000289.html. So the Google Cloud images should be available soon.

@fanquake fanquake marked this pull request as ready for review April 20, 2023 20:49
@maflcko
Copy link
Member

maflcko commented Apr 21, 2023

I can see it on https://console.cloud.google.com/compute/instancesAdd , but CI doesn't for some reason?

Screenshot 2023-04-21 at 09-33-34 Compute Engine – free-micro – Google Cloud console

@maflcko
Copy link
Member

maflcko commented Apr 21, 2023

review ACK a440295

fanquake added a commit to fanquake/bitcoin that referenced this pull request Apr 21, 2023
Followup to bitcoin#27360, where we migrated this job to Ubuntu 23.04, which
ships with newer versions of the tools:
https://packages.ubuntu.com/lunar/bpfcc-tools.
fanquake added a commit to fanquake/bitcoin that referenced this pull request Apr 21, 2023
Followup to bitcoin#27360, where we migrated this job to Ubuntu 23.04, which
ships with newer versions of the tools:
https://packages.ubuntu.com/lunar/bpfcc-tools.
@fanquake
Copy link
Member Author

�[0;34m node0 2023-04-21T16:34:04.866961Z [http] [httpserver.cpp:308] [ThreadHTTP] [http] Exited http event loop �[0m
�[0;34m node0 2023-04-21T16:34:04.867449Z [shutoff] [httpserver.cpp:505] [StopHTTPServer] [http] Stopped HTTP server �[0m
�[0;34m node0 2023-04-21T16:34:04.868612Z [msghand] [logging.h:263] [error] ERROR: ProcessNewBlock: AcceptBlock FAILED (AcceptBlock: Failed to find position to write new block to disk) �[0m
�[0;34m node0 2023-04-21T16:34:04.869269Z [msghand] [util/thread.cpp:22] [TraceThread] msghand thread exit �[0m
�[0;34m node0 2023-04-21T16:34:04.889834Z [net] [util/thread.cpp:22] [TraceThread] net thread exit �[0m
�[0;36m test  2023-04-21T16:34:04.894000Z TestFramework.p2p (WARNING): Connection lost to 127.0.0.1:17120 due to [Errno 104] Connection reset by peer �[0m
�[0;34m node0 2023-04-21T16:34:04.894088Z [shutoff] [net.cpp:1526] [DumpAddresses] [net] Flushed 0 addresses to peers.dat  3ms �[0m
�[0;34m node0 2023-04-21T16:34:04.894130Z [shutoff] [net.cpp:593] [CloseSocketDisconnect] [net] disconnecting peer=53 �[0m
�[0;34m node0 2023-04-21T16:34:04.894402Z [shutoff] [net_processing.cpp:1544] [FinalizeNode] [net] Cleared nodestate for peer=53 �[0m
�[0;36m test  2023-04-21T16:34:04.897000Z TestFramework (ERROR): Assertion failed �[0m
�[0;36m                                   Traceback (most recent call last):�[0m
�[0;36m                                     File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 132, in main�[0m
�[0;36m                                       self.run_test()�[0m
�[0;36m                                     File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/feature_block.py", line 1292, in run_test�[0m
�[0;36m                                       self.send_blocks(blocks, True, timeout=2440)�[0m
�[0;36m                                     File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/feature_block.py", line 1435, in send_blocks�[0m
�[0;36m                                       self.helper_peer.send_blocks_and_test(blocks, self.nodes[0], success=success, reject_reason=reject_reason, force_send=force_send, timeout=timeout, expect_disconnect=reconnect)�[0m
�[0;36m                                     File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/p2p.py", line 731, in send_blocks_and_test�[0m
�[0;36m                                       self.wait_until(�[0m
�[0;36m                                     File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/p2p.py", line 463, in wait_until�[0m
�[0;36m                                       wait_until_helper(test_function, timeout=timeout, lock=p2p_lock, timeout_factor=self.timeout_factor)�[0m
�[0;36m                                     File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/util.py", line 267, in wait_until_helper�[0m
�[0;36m                                       if predicate():�[0m
�[0;36m                                          ^^^^^^^^^^^�[0m
�[0;36m                                     File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/p2p.py", line 460, in test_function�[0m
�[0;36m                                       assert self.is_connected�[0m
�[0;36m                                   AssertionError�[0m
�[0;36m test  2023-04-21T16:34:04.900000Z TestFramework (DEBUG): Closing down network thread �[0m
�[0;34m node0 2023-04-21T16:34:04.901483Z [scheduler] [util/thread.cpp:22] [TraceThread] scheduler thread exit �[0m
�[0;34m node0 2023-04-21T16:34:04.903621Z [shutoff] [kernel/mempool_persist.cpp:168] [DumpMempool] Writing 0 unbroadcast transactions to disk. �[0m
�[0;34m node0 2023-04-21T16:34:04.905760Z [shutoff] [kernel/mempool_persist.cpp:181] [DumpMempool] Dumped mempool: 2.009e-05s to copy, 0.00218644s to dump �[0m
�[0;34m node0 2023-04-21T16:34:04.905796Z [shutoff] [policy/fees.cpp:1011] [FlushUnconfirmed] [estimatefee] Recorded 0 unconfirmed txs from mempool in 6.309e-06s �[0m
�[0;34m node0 2023-04-21T16:34:04.907594Z [shutoff] [logging/timer.h:58] [Log] [bench] FlushStateToDisk: write block and undo data to disk started �[0m
�[0;36m test  2023-04-21T16:34:04.950000Z TestFramework (INFO): Stopping nodes �[0m
�[0;36m test  2023-04-21T16:34:04.950000Z TestFramework.node0 (DEBUG): Stopping node �[0m

�[0;34m node0 stderr Error: Disk space is too low! �[0m

�[1mTEST                                                   | STATUS    | DURATION

�[0m�[0;31mfeature_block.py                                       | ✖ Failed  | 59 s
�[0m�[0;31m�[1m
ALL                                                    | ✖ Failed  | 59 s (accumulated) 
�[0m�[0mRuntime: 59 s

fanquake added a commit to fanquake/bitcoin that referenced this pull request Apr 27, 2023
Followup to bitcoin#27360, where we migrated this job to Ubuntu 23.04, which
ships with newer versions of the tools:
https://packages.ubuntu.com/lunar/bpfcc-tools.
@0xB10C
Copy link
Contributor

0xB10C commented Apr 28, 2023

Can't really comment on the change of using clang-16. The second commit dropping the bpfcc-tools from the PPA looks fine. You could remove the reference to this PR from the description of 5fbda45.

@fanquake
Copy link
Member Author

fanquake commented May 1, 2023

You could remove the reference to this PR

Yep, dropped.

fanquake added 2 commits May 2, 2023 12:02
We've migrated this job to Ubuntu 23.04, which
ships with newer versions of the tools:
https://packages.ubuntu.com/lunar/bpfcc-tools.
@dergoegge
Copy link
Member

utACK f952e67

@DrahtBot DrahtBot requested a review from maflcko May 2, 2023 12:18
@maflcko
Copy link
Member

maflcko commented May 2, 2023

lgtm ACK f952e67

@DrahtBot DrahtBot removed the request for review from maflcko May 2, 2023 12:35
@fanquake fanquake merged commit 7b45d17 into bitcoin:master May 2, 2023
@fanquake fanquake deleted the asan_llvm_16 branch May 2, 2023 13:29
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request May 4, 2023
@0xB10C 0xB10C mentioned this pull request May 5, 2023
@bitcoin bitcoin locked and limited conversation to collaborators May 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants