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

Failing Testcases when Logging is enabled #236

Closed
fnordspace opened this issue Dec 10, 2024 · 1 comment · Fixed by #244
Closed

Failing Testcases when Logging is enabled #236

fnordspace opened this issue Dec 10, 2024 · 1 comment · Fixed by #244
Assignees
Labels
bug Something isn't working

Comments

@fnordspace
Copy link
Contributor

Description

When logging is enabled in privat_settings.h, various testcases are failing with unknown file: error: SEH exception with code 0xc0000005 thrown in the test body.. The likely cause is that the buffer mapTxToLogId is not properly initialized since initLogging() is probably not being called.

Current Behavior

Example error in test/assets.cpp with the following stacktrace:

[ RUN      ] TestCoreAssets.AssetIteratorOwnershipAndPossession
(1438.9d0): Access violation - code c0000005 (first chance)

00000027`b74fd090 00007ff7`187e0b6c     test!qLogger::mapTxToLogIdAccess::addLogId+0x1ef
00000027`b74fd250 00007ff7`187d1ea0     test!qLogger::logMessage+0x2c
00000027`b74fd2a0 00007ff7`187bc83d     test!qLogger::logAssetIssuance<AssetIssuance>+0x20
00000027`b74fd2d0 00007ff7`187bec5e     test!std::`dynamic atexit destructor for '_Fac_tidy_reg''+0x1c71d
00000027`b74fd3a0 00007ff7`18b6d6b1     test!TestCoreAssets_AssetIteratorOwnershipAndPossession_Test::TestBody+0x8de
00000027`b74ff270 00007ff7`18b6d2bd     test!testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test,void>+0x31
00000027`b74ff2d0 00007ff7`18b44b53     test!testing::internal::HandleExceptionsInMethodIfSupported<testing::Test,void>+0x7d
00000027`b74ff3a0 00007ff7`18b4574e     test!testing::Test::Run+0xb3
00000027`b74ff3f0 00007ff7`18b45ef6     test!testing::TestInfo::Run+0xde
00000027`b74ff450 00007ff7`18b4d37e     test!testing::TestCase::Run+0xf6
00000027`b74ff4b0 00007ff7`18b6d921     test!testing::internal::UnitTestImpl::RunAllTests+0x35e
00000027`b74ff580 00007ff7`18b6d5dd     test!testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl,bool>+0x31
00000027`b74ff5e0 00007ff7`18b4661e     test!testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl,bool>+0x7d
00000027`b74ff6c0 00007ff7`18beb092     test!testing::UnitTest::Run+0x13e
00000027`b74ff770 00007ff7`18beb048     test!RUN_ALL_TESTS+0x22
00000027`b74ff7a0 00007ff7`18be8ae9     test!main+0x48
00000027`b74ff7d0 00007ff7`18be89d2     test!invoke_main+0x39
00000027`b74ff820 00007ff7`18be888e     test!__scrt_common_main_seh+0x132
00000027`b74ff890 00007ff7`18be8b7e     test!__scrt_common_main+0xe
00000027`b74ff8c0 00007ffa`551a259d     test!mainCRTStartup+0xe
00000027`b74ff8f0 00007ffa`5608af38     KERNEL32!BaseThreadInitThunk+0x1d
00000027`b74ff920 00000000`00000000     ntdll!RtlUserThreadStart+0x28

Two Possible Solutions

I see two potential approaches to resolve this issue:

  1. Disable logging for tests

    • Unset logging defines within the test setup
    • Or manually disable logging in private_settings.h including a note in the test's Readme.md about this configuration
  2. Initialize logging properly

    • Add proper call to initLogging() within the test setup when logging is enabled
    • Ensure mapTxToLogId buffer is properly initialized

Failing tests

[ FAILED ] TestCoreAssets.AssetIteratorOwnershipAndPossession
[ FAILED ] ContractQx.IssueAsset
[ FAILED ] ContractQvault.END_EPOCH
[ FAILED ] TestCoreSpectrum.AntiDustOneRichRandomDust

@fnordspace fnordspace added the bug Something isn't working label Dec 10, 2024
@fnordspace fnordspace added this to qubic Dec 10, 2024
@Franziska-Mueller Franziska-Mueller self-assigned this Dec 13, 2024
@Franziska-Mueller Franziska-Mueller moved this to 🏗 In progress in qubic Dec 16, 2024
@Franziska-Mueller
Copy link
Collaborator

Franziska-Mueller commented Dec 19, 2024

@fnordspace could you provide me a list of all failing tests? sorry, overlooked it in your initial post

@Franziska-Mueller Franziska-Mueller linked a pull request Dec 19, 2024 that will close this issue
@Franziska-Mueller Franziska-Mueller moved this from 🏗 In progress to 👀 In review in qubic Dec 20, 2024
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in qubic Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants