Skip to content

Conversation

@maflcko
Copy link
Member

@maflcko maflcko commented Jun 19, 2020

This reverts a hacky workaround from commit b83cc0f, which only happens to work due to compiler optimizations. Then, it actually fixes the linker error.

The underlying problem is that the wallet includes symbols from the server (ui_interface), which usually results in linker failures. Though, in this specific case the linker failures have not been observed (unless -O0) because our compilers were smart enough to strip unused symbols.

Fix the underlying problem by creating a new header-only with the needed symbol and move ui_interface to node to clarify that this is part of libbitcoin_server.

@maflcko maflcko force-pushed the 2006-WalletNoServerSym branch 2 times, most recently from fa024ae to faa4d7c Compare June 19, 2020 22:27
@DrahtBot
Copy link
Contributor

DrahtBot commented Jun 20, 2020

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

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.

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approach ACK, tested with GCC 7.5.0 -- works as expected.

The underlying problem is that the wallet includes symbols from the server (ui_interface), which usually results in linker failures.

Trying to get the complete understanding of linker failures. Could you elaborate or point out further reading the reasons of linker failures.

From my current understanding, if a symbol is exported, it could be linked to, no?

@maflcko
Copy link
Member Author

maflcko commented Jun 20, 2020

Trying to get the complete understanding of linker failures. Could you elaborate or point out further reading the reasons of linker failures.

@maflcko maflcko force-pushed the 2006-WalletNoServerSym branch from faa4d7c to fa30d36 Compare June 20, 2020 10:13
@maflcko
Copy link
Member Author

maflcko commented Jun 20, 2020

Removed unused includes as requested by @hebasto

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK fa30d36c5a94cd2f71185162b577e05ab9adf717, tested on Linux Mint 19.3 (x86_64) with both GCC 7.5.0 and Clang 6.0.0, using -O0 compiler option.

@practicalswift
Copy link
Contributor

Concept ACK

Thanks for fixing! This -O0 gotcha has annoyed me (mildly) for a while :)

@laanwj
Copy link
Member

laanwj commented Jun 24, 2020

This looks reasonable. It's important to be consistent about which libraries are allowed to use which symbols. Concept ACK.

MarcoFalke added 2 commits June 27, 2020 11:38
ui_interface is in libbitcoin_server and can not be included in the
wallet because the wallet does not link with server symbols.
@maflcko maflcko force-pushed the 2006-WalletNoServerSym branch from fa1264a to faabd97 Compare June 27, 2020 15:40
MarcoFalke added 3 commits June 27, 2020 11:49
-BEGIN VERIFY SCRIPT-

 # Move files
 git mv src/ui_interface.h                                          src/node/ui_interface.h
 git mv src/ui_interface.cpp                                        src/node/ui_interface.cpp
 sed -i -e 's/BITCOIN_UI_INTERFACE_H/BITCOIN_NODE_UI_INTERFACE_H/g' src/node/ui_interface.h

 # Adjust includes and makefile
 sed -i -e 's|ui_interface|node/ui_interface|g' $(git grep -l ui_interface)

 # Sort includes
 git diff -U0 | clang-format-diff -p1 -i -v

-END VERIFY SCRIPT-
@maflcko maflcko force-pushed the 2006-WalletNoServerSym branch from faabd97 to faca730 Compare June 27, 2020 15:49
@Sjors
Copy link
Member

Sjors commented Jun 29, 2020

ACK faca730

@maflcko
Copy link
Member Author

maflcko commented Jun 30, 2020

@hebasto Mind to re-ACK?

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-ACK faca730, since the previous review:

  • rebased
  • added "ci: Install fixed version of clang-format for linters" commit (related to #19095)

@laanwj
Copy link
Member

laanwj commented Jul 1, 2020

ACK faca730

@laanwj laanwj merged commit bb58866 into bitcoin:master Jul 1, 2020
@maflcko maflcko deleted the 2006-WalletNoServerSym branch July 1, 2020 20:51
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Dec 11, 2020
Summary:
```
FatalError has been copied from AbortNode, so the two should use the
same style to avoid confusion.

Follow-up to #18927
```

Backport of core [[bitcoin/bitcoin#19295 | PR19295]], [[bitcoin/bitcoin#19309 | PR19309]] and [[bitcoin/bitcoin#19331 | PR19331]].
[[bitcoin/bitcoin#19295 | PR19295]] is the original intent
[[bitcoin/bitcoin#19309 | PR19309]] is a hacky bug fix
[[bitcoin/bitcoin#19331 | PR19331]] reverts [[bitcoin/bitcoin#19309 | PR19309]] and fixes [[bitcoin/bitcoin#19295 | PR19295]].

In the end the relevant commits are:
bitcoin/bitcoin@fa02b47
bitcoin/bitcoin@fac96e6
bitcoin/bitcoin@fa72ca6
bitcoin/bitcoin@cccc278

Depends on D8649.

Test Plan:
With debug:
  ninja all check-all

Reviewers: #bitcoin_abc, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D8650
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants