intel / intel/confidential-computing.sgx.sdk

error occurs when compile sgx sdk: array subscript fi is outside array bounds of ‘const ecall_info_t[0]’

Open
#159 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
2
Forks
3
PR merge metrics
No merged PRs in 30d

Description

when compile sgx sdk in branch sgx_2.4, an error occured as follows:

/opt/linux-sgx/sdk/switchless/src/sl_workers.c:78:68: 错误:array subscript fi is outside array bounds of ‘const ecall_info_t[0]’ [-Werror=array-bounds]
78 | const ecall_info_t* ecall_info = &g_ecall_table.ecall_table[fi];
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
/opt/linux-sgx/sdk/switchless/src/sl_workers.c:60:21: 附注:while referencing ‘ecall_table’
60 | ecall_info_t ecall_table[0];
| ^~~~~~~~~~~
/opt/linux-sgx/sdk/switchless/src/sl_workers.c:78:68: 错误:array subscript fi is outside array bounds of ‘const ecall_info_t[0]’ [-Werror=array-bounds]
78 | const ecall_info_t* ecall_info = &g_ecall_table.ecall_table[fi];

Contributor guide

Open the contributing guide

Research direction

Start with sdk/switchless/src/sl_workers.c, especially the ecall_table declaration around line 60 and the subscript access around line 78. Reproduce the sgx_2.4 build with the compiler settings that enable -Werror=array-bounds, then trace how the table is generated and used. Done means the SDK compiles without this array-bounds error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.