nzbgetcom / nzbget

Efficient usenet downloader
https://nzbget.com
GNU General Public License v2.0
308 stars 16 forks source link

1 failure is detected in the test module "SystemTests" #344

Closed sbraz closed 1 month ago

sbraz commented 1 month ago

Is there already an issue for your problem?

NZBGet Version

v24.2-stable

Platform

Linux/Docker

Environment

OS: Gentoo ~amd64

Current Behavior

The test suite fails:

7/7 Testing: SystemTests
7/7 Test: SystemTests
Command: "/var/tmp/portage/net-nntp/nzbget-24.2/work/nzbget-24.2_build/tests/system/SystemTests" "--log_level=message"
Directory: /var/tmp/portage/net-nntp/nzbget-24.2/work/nzbget-24.2_build/tests/system
"SystemTests" start time: Aug 06 01:12 CEST
Output:
----------------------------------------------------------
*** buffer overflow detected ***: terminated
Running 1 test case...
unknown location(0): fatal error: in "SystemInfoTest": signal: SIGABRT (application abort requested)
/var/tmp/portage/net-nntp/nzbget-24.2/work/nzbget-24.2/tests/system/SystemInfoTest.cpp(131): last checkpoint

*** 1 failure is detected in the test module "SystemTests"

<end of output>
Test time =   0.03 sec
----------------------------------------------------------
Test Failed.
"SystemTests" end time: Aug 06 01:12 CEST
"SystemTests" time elapsed: 00:00:00
----------------------------------------------------------

End testing: Aug 06 01:12 CEST

Expected Behavior

Tests should pass.

Steps To Reproduce

No response

Logs

No response

Extra information

The following build options were used:

cmake -C /var/tmp/portage/net-nntp/nzbget-24.2/work/nzbget-24.2_build/gentoo_common_config.cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr -DDISABLE_CURSES=no -DDISABLE_PARCHECK=no -DDISABLE_TLS=no -DDISABLE_GZIP=no -DUSE_OPENSSL=yes -DUSE_GNUTLS=no -DENABLE_TESTS=yes -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_TOOLCHAIN_FILE=/var/tmp/portage/net-nntp/nzbget-24.2/work/nzbget-24.2_build/gentoo_toolchain.cmake /var/tmp/portage/net-nntp/nzbget-24.2/work/nzbget-24.2
dnzbk commented 1 month ago

Only the test itself doesn't work? Is there an issue with "STATUS" tab? Does it work and show the correct data?

If don't mind, could you test this branch? You could run the tests with -V to see the extra logs, e.g.: ctest -C Debug --rerun-failed -V

sbraz commented 1 month ago

Since the test had failed, I hadn't attempted to continue the installation process and start nzbget.

I just did and, from what I see, the jsonrpc/status call returns valid data. However, the jsonrpc/configtemplates one is broken (ERROR Could not read configuration templates in my logs and nothing else happens). Is there any chance for them to be related or is it a completely different problem?

As for verbose tests on the test branch:

6/7 Test #6: ServerPoolTest ...................   Passed    0.01 sec
test 7
    Start 7: SystemTests

7: Test command: /var/tmp/portage/net-nntp/nzbget-24.2/work/nzbget-fix-SystemInfoTest_build/tests/system/SystemTests "--log_level=message"
7: Working Directory: /var/tmp/portage/net-nntp/nzbget-24.2/work/nzbget-fix-SystemInfoTest_build/tests/system
7: Test timeout computed to be: 1500
7: *** buffer overflow detected ***: terminated
7: Running 1 test case...
7: unknown location(0): fatal error: in "SystemInfoTest": signal: SIGABRT (application abort requested)
7: /var/tmp/portage/net-nntp/nzbget-24.2/work/nzbget-fix-SystemInfoTest/tests/system/SystemInfoTest.cpp(144): last checkpoint: "SystemInfoTest" test entry
7: 
7: *** 1 failure is detected in the test module "SystemTests"
7: 
7/7 Test #7: SystemTests ......................***Failed    0.03 sec

86% tests passed, 1 tests failed out of 7

Total Test time (real) =   0.08 sec

The following tests FAILED:
          7 - SystemTests (Failed)
Errors while running CTest
Output from these tests are in: /var/tmp/portage/net-nntp/nzbget-24.2/work/nzbget-fix-SystemInfoTest_build/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.

I'm running boost 1.85.0, could it have anything to do with the issue? I don't see too many distros shipping it. Even Arch is on 1.83.0. EDIT: same problem with boost 1.84.0, I couldn't test with anything older though.

dnzbk commented 1 month ago

Big thanks. I need to install Gentoo and test the app I think. I've always wanted to play around with this distro, but haven't gotten around to :) Regarding configtemplates - the ConfigTemplate option in nzbget.conf is incorrect, I suppose. The CMake config fixes this, but you need to fully install the application, not just build it. The default path is /usr/local/share/nzbget/nzbget.conf

dnzbk commented 1 month ago

Could you pull the latest changes from my test branch and see if the bug is fixed? I'd appreciate it.

sbraz commented 1 month ago

The branch passes the test, thanks!

7/7 Test #7: SystemTests ......................   Passed    0.16 sec

Any idea why you weren't seeing the overflow?

Regarding configtemplates - the ConfigTemplate option in nzbget.conf is incorrect, I suppose.

Looks like I don't have the example conf installed at all, very likely because of https://github.com/gentoo/gentoo/blob/a79f1bcd721d5426301baedf10a0e6c651b5626d/net-nntp/nzbget/nzbget-24.1.ebuild#L52-L53 I'll look into it :)

dnzbk commented 1 month ago

The branch passes the test, thanks!

Thank you.

Any idea why you weren't seeing the overflow?

I've seen the buffer overflow, but only on Gentoo (on macOS, BSD systems and other Linux distributions everything worked fine) and only in the Release build. The problem was in the buggy realpath function, I believe.