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

Missing include for std::set in sync.cpp #3516

Open
patricklodder opened this issue Apr 11, 2024 · 3 comments · May be fixed by #3313
Open

Missing include for std::set in sync.cpp #3516

patricklodder opened this issue Apr 11, 2024 · 3 comments · May be fixed by #3313
Labels
Milestone

Comments

@patricklodder
Copy link
Member

patricklodder commented Apr 11, 2024

Originally posted by @victorsk2019 in #3512 (comment)

Just a quick note that I also ran test on another Linux installation in VirtualBox and got following compilation error:

sync.cpp:60:14: error: ‘set’ in namespace ‘std’ does not name a template type
   60 | typedef std::set<std::pair<void*, void*> > InvLockOrders;
      |              ^~~
sync.cpp:14:1: note: ‘std::set’ is defined in header ‘<set>’; did you forget to ‘#include <set>’?
   13 | #include <boost/thread.hpp>
  +++ |+#include <set>
   14 | 
sync.cpp:72:5: error: ‘InvLockOrders’ does not name a type; did you mean ‘LockOrders’?
   72 |     InvLockOrders invlockorders;
      |     ^~~~~~~~~~~~~
      |     LockOrders
sync.cpp: In function ‘void push_lock(void*, const CLockLocation&, bool)’:
sync.cpp:123:18: error: ‘struct LockData’ has no member named ‘invlockorders’; did you mean ‘lockorders’?
  123 |         lockdata.invlockorders.insert(p2);
      |                  ^~~~~~~~~~~~~
      |                  lockorders
sync.cpp: In function ‘void DeleteLock(void*)’:
sync.cpp:172:18: error: ‘struct LockData’ has no member named ‘invlockorders’; did you mean ‘lockorders’?
  172 |         lockdata.invlockorders.erase(invitem);
      |                  ^~~~~~~~~~~~~
      |                  lockorders
sync.cpp:175:5: error: ‘InvLockOrders’ has not been declared
  175 |     InvLockOrders::iterator invit = lockdata.invlockorders.lower_bound(item);
      |     ^~~~~~~~~~~~~
sync.cpp:176:12: error: ‘invit’ was not declared in this scope; did you mean ‘int’?
  176 |     while (invit != lockdata.invlockorders.end() && invit->first == cs) {
      |            ^~~~~
      |            int
sync.cpp:176:30: error: ‘struct LockData’ has no member named ‘invlockorders’; did you mean ‘lockorders’?
  176 |     while (invit != lockdata.invlockorders.end() && invit->first == cs) {
      |                              ^~~~~~~~~~~~~
      |                              lockorders
sync.cpp:179:18: error: ‘struct LockData’ has no member named ‘invlockorders’; did you mean ‘lockorders’?
  179 |         lockdata.invlockorders.erase(invit++);
      |                  ^~~~~~~~~~~~~
      |                  lockorders
make[2]: *** [Makefile:6600: libdogecoin_util_a-sync.o] Error 1
make[2]: Leaving directory '/home/me/projects/fromgit/dogecoin/PR-3512/dogecoin/src'
make[1]: *** [Makefile:9882: all-recursive] Error 1
make[1]: Leaving directory '/home/me/projects/fromgit/dogecoin/PR-3512/dogecoin/src'
make: *** [Makefile:695: all-recursive] Error 1

This error was fixed by adding #include <set> in sync.cpp (as message advises).

config_vbox.log


Additional variable for reproduction: must be configured with --enable-debug for this to occur on boost > 1.78

@patricklodder
Copy link
Member Author

@victorsk2019

I see in your config.log that this is gcc 13.2, but I cannot find your boost version in there. Which version of boost are you using? You can find this with:

$ grep "define BOOST_VERSION " /path/to/include/boost/version.hpp
#define BOOST_VERSION 108200

@victorsk2019
Copy link

$ grep "define BOOST_VERSION " /path/to/include/boost/version.hpp
#define BOOST_VERSION 108200

I get #define BOOST_VERSION 108400

@patricklodder
Copy link
Member Author

Conditions for this to occur:

  • boost > 1.78
  • configuring with --enable-debug

I have reproduced this on gentoo x86_64 with boost 1.84 and macOS arm64 with boost 1.82.

The cleanest fix would be to write unit tests for #3313 and use that, as that fully takes care of this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants