embvm / embvm-core

Core components, subsystems, and utilities for the Embedded Virtual Machine
Other
43 stars 8 forks source link

Tests fail On Linux (Segmentation Fault) #7

Open phillipjohnston opened 2 years ago

phillipjohnston commented 2 years ago
parallels@parallels-Parallels-Virtual-Platform:~/embvm-core$ make test
ninja: Entering directory `buildresults'
[0/1] Running all tests.
1/1 embvm-core_catch2_test        FAIL            0.35s   killed by signal 11 SIGSEGV
>>> MALLOC_PERTURB_=226 /home/parallels/embvm-core/buildresults/build/test/catch2/embvm-core_catch2_test -s -r junit -o /home/parallels/embvm-core/buildresults/test/embvm-core_catch2_test.xml

Summary of Failures:

1/1 embvm-core_catch2_test FAIL            0.35s   killed by signal 11 SIGSEGV

Ok:                 0   
Expected Fail:      0   
Fail:               1   
Unexpected Pass:    0   
Skipped:            0   
Timeout:            0   

Full log written to /home/parallels/embvm-core/buildresults/meson-logs/testlog.txt
FAILED: meson-internal__test 
/home/parallels/.local/bin/meson test --no-rebuild --print-errorlogs
ninja: build stopped: subcommand failed.
make: *** [Makefile:59: test] Error 1
parallels@parallels-Parallels-Virtual-Platform:~/embvm-core$ ./buildresults/build/test/c
catch2/ cmocka/ 
parallels@parallels-Parallels-Virtual-Platform:~/embvm-core$ ./buildresults/build/test/c
catch2/ cmocka/ 
parallels@parallels-Parallels-Virtual-Platform:~/embvm-core$ ./buildresults/build/test/catch2/embvm-core_catch2_test
Segmentation fault (core dumped)
phillipjohnston commented 2 years ago

Failure is within posix_tests (removing from build yields test pass).

phillipjohnston commented 2 years ago

Ok, there does seem to be either a problem with the thread test, OR that is just complicating things and making debugging harder. When I remove the thread test case and fire up gdb, I see this now:


embvm-core_catch2_test: ../src/os/posix/posix_msg_queue.hpp:162: os::posix::MessageQueue<TType>::MessageQueue(size_t) [with TType = unsigned int; size_t = long unsigned int]: Assertion `handle_ != -1' failed.
``
phillipjohnston commented 2 years ago

Removing both thread test + message queue test returns us to passing status. So that narrows it down to a combination of two issues.

Looking at the message queue, I have not confirmed the problem but naming is definitely wrong. 1) need to have a solution for unique names, and 2) need ot follow the naming requirements: https://man7.org/linux/man-pages/man7/mq_overview.7.html (e.g., /embvmmq).

Simplest solution would be to have a string of 3 numerical characters that increment and are appended to the basic queue name.