Skip to content

Segmentation fault on a simple program #686

Open
@ganli2015

Description

@ganli2015

Description
Segmentation fault when running utbot with command line on a simple program.

To Reproduce
Steps to reproduce the behavior:
Test code.

int MyAdd(int a, int b) { return a+b; }


int main(int argc, char* argv[])
{
    testing::InitGoogleTest(&argc, argv);
    return RUN_ALL_TESTS();
    system("pause");
}

use command line:

./utbot generate --project-path "/home/simple_gtest/" file -f /home/simple_gtest/src/test.cpp

Expected behavior
Tests are supposed to be generated.

Actual behavior
An error test is generated with information about errors in the concrete executor.

Visual proofs (screenshots, logs)
image

Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var LLVM_SYMBOLIZER_PATH to point to it):
./utbot(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamEi+0x31)[0x3032edd]
./utbot(_ZN4llvm3sys17RunSignalHandlersEv+0x34)[0x30315b1]
./utbot[0x3032189]
/lib/x86_64-linux-gnu/libc.so.6(+0x42990)[0x73758ba42990]
./utbot(_ZN12Synchronizer21getStubSetFromSourcesERKSt13unordered_setIN2fs4pathEN9HashUtils8PathHashESt8equal_toIS2_ESaIS2_EE+0xb2)[0xe71d62]
./utbot(_ZNK12Synchronizer13getStubsFilesEv+0x30)[0xe718c0]
./utbot(_ZNK12Synchronizer16getOutdatedStubsEv+0x21)[0xe71601]
./utbot(_ZN12Synchronizer11synchronizeERKN5types12TypesHandlerE+0x5c)[0xe7251c]
./utbot(_ZN6Server19TestsGenServiceImpl22ProcessBaseTestRequestER11BaseTestGenP11TestsWriter+0x48e)[0xe4df1e]
./utbot(_ZN15GenerationUtils20createTestsByRequestI11FileTestGenN8testsgen11FileRequestEEESt4pairISt10unique_ptrI11BaseTestGenSt14default_deleteIS6_EEN4grpc6StatusEERKT0_PNSA_13ServerContextE+0x95)[0xe07d05]
./utbot(_ZN15GenerationUtils25createTestsAndWriteStatusI11FileTestGenN8testsgen11FileRequestEEEvPT0_PN4grpc13ServerContextE+0x1e)[0xdf243e]
./utbot(_ZN8CLIUtils5parseEiPPcRN3CLI3AppE+0xfec)[0xdef4dc]
./utbot(main+0x139)[0xdccc29]
/lib/x86_64-linux-gnu/libc.so.6(+0x28150)[0x73758ba28150]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x89)[0x73758ba28209]
./utbot(_start+0x2e)[0xdcca2e]
Segmentation fault (core dumped)

Environment
Virtual machine.
Ubuntu 23.0

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions