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

CMock does not work as expected & Segmentation Fault #364

Closed
xinyuannn opened this issue Aug 18, 2021 · 1 comment
Closed

CMock does not work as expected & Segmentation Fault #364

xinyuannn opened this issue Aug 18, 2021 · 1 comment

Comments

@xinyuannn
Copy link

I have been using CMock for a while, and sometimes CMock could cause segmentation fault or accidentally mess up the memory of local variables. This problem disappears if all the variables needed are defined globally.

Another issue is that CMock_verify() and CMock_init() can cause segmentation fault. Please take a look at this PR, I built the test runner manually, if I add one more resetTest() below the last line of bpf/tests/nat_test.h:test_snat_v4_process, that resetTest() will cause segmentation fault.

xinyuannn added a commit to xinyuannn/cilium that referenced this issue Sep 13, 2021
This commit adds a thorough test on snat_v4_process based on our ebpf
unit testing framework.

Please note that the variables used in func test_snat_v4_process are
defined globally to avoid a problem caused by CMock (issue:ThrowTheSwitch/CMock#364).

Signed-off-by: Xinyuan Zhang <zhangxinyuan@google.com>
@mvandervoord
Copy link
Member

unable to reproduce.

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