airdcpp-web / airdcpp-webclient

Communal peer-to-peer file sharing application for file servers/NAS devices
https://airdcpp-web.github.io
179 stars 33 forks source link

Can't compile application in a FreeBSD jail on Truenas (13.3) / application crashes #481

Closed 35gh closed 2 weeks ago

35gh commented 3 weeks ago

Current UI and client versions:

AirDC++w 2.12.2 Web Client 2.13.0 Beta

Operating system:

FreeBSD 13.3-RELEASE-p4 n257491-41f6a830f8e TRUENAS amd64

Steps to reproduce the issue:

I've compiled Airdcpp in a Truenas Core jail. Compilation and configuration works, but when I launch airdcpp app it crashes with error:

Starting.
.

Signal: 11
Process ID: 83891
Time: 10:40:37
OS version: FreeBSD 13.3-RELEASE-p4 (amd64)
Client version: AirDC++w 2.12.2

Collecting crash information, please wait...
0x220f00 in function  [0x0000000]
0x21eda0 in function  [0x0000000]
0x82244f4af in function  [0x0000000]
0x82244ea6b in function  [0x0000000]
0x7ffffffff2d3 in function  [0x0000000]
0x8239b1a6b in function  [0x0000000]
0x8239a8f80 in function  [0x0000000]
0x823b12e15 in function  [0x0000000]
0x823b12d0b in function  [0x0000000]
0x823a43541 in function  [0x0000000]
0x2173a0 in function  [0x0000000]
0x217067 in function  [0x0000000]

Note: Previous version AirDC++w 2.12.1 amd64 / Web UI 2.12.0 works perfectly on the same system in a FreeBSD 13.2 jail.

gunnarrt commented 3 weeks ago

Seen this? https://github.com/airdcpp-web/airdcpp-webclient/issues/478

35gh commented 3 weeks ago

@gunnarrt thank you for pointing this to me. I switched to the develop branch but now compilation is failing:

In file included from /root/airdcpp-webclient/airdcpp-core/airdcpp/hub/Client.h:34:
/root/airdcpp-webclient/airdcpp-core/airdcpp/user/OnlineUser.h:241:25: warning: class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class]
  199 |         ~OnlineUser() noexcept final;
      |                                ^
