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

Generated tests for files with extern variables cannot be executed #610

Open
IDKWNTCMF opened this issue Jul 31, 2023 · 0 comments
Open
Labels
bug Something isn't working

Comments

@IDKWNTCMF
Copy link
Collaborator

Description
If a file contains extern variables then generated tests cannot be executed.

To Reproduce
Steps to reproduce the behavior:

  1. Generate tests for https://github.com/UnitTestBot/UTBotCpp/blob/main/integration-tests/c-example/lib/globals.c
  2. Try to run generated tests

Expected behavior
Tests are supposed to be executed successfully.

Actual behavior
An error test is generated with information about errors.

Visual proofs (screenshots, logs)

==17517==The following global variable is not properly aligned.
==17517==This may happen if another global with the same name
==17517==resides in another non-instrumented module.
==17517==Or the global comes from a C file built w/o -fno-common.
==17517==In either case this is likely an ODR violation bug,
==17517==but AddressSanitizer can not provide more details.
=================================================================
==17517==ERROR: AddressSanitizer: odr-violation (0x000000edd741):
  [1] size=1 'externed_global' /home/utbot/UTBotCpp/integration-tests/c-example/utbot_tests/makefiles/lib/structures/structs/../../../../../utbot_tests/wrapper/lib/../../../lib/static.c:4:7
  [2] size=1 'externed_global' /home/utbot/UTBotCpp/integration-tests/c-example/utbot_tests/makefiles/lib/structures/structs/../../../../../utbot_tests/wrapper/lib/../../../lib/static.c:4:7
These globals were registered at these points:
  [1]:
    #0 0x43aae8 in __asan_register_globals.part.0 /utbot_distr/llvm-project/compiler-rt/lib/asan/asan_globals.cpp:360:3
    #1 0x7fe98e8fa5cb in asan.module_ctor (/home/utbot/UTBotCpp/integration-tests/c-example/utbot_tests/makefiles/lib/../../../build/lib/libliblib.a.so+0x495cb)

  [2]:
    #0 0x43aae8 in __asan_register_globals.part.0 /utbot_distr/llvm-project/compiler-rt/lib/asan/asan_globals.cpp:360:3
    #1 0x7fe98e8fa5cb in asan.module_ctor (/home/utbot/UTBotCpp/integration-tests/c-example/utbot_tests/makefiles/lib/../../../build/lib/libliblib.a.so+0x495cb)
@IDKWNTCMF IDKWNTCMF added the bug Something isn't working label Jul 31, 2023
@IDKWNTCMF IDKWNTCMF linked a pull request Jul 31, 2023 that will close this issue
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: Todo
Development

Successfully merging a pull request may close this issue.

1 participant