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

Linux unit test: Segmentation fault #1550

Closed
pkarashchenko opened this issue Jul 16, 2023 · 8 comments
Closed

Linux unit test: Segmentation fault #1550

pkarashchenko opened this issue Jul 16, 2023 · 8 comments

Comments

@pkarashchenko
Copy link
Contributor

pkarashchenko commented Jul 16, 2023

Preconditions: hash 98d972d220a0a49f40dca8074418397d5323d1ec (master)
Steps to reproduce:

  1. cd porting/npl/linux/test
  2. make
  3. make test
    Result:
$ make test
./test_npl_task.exe
All tests passed
./test_npl_callout.exe
All tests passed
./test_npl_eventq.exe
All tests passed
./test_npl_sem.exe
make: *** [Makefile:94: test] Segmentation fault (core dumped)

Also some warnings related to -Wimplicit-function-declaration observed during compilation.

Initially my goal was to prototype BLE central application on Linux, but in a simple code I'm getting BLE_GAP_EVENT_DISC with struct ble_gap_disc_desc->event_type values of 114 or 144 or 146 (and more random data), so I switched to unit tests. I will try out some stable release.

Update: The same reproduced with nimble_1_5_0_tag

@pkarashchenko
Copy link
Contributor Author

Root cause seems to be a missing prototype of ble_npl_eventq_dflt_get as after I add a prototype the test pass

@pkarashchenko
Copy link
Contributor Author

Also there is an error when running make clean: rm: cannot remove '*~': No such file or directory

@pkarashchenko
Copy link
Contributor Author

Also unit test section from porting/examples/linux/README.md does not reflect the actual steps to build and run unit tests.

@sjanc
Copy link
Contributor

sjanc commented Jul 17, 2023

Hi,

Hmm those seem to pass on my box (fedora linux)...

Please send PR with changes that fix this for you.
I also noticed that those tests are not executed in github actions (just build test), I'll add them

@sjanc
Copy link
Contributor

sjanc commented Jul 20, 2023

#1565 should fix 'make clean' error and also adds Linux NPL test to CI workflows

@sjanc
Copy link
Contributor

sjanc commented Jul 20, 2023

interestingly it fails on CI with same error as this issue :)

@pkarashchenko
Copy link
Contributor Author

Maybe because -m32 option is added for the code build, but not added for tests?
Sorry, I've been busy and didn't find a time to submit a fix of missing prototypes.

@sjanc
Copy link
Contributor

sjanc commented Jul 20, 2023

yeap, I'll enable -m32 for now and later on we can extend it for 64bits

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

No branches or pull requests

2 participants