/root/airdcpp-webclient/airdcpp-core/airdcpp/user/OnlineUser.h:199:7: note: mark 'dcpp::OnlineUser' as 'final' to silence this warning
  199 | class OnlineUser :  public FastAlloc<OnlineUser>, public intrusive_ptr_base<OnlineUser>, private boost::noncopyable {
      |       ^
In file included from /root/airdcpp-webclient/airdcpp-core/airdcpp/hub/HBRIValidation.cpp:30:
/root/airdcpp-webclient/airdcpp-core/airdcpp/connection/socket/SSLSocket.h:41:33: warning: class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class]
   33 | class SSLSocketException : public SocketException {
      |                          final
   34 | public:
   35 | #ifdef _DEBUG
   36 |         explicit SSLSocketException(const string& aError) noexcept : SocketException("SSLSocketException: " + aError) { }
   37 | #else //_DEBUG
   38 |         SSLSocketException(const string& aError) noexcept : SocketException(aError) { }
   39 | #endif // _DEBUG
   40 |         explicit SSLSocketException(int aError) noexcept : SocketException(aError) { }
   41 |         ~SSLSocketException() noexcept final = default;
      |                                        ^
/root/airdcpp-webclient/airdcpp-core/airdcpp/connection/socket/SSLSocket.h:33:7: note: mark 'dcpp::SSLSocketException' as 'final' to silence this warning
   33 | class SSLSocketException : public SocketException {
      |       ^
/root/airdcpp-webclient/airdcpp-core/airdcpp/hub/HBRIValidation.cpp:142:27: error: use of undeclared identifier 'jthread'; did you mean 'pread'?
  142 |         hbriThread = make_unique<jthread>([this, aConnectInfo, aRequest, aMessageF] {
      |                                  ^~~~~~~
      |                                  pread
/usr/include/unistd.h:421:10: note: 'pread' declared here
  421 | ssize_t  pread(int, void *, size_t, off_t);
      |          ^
/root/airdcpp-webclient/airdcpp-core/airdcpp/hub/HBRIValidation.cpp:142:15: error: no matching function for call to 'make_unique'
  142 |         hbriThread = make_unique<jthread>([this, aConnectInfo, aRequest, aMessageF] {
      |                      ^~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/__memory/unique_ptr.h:688:1: note: candidate template ignored: invalid explicitly-specified argument for template parameter '_Tp'
  688 | make_unique(_Args&&... __args) {
      | ^
/usr/include/c++/v1/__memory/unique_ptr.h:694:1: note: candidate template ignored: invalid explicitly-specified argument for template parameter '_Tp'
  694 | make_unique(size_t __n) {
      | ^
/usr/include/c++/v1/__memory/unique_ptr.h:701:5: note: candidate template ignored: invalid explicitly-specified argument for template parameter '_Tp'
  701 |     make_unique(_Args&&...) = delete;
      |     ^
1 warning and 4 errors generated.
--- airdcpp-core/CMakeFiles/airdcpp.dir/airdcpp/hub/HBRIValidation.cpp.o ---
*** [airdcpp-core/CMakeFiles/airdcpp.dir/airdcpp/hub/HBRIValidation.cpp.o] Error code 1

make[2]: stopped in /root/airdcpp-webclient
1 warning and 2 errors generated.
--- airdcpp-core/CMakeFiles/airdcpp.dir/airdcpp/hub/AdcHub.cpp.o ---
*** [airdcpp-core/CMakeFiles/airdcpp.dir/airdcpp/hub/AdcHub.cpp.o] Error code 1

make[2]: stopped in /root/airdcpp-webclient
In file included from /root/airdcpp-webclient/airdcpp-core/airdcpp/hub/activity/ActivityManager.cpp:22:
In file included from /root/airdcpp-webclient/airdcpp-core/airdcpp/hub/ClientManager.h:24:
In file included from /root/airdcpp-webclient/airdcpp-core/airdcpp/hub/ClientManagerListener.h:23:
/root/airdcpp-webclient/airdcpp-core/airdcpp/user/OnlineUser.h:241:25: warning: class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class]
  199 |         ~OnlineUser() noexcept final;
      |                                ^
/root/airdcpp-webclient/airdcpp-core/airdcpp/user/OnlineUser.h:199:7: note: mark 'dcpp::OnlineUser' as 'final' to silence this warning
  199 | class OnlineUser :  public FastAlloc<OnlineUser>, public intrusive_ptr_base<OnlineUser>, private boost::noncopyable {
      |       ^
1 warning generated.
1 warning generated.
1 warning generated.
1 warning generated.
1 warning generated.
2 errors

make[2]: stopped in /root/airdcpp-webclient
--- airdcpp-core/CMakeFiles/airdcpp.dir/all ---
*** [airdcpp-core/CMakeFiles/airdcpp.dir/all] Error code 2

make[1]: stopped in /root/airdcpp-webclient
1 error

make[1]: stopped in /root/airdcpp-webclient
*** [all] Error code 2

make: stopped in /root/airdcpp-webclient
1 error

make: stopped in /root/airdcpp-webclient
maksis commented 3 weeks ago

Make sure that you have pulled the latest changes from the branch, I believe that you are trying to compile an old commit

35gh commented 3 weeks ago

I restarted everything from the beginning, same error. Just to be sure, here's what I'm doing:

rm -rf airdcpp-webclient
git clone https://github.com/airdcpp-web/airdcpp-webclient.git
cd airdcpp-webclient
git checkout develop
cmake .
make -j8
maksis commented 2 weeks ago

Does your operating system have the latest updates installed? If yes, looks like the C++ library is just missing support for std::jthread. I probably need to remove the usage of std::jthread in that case as the support in clang seems to be a bit problematic.

Could you also post the output of clang -v?

35gh commented 2 weeks ago

Yes, system is up to date as much as possible with Truenas Core. Here is the output of clang:

FreeBSD clang version 17.0.6 (https://github.com/llvm/llvm-project.git llvmorg-17.0.6-0-g6009708b4367)
Target: x86_64-unknown-freebsd13.3
Thread model: posix
InstalledDir: /usr/bin
maksis commented 2 weeks ago

You can try replacing jthread with thread in these two files: airdcpp-core/airdcpp/hub/HBRIValidation.cpp and airdcpp-core/airdcpp/hub/HBRIValidation.h

35gh commented 2 weeks ago

It compiled (with a lot of warnings, such as the one below) and it's working now, thank you!

In file included from /root/airdcpp-webclient/airdcpp-core/airdcpp/hub/Client.h:34:
/root/airdcpp-webclient/airdcpp-core/airdcpp/user/OnlineUser.h:241:25: warning: class with destructor marked 'final' cannot be inherited from [-Wfinal-dtor-non-final-class]
  199 |         ~OnlineUser() noexcept final;
      |                                ^
/root/airdcpp-webclient/airdcpp-core/airdcpp/user/OnlineUser.h:199:7: note: mark 'dcpp::OnlineUser' as 'final' to silence this warning
35gh commented 2 weeks ago

Update: application crashes when I select the "Queue" tab or when I try to download anything.

Time: 10:42:21
OS version: FreeBSD 13.3-RELEASE-p4 (amd64)
Client version: AirDC++w 2.13.0b-d

0x221430 in function [unknown] in file /usr/include/c++/v1/vector:963 [0x0000000]
0x21f1f0 in function [unknown] in file /usr/include/c++/v1/vector:963 [0x0000000]
0x824ea94af in function [unknown] in file /usr/include/c++/v1/vector:963 [0x0000000]
0x824ea8a6b in function [unknown] in file /usr/include/c++/v1/vector:963 [0x0000000]
0x7ffffffff2d3 in function [unknown] in file /usr/include/c++/v1/vector:963 [0x0000000]
0x824ea3a8e in function [unknown] in file /usr/include/c++/v1/vector:963 [0x0000000]
0x823b9de38 in function [unknown] in file /usr/include/c++/v1/vector:963 [0x0000000]
0x823bb3c4e in function [unknown] in file /usr/include/c++/v1/vector:963 [0x0000000]
0x823bb3bbf in function [unknown] in file /usr/include/c++/v1/vector:963 [0x0000000]
0x823cb89de in function [unknown] in file /usr/include/c++/v1/vector:963 [0x0000000]
0x823cce3ac in function [unknown] in file /usr/include/c++/v1/vector:963 [0x0000000]
0x823cd5f02 in function [unknown] in file /usr/include/c++/v1/vector:963 [0x0000000]
0x823ccea67 in function [unknown] in file /usr/include/c++/v1/vector:963 [0x0000000]
0x823d8c48b in function [unknown] in file /usr/include/c++/v1/vector:963 [0x0000000]
0x823db1cd0 in function [unknown] in file /usr/include/c++/v1/vector:963 [0x0000000]
0x823e886b6 in function [unknown] in file /usr/include/c++/v1/vector:963 [0x0000000]
0x823df9734 in function [unknown] in file /usr/include/c++/v1/vector:963 [0x0000000]
0x823df9ea8 in function [unknown] in file /usr/include/c++/v1/vector:963 [0x0000000]
0x823e06fd7 in function [unknown] in file /usr/include/c++/v1/vector:963 [0x0000000]
0x823e14fd3 in function [unknown] in file /usr/include/c++/v1/vector:963 [0x0000000]
0x823e16f0a in function [unknown] in file /usr/include/c++/v1/vector:963 [0x0000000]
0x823e1707b in function [unknown] in file /usr/include/c++/v1/vector:963 [0x0000000]
0x823e037be in function [unknown] in file /usr/include/c++/v1/vector:963 [0x0000000]
0x823e16e40 in function [unknown] in file /usr/include/c++/v1/vector:963 [0x0000000]
0x823e15671 in function [unknown] in file /usr/include/c++/v1/vector:963 [0x0000000]
0x823e15545 in function [unknown] in file /usr/include/c++/v1/vector:963 [0x0000000]
0x823e16069 in function [unknown] in file /usr/include/c++/v1/vector:963 [0x0000000]
0x823df4466 in function [unknown] in file /usr/include/c++/v1/vector:963 [0x0000000]
0x823df3fd1 in function [unknown] in file /usr/include/c++/v1/vector:963 [0x0000000]
0x823defb65 in function [unknown] in file /usr/include/c++/v1/vector:963 [0x0000000]
0x82cdf194d in function [unknown] in file /usr/include/c++/v1/vector:963 [0x0000000]
maksis commented 2 weeks ago

You should post a new issue with a crash log taken from a debugger (see https://github.com/airdcpp-web/airdcpp-webclient/blob/master/.github/CONTRIBUTING.md#application-freezesdeadlocks for instructions) as your log generated by the application doesn't seem to have valid information for some reason

35gh commented 2 weeks ago

Thank you, new issue created: https://github.com/airdcpp-web/airdcpp-webclient/issues/486

maksis commented 2 weeks ago

Shouldn’t be closed yet