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

tests: subsys: canbus: isotp: implementation: fails on nucleo_g474re #35760

Closed
ABOSTM opened this issue May 28, 2021 · 10 comments
Closed

tests: subsys: canbus: isotp: implementation: fails on nucleo_g474re #35760

ABOSTM opened this issue May 28, 2021 · 10 comments
Assignees
Labels
area: CAN bug The issue is a bug, or the PR is fixing a bug platform: STM32 ST Micro STM32 priority: low Low impact/importance bug Stale

Comments

@ABOSTM
Copy link
Collaborator

ABOSTM commented May 28, 2021

Describe the bug
tests/subsys/canbus/isotp/implementation/ fails on nucleo_g474re.

This test is failed on main branch.
But even when reverting to original introduction of FDCAN on nucleo_g474re,
#31061 with sha1 3b2fd1c
it is still failed

To Reproduce
Steps to reproduce the behavior:

  1. west build -p auto -b nucleo_g474re tests/subsys/canbus/isotp/implementation/
  2. west flash
  3. See error

Expected behavior
test passed

Logs and console output

*** Booting Zephyr OS build v2.6.0-rc2-39-g94e8c2eb81f3  ***
Running test suite isotp
===================================================================
START - test_bind_unbind
 PASS - test_bind_unbind in 0.905 seconds
===================================================================
START - test_send_receive_net_sf
 PASS - test_send_receive_net_sf in 0.6 seconds
===================================================================
START - test_send_receive_net_blocks
 PASS - test_send_receive_net_blocks in 1.4 seconds
===================================================================
START - test_send_receive_net_single_blocks

E: Reception of next FC has timed out
    Assertion failed at WEST_TOPDIR/zephyr/tests/subsys/canbus/isotp/implementation/src/main.c:296: test_send_receive_net_single_blocks: (ret not equal to 0)
recv returned -14

    Assertion failed at WEST_TOPDIR/zephyr/tests/subsys/canbus/isotp/implementation/src/main.c:61: send_complette_cb: (error_nr not equal to ISOTP_N_OK)
Sending failed (-2)
 FAIL - test_send_receive_net_single_blocks in 1.98 seconds
===================================================================
START - test_send_receive_sf

    Assertion failed at WEST_TOPDIR/zephyr/tests/subsys/canbus/isotp/implementation/src/main.c:97: get_sf: (ret not equal to 1)
recv returned -14
 FAIL - test_send_receive_sf in 1.14 seconds
===================================================================
START - test_send_receive_blocks
E: No buffer for FF left

    Assertion failed at WEST_TOPDIR/zephyr/tests/subsys/canbus/isotp/implementation/src/main.c:268: test_send_receive_blocks: (ret not equal to 0)
Binding failed (-11)
 FAIL - test_send_receive_blocks in 0.18 seconds
===================================================================
START - test_send_receive_single_block
E: No buffer for FF left

    Assertion failed at WEST_TOPDIR/zephyr/tests/subsys/canbus/isotp/implementation/src/main.c:320: test_send_receive_single_block: (ret not equal to 0)
Binding failed (-11)
 FAIL - test_send_receive_single_block in 0.18 seconds
===================================================================
START - test_buffer_allocation
E: No buffer for FF left

    Assertion failed at WEST_TOPDIR/zephyr/tests/subsys/canbus/isotp/implementation/src/main.c:393: test_buffer_allocation: (ret not equal to 0)
Binding failed (-11)
 FAIL - test_buffer_allocation in 0.18 seconds
===================================================================
START - test_buffer_allocation_wait
E: No buffer for FF left

    Assertion failed at WEST_TOPDIR/zephyr/tests/subsys/canbus/isotp/implementation/src/main.c:409: test_buffer_allocation_wait: (ret not equal to 0)
Binding failed (-11)
 FAIL - test_buffer_allocation_wait in 0.18 seconds
===================================================================
Test suite isotp failed.
===================================================================
PROJECT EXECUTION FAILED

Environment (please complete the following information):

  • OS: Windows
  • Toolchain gnuarmemb
  • Commit SHA 94e8c2e
@ABOSTM ABOSTM added bug The issue is a bug, or the PR is fixing a bug area: CAN platform: STM32 ST Micro STM32 labels May 28, 2021
@ABOSTM
Copy link
Collaborator Author

ABOSTM commented May 28, 2021

@alexanderwachter Is there something I miss to pass the test, any loopback wire, transceiver, ...?
(I am not CAN expert)

@str4t0m
Copy link
Collaborator

str4t0m commented May 28, 2021

@ABOSTM no external fixture is required to run the test.
I ran the test locally with success on g0 and g4. As CAN_FD_MODE is enabled per default, #35738 may have fixed this.
Would you mind running the test on the latest main?

Edit: Ran the test with a few modifications, but the test passes also as is.

@alexanderwachter
Copy link
Member

We have issues with that tests ATM. There are race conditions in the testcase (context is reused before the work queue item was processed).
We are working on a fix.

@ABOSTM
Copy link
Collaborator Author

ABOSTM commented May 28, 2021

@str4t0m I still reproduce the issue with latest main
@alexanderwachter ok thanks

@erwango erwango added this to the v2.6.0 milestone May 28, 2021
@erwango erwango added the priority: low Low impact/importance bug label May 28, 2021
@galak galak removed this from the v2.6.0 milestone Jun 4, 2021
@github-actions
Copy link

github-actions bot commented Aug 4, 2021

This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.

@github-actions github-actions bot added the Stale label Aug 4, 2021
@ABOSTM ABOSTM removed the Stale label Aug 4, 2021
@ABOSTM
Copy link
Collaborator Author

ABOSTM commented Aug 9, 2021

@alexanderwachter,
Issue is still reproduced with zephyr master.
do you have some progress with the fix you are talking about ? any reference for the fix ?

@erwango
Copy link
Member

erwango commented Sep 13, 2021

@alexanderwachter gentle ping.

@alexanderwachter
Copy link
Member

I think this error is due to a re-use of the tx context before the the workqueue has finished. Needs a fix in either the tests, or better prevent such a situation in the stack somehow. @legoabram you have been hunting this bug lately. Any news?

@legoabram
Copy link
Collaborator

At the very least, I can confirm that this is the case. There are also some issues related to corrupting the work queue stack by reinitializing the work item before it's completely done. I haven't had to time to work on a fix, but I think the cleanest fix is to modify the library so that anything in the context is fully deallocated or uninitialized before notifying the user that the operation is complete.

@github-actions
Copy link

This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: CAN bug The issue is a bug, or the PR is fixing a bug platform: STM32 ST Micro STM32 priority: low Low impact/importance bug Stale
Projects
None yet
Development

No branches or pull requests

6 participants