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

[Coverity CID :209375] Side effect in assertion in tests/kernel/interrupt/src/prevent_irq.c #24034

Closed
zephyrbot opened this issue Apr 2, 2020 · 1 comment
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug

Comments

@zephyrbot
Copy link
Collaborator

Static code scan issues found in file:

https://github.com/zephyrproject-rtos/zephyr/tree/29c0c08fd4abc34aae4e1bf579cc506eaabef428/tests/kernel/interrupt/src/prevent_irq.c#L50

Category: Incorrect expression
Function: test_prevent_interruption
Component: Tests
CID: 209375

Details:

44         /* Start the timer and busy-wait for a bit with IRQs locked. The
45          * timer ought to have fired during this time if interrupts weren't
46          * locked -- but since they are, check_lock_new isn't updated.
47          */
48         k_timer_start(&irqlock_timer, K_MSEC(DURATION), K_NO_WAIT);
49         k_busy_wait(MS_TO_US(1000));
>>>     CID 209375:  Incorrect expression  (ASSERT_SIDE_EFFECT)
>>>     Argument "handler_result" of z_zassert() has a side effect because the variable is volatile.  The containing function might work differently in a non-debug build.
50         zassert_not_equal(handler_result, HANDLER_TOKEN,
51             "timer interrupt was serviced while interrupts are locked");
52    
53         printk("unlocking interrupts\n");
54         irq_unlock(key);
55    

Please fix or provide comments in coverity using the link:

https://scan9.coverity.com/reports.htm#v32951/p12996.

Note: This issue was created automatically. Priority was set based on classification
of the file affected and the impact field in coverity. Assignees were set using the CODEOWNERS file.

@zephyrbot zephyrbot added bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug labels Apr 2, 2020
@nashif
Copy link
Member

nashif commented Apr 2, 2020

false positive

@nashif nashif closed this as completed Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug
Projects
None yet
Development

No branches or pull requests

4 participants