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

go bindings test fail #174

Closed
nwaples opened this issue Aug 28, 2022 · 6 comments
Closed

go bindings test fail #174

nwaples opened this issue Aug 28, 2022 · 6 comments

Comments

@nwaples
Copy link
Contributor

nwaples commented Aug 28, 2022

lang/go/bindings/cne$ ./run_test
=== RUN TestStarting
--- PASS: TestStarting (0.33s)
=== RUN TestGetChannel
=== RUN TestGetChannel/TestLoopback
=== RUN TestGetChannel/TestLoopback#01
--- PASS: TestGetChannel (0.00s)
--- PASS: TestGetChannel/TestLoopback (0.00s)
--- PASS: TestGetChannel/TestLoopback#01 (0.00s)
=== RUN TestRxBurst
=== RUN TestRxBurst/TestRxBurst
cne.test: ../lib/core/cne/cne.c:28: cne_id: Assertion `per_thread__cne != NULL' failed.
SIGABRT: abort
PC=0x7fdce9f0000b m=3 sigcode=18446744073709551610
signal arrived during cgo execution

The same thing happens when I run OpenWIthConfig() in my own code.

@KeithWiles
Copy link
Contributor

KeithWiles commented Aug 29, 2022

Thanks, It appears the register call is not being done for the thread that is running and calling into CNDP. Let me look at the problem.

@KeithWiles
Copy link
Contributor

KeithWiles commented Aug 30, 2022

I believe I have a fix for this issue. What happened was we add an assert to the cne_id() routine to validate the current thread local storage was valid. The test code was not calling RegisterThread in all cases or calling the routine twice in the same go thread which can corrupt the TLS pointer. The fwd example application also did not call RegisterThread and UnregisterThread correctly.

Each Go thread that is sending or receiving traffic or alloc/free pktmbuf's must call RegisterThread() once and UnregisterThread as the go thread dies.

Here is the PR: #179

Please have a look and give it a review/test.

@nwaples
Copy link
Contributor Author

nwaples commented Aug 30, 2022

I get this error on run_test

./system_test.go:10:2: imported and not used: "strconv"

but if I remove the import, all seems to be ok.

@KeithWiles
Copy link
Contributor

Somehow I missed that one :-( I will update the PR.

@KeithWiles
Copy link
Contributor

I think we can close this one, correct?

@nwaples
Copy link
Contributor Author

nwaples commented Aug 31, 2022

yes

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