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

Update unit tests for integral, floating point, and UTF types #26

Closed
wants to merge 2 commits into from

Conversation

hainest
Copy link
Collaborator

@hainest hainest commented Jun 23, 2021

No description provided.

Copy link
Member

@vsoch vsoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hainest I'm not sure why but I'm getting this error:

[ 80%] Linking CXX executable SmeagleTests
terminate called after throwing an instance of 'std::runtime_error'
  what():  There was a problem reading from 'liballocation.so'
CMake Error at /code/build/_deps/doctest-src/scripts/cmake/doctestAddTests.cmake:43 (message):
  Error running test executable '/code/build/test/SmeagleTests':

    Result: Subprocess aborted
    Output: 

Did you try running in the development environment?

@hainest
Copy link
Collaborator Author

hainest commented Jun 23, 2021

Somehow, it's trying to run the test before it builds the requisite libraries. I've not ever seen that before. Neat...

@hainest
Copy link
Collaborator Author

hainest commented Jun 23, 2021

I'm trying in the dev cont with your branch now.

@vsoch
Copy link
Member

vsoch commented Jun 23, 2021

It worked for me locally with my branch, so I'm not sure what is going on. I wonder if it could be that the problem has always existed (a race between writing the test and running it), and as the test got larger it finally triggered?

@hainest
Copy link
Collaborator Author

hainest commented Jun 23, 2021

I think that might be it. If I manually run

mkdir build; cd $_
cmake .../all -DCMAKE_BUILD_TYPE=Release
make -j4
make test

it works fine. I have no explanation for how that could be, though. GHOSTS! 👻

@hainest
Copy link
Collaborator Author

hainest commented Jun 23, 2021

Well, I say it works "fine". I meant that it runs the tests. The tests are segfaulting like I was seeing previously outside of the container.

@vsoch
Copy link
Member

vsoch commented Jun 23, 2021

The specific command that is failing is:

cmake --build build/test

Which is before we run anything, hmm.

@vsoch
Copy link
Member

vsoch commented Jun 23, 2021

The tests aren't segfaulting for me, they work perfectly in my development environment:

CTEST_OUTPUT_ON_FAILURE=1 cmake --build build/test --target test
make[1]: Entering directory '/code/build/test'
Running tests...
Test project /code/build/test
      Start  1: Register Allocation String and char types
 1/13 Test  #1: Register Allocation String and char types ............   Passed    0.04 sec
      Start  2: Register Allocation Signed String and char types
 2/13 Test  #2: Register Allocation Signed String and char types .....   Passed    0.03 sec
      Start  3: Register Allocation Unsigned String and char types
 3/13 Test  #3: Register Allocation Unsigned String and char types ...   Passed    0.03 sec
      Start  4: Register Allocation Float types
 4/13 Test  #4: Register Allocation Float types ......................   Passed    0.02 sec
      Start  5: Register Allocation Unsigned Integral types
 5/13 Test  #5: Register Allocation Unsigned Integral types ..........   Passed    0.02 sec
      Start  6: Register Allocation Signed Integral types
 6/13 Test  #6: Register Allocation Signed Integral types ............   Passed    0.02 sec
      Start  7: Register Allocation Null types
 7/13 Test  #7: Register Allocation Null types .......................   Passed    0.02 sec
      Start  8: Register Allocation Boolean types
 8/13 Test  #8: Register Allocation Boolean types ....................   Passed    0.02 sec
      Start  9: Register Allocation Fixed Width Integer types
 9/13 Test  #9: Register Allocation Fixed Width Integer types ........   Passed    0.21 sec
      Start 10: Register Allocation Integral types
10/13 Test #10: Register Allocation Integral types ...................   Passed    0.05 sec
      Start 11: Parameter Directionality
11/13 Test #11: Parameter Directionality .............................   Passed    0.01 sec
      Start 12: Smeagle
12/13 Test #12: Smeagle ..............................................   Passed    0.00 sec
      Start 13: Smeagle version
13/13 Test #13: Smeagle version ......................................   Passed    0.00 sec

100% tests passed, 0 tests failed out of 13

Total Test time (real) =   0.46 sec
make[1]: Leaving directory '/code/build/test'

As they do in the PR https://github.com/buildsi/Smeagle/pull/25/checks?check_run_id=2881198863.

