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

out of bounds error #31

Open
wushuhsu opened this issue Jun 24, 2021 · 5 comments
Open

out of bounds error #31

wushuhsu opened this issue Jun 24, 2021 · 5 comments

Comments

@wushuhsu
Copy link

wushuhsu commented Jun 24, 2021

vis[] is declared in include/ci/internal/ip_types.h as
"ef_vi vis[CI_MAX_VIS_PER_INTF]" where CI_MAX_VIS_PER_INTF is 1

But q_id is 1, as the assert verifies in
void ci_netif_dmaq_shove_plugin(ci_netif* ni, int intf_i, int q_id)
{
ef_vi* vi = &ni->nic_hw[intf_i].vis[q_id];
ci_assert_ge(q_id, 1);

Hence, vis[1] is out of bounds.

CC /root/src/onload-master/build/x86_64_linux-3.10.0-1160.31.1.el7.x86_64/lib/transport/ip/netif_tx.o
/root/src/onload-master/build/x86_64_linux-3.10.0-1160.31.1.el7.x86_64/lib/transport/ip/netif_tx.c: In function ‘ci_netif_dmaq_shove_plugin’:
/root/src/onload-master/build/x86_64_linux-3.10.0-1160.31.1.el7.x86_64/lib/transport/ip/netif_tx.c:203:38: error: array subscript 1 is above array bounds of ‘ef_vi[1]’ [-Werror=array-bounds]
203 | ef_vi* vi = &ni->nic_hw[intf_i].vis[q_id];
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~
In file included from /root/src/onload-master/src/include/ci/internal/ip.h:58,
from /root/src/onload-master/build/x86_64_linux-3.10.0-1160.31.1.el7.x86_64/lib/transport/ip/ip_internal.h:19,
from /root/src/onload-master/build/x86_64_linux-3.10.0-1160.31.1.el7.x86_64/lib/transport/ip/netif_tx.c:16:
/root/src/onload-master/src/include/ci/internal/ip_types.h:40:30: note: while referencing ‘vis’
40 | ef_vi vis[CI_MAX_VIS_PER_INTF];
| ^~~
/root/src/onload-master/build/x86_64_linux-3.10.0-1160.31.1.el7.x86_64/lib/transport/ip/netif_tx.c:203:38: error: array subscript 1 is above array bounds of ‘ef_vi[1]’ [-Werror=array-bounds]
203 | ef_vi* vi = &ni->nic_hw[intf_i].vis[q_id];
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~
In file included from /root/src/onload-master/src/include/ci/internal/ip.h:58,
from /root/src/onload-master/build/x86_64_linux-3.10.0-1160.31.1.el7.x86_64/lib/transport/ip/ip_internal.h:19,
from /root/src/onload-master/build/x86_64_linux-3.10.0-1160.31.1.el7.x86_64/lib/transport/ip/netif_tx.c:16:
/root/src/onload-master/src/include/ci/internal/ip_types.h:40:30: note: while referencing ‘vis’
40 | ef_vi vis[CI_MAX_VIS_PER_INTF];
| ^~~
cc1: all warnings being treated as errors
make[5]: *** [scripts/Makefile.build:334: /root/src/onload-master/build/x86_64_linux-3.10.0-1160.31.1.el7.x86_64/lib/transport/ip/netif_tx.o] Error 1
make[4]: *** [Makefile:1316: module/root/src/onload-master/build/x86_64_linux-3.10.0-1160.31.1.el7.x86_64/lib/transport/ip] Error 2

@rhughes-xilinx
Copy link

What compiler and/or compile flags are you using?

We can obviously fix this (probably by ifdeffing that function out in such configs) but I'm interested in what you're doing differently to us.

@wushuhsu
Copy link
Author

wushuhsu commented Jun 24, 2021 via email

@ol-alexandra
Copy link
Contributor

We saw it before. And we decided that we don't want to support Frankenstein of new gcc + old kernel. You are welcome to provide a patch.

@wushuhsu
Copy link
Author

wushuhsu commented Jun 25, 2021 via email

@ol-alexandra
Copy link
Contributor

Sorry, it is unreadable. Please make up a pull request.

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

3 participants