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

Cannot compile bluedroid BT with optimization enabled (optimize for performance) (IDFGH-11637) #12751

Closed
3 tasks done
finger563 opened this issue Dec 7, 2023 · 1 comment
Closed
3 tasks done
Assignees
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Bug bugs in IDF

Comments

@finger563
Copy link

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

ESP-IDF v5.3-dev-582-gab03c2ea13

Operating System used.

macOS

How did you build your project?

Command line with idf.py

If you are using Windows, please specify command line type.

None

What is the expected behavior?

Build with optimization

What is the actual behavior?

Build failure (array subscript 10 is above array bounds)

Steps to reproduce.

  1. Enable BT using bluedroid, and enable BT_CLASSIC, SPP, L2CAP
  2. Enable optimization (for performance)
  3. Try to build
  4. See error

Build or installation Logs.

/Users/bob/esp/esp-idf/components/bt/host/bluedroid/bta/jv/bta_jv_act.c: In function 'bta_jv_l2cap_client_cback':
/Users/bob/esp/esp-idf/components/bt/host/bluedroid/bta/jv/bta_jv_act.c:1251:46: error: array subscript 10 is above array bounds of 'tBTA_JV_L2C_CB[10]' [-Werror=array-bounds=]
 1251 |     tBTA_JV_L2C_CB  *p_cb = &bta_jv_cb.l2c_cb[gap_handle];
      |                              ~~~~~~~~~~~~~~~~^~~~~~~~~~~~
In file included from /Users/bob/esp/esp-idf/components/bt/host/bluedroid/bta/jv/bta_jv_act.c:35:
/Users/bob/esp/esp-idf/components/bt/host/bluedroid/bta/jv/include/bta_jv_int.h:423:29: note: while referencing 'l2c_cb'
  423 |     tBTA_JV_L2C_CB          l2c_cb[BTA_JV_MAX_L2C_CONN];    /* index is GAP handle (index) */
      |                             ^~~~~~
/Users/bob/esp/esp-idf/components/bt/host/bluedroid/bta/jv/bta_jv_act.c: In function 'bta_jv_l2cap_server_cback':
/Users/bob/esp/esp-idf/components/bt/host/bluedroid/bta/jv/bta_jv_act.c:1405:46: error: array subscript 10 is above array bounds of 'tBTA_JV_L2C_CB[10]' [-Werror=array-bounds=]
 1405 |     tBTA_JV_L2C_CB  *p_cb = &bta_jv_cb.l2c_cb[gap_handle];
      |                              ~~~~~~~~~~~~~~~~^~~~~~~~~~~~
/Users/bob/esp/esp-idf/components/bt/host/bluedroid/bta/jv/include/bta_jv_int.h:423:29: note: while referencing 'l2c_cb'
  423 |     tBTA_JV_L2C_CB          l2c_cb[BTA_JV_MAX_L2C_CONN];    /* index is GAP handle (index) */

More Information.

CleanShot 2023-12-07 at 15 12 28

@finger563 finger563 added the Type: Bug bugs in IDF label Dec 7, 2023
@espressif-bot espressif-bot added the Status: Opened Issue is new label Dec 7, 2023
@github-actions github-actions bot changed the title Cannot compile bluedroid BT with optimization enabled (optimize for performance) Cannot compile bluedroid BT with optimization enabled (optimize for performance) (IDFGH-11637) Dec 7, 2023
@ESP-YTGerd
Copy link
Collaborator

Hi, @finger563
Thanks for the reporting, a MR has been proposed to fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

3 participants