So I think there is something about the changes you've done to break it locally for me and in the CI here, and I can't reproduce the segfault for my branch.

@vsoch
Copy link
Member

vsoch commented Jun 23, 2021

I can reproduce the segfault for your branch here:

Running tests...
Test project /code/build
      Start  1: Register Allocation - Integral Types
 1/10 Test  #1: Register Allocation - Integral Types ..............***Exception: SegFault  0.14 sec
      Start  2: Register Allocation - Signed Integral Types
 2/10 Test  #2: Register Allocation - Signed Integral Types .......***Exception: SegFault  0.11 sec
      Start  3: Register Allocation - Unsigned Integral Types
 3/10 Test  #3: Register Allocation - Unsigned Integral Types .....***Exception: SegFault  0.11 sec
      Start  4: Register Allocation - Floating Point types
 4/10 Test  #4: Register Allocation - Floating Point types ........***Exception: SegFault  0.11 sec
      Start  5: Register Allocation - Fixed-Width Integer types
 5/10 Test  #5: Register Allocation - Fixed-Width Integer types ...***Exception: SegFault  0.11 sec
      Start  6: Register Allocation - Null types
 6/10 Test  #6: Register Allocation - Null types ..................   Passed    0.01 sec
      Start  7: Register Allocation - UTF types
 7/10 Test  #7: Register Allocation - UTF types ...................***Exception: SegFault  0.11 sec
      Start  8: Parameter Directionality
 8/10 Test  #8: Parameter Directionality ..........................   Passed    0.01 sec
      Start  9: Smeagle
 9/10 Test  #9: Smeagle ...........................................   Passed    0.01 sec
      Start 10: Smeagle version
10/10 Test #10: Smeagle version ...................................   Passed    0.02 sec

40% tests passed, 6 tests failed out of 10

Total Test time (real) =   0.75 sec

The following tests FAILED:
	  1 - Register Allocation - Integral Types (SEGFAULT)
	  2 - Register Allocation - Signed Integral Types (SEGFAULT)
	  3 - Register Allocation - Unsigned Integral Types (SEGFAULT)
	  4 - Register Allocation - Floating Point types (SEGFAULT)
	  5 - Register Allocation - Fixed-Width Integer types (SEGFAULT)
	  7 - Register Allocation - UTF types (SEGFAULT)
Errors while running CTest
Output from these tests are in: /code/build/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.
Makefile:101: recipe for target 'test' failed
make: *** [test] Error 8

@hainest
Copy link
Collaborator Author

hainest commented Jun 23, 2021

If I manually run

cmake -S test -B build/test -DsymtabAPI_DIR=/opt/view/lib/cmake/Dyninst
cmake --build build/test
CTEST_OUTPUT_ON_FAILURE=1 cmake --build build/test --target test

everything build and runs, and I see no segfaults.

If I run

make test

I get the library load error because liballocation.so hasn't been built yet.

@vsoch
Copy link
Member

vsoch commented Jun 23, 2021

So the Makefile is not running commands in serial?

@hainest
Copy link
Collaborator Author

hainest commented Jun 23, 2021

That's kind of what it seems like, yeah. But that would be super weird.

@vsoch
Copy link
Member

vsoch commented Jun 23, 2021

Hmm I ran those commands manually and I still got the same error though.

@vsoch
Copy link
Member

vsoch commented Jun 23, 2021

I don't feel comfortable merging this - the tests I have are working and there is something here that breaks it all. Would it make sense to step through your changes and do one thing at a time until you break it?

@hainest
Copy link
Collaborator Author

hainest commented Jun 23, 2021

Yeah, no, we shouldn't merge this until we can resolve the build craziness. Let me try a few things and I'll get back to you.

@vsoch
Copy link
Member

vsoch commented Jun 23, 2021

Sounds good :) Thanks @hainest !

@vsoch
Copy link
Member

vsoch commented Jun 28, 2021

@hainest any updates on this hairball?

@hainest
Copy link
Collaborator Author

hainest commented Jun 28, 2021

Not yet. I ended up spending my weekend chasing Dyninst link errors. Let's go ahead and merge #25 so we can at least have some unit tests running that we can incorporate to the Github actions here.

@vsoch vsoch closed this Jun 28, 2021
@vsoch vsoch deleted the branch buildsi:add/testing-for-types June 28, 2021 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants