Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Row-sparse constant initializer accesses out of bound elements #17988

@leezu

Description

@leezu

Description

CI with updated toolchain (ie #17984) catches the bug.

vector: :_M_range_check: __n (which is 4) >= this->size() (which is 4)

Error Message

To Reproduce

Build with this simple patch

diff --git a/src/c_api/c_api_executor.cc b/src/c_api/c_api_executor.cc
index afc64f73d..41193b596 100644
--- a/src/c_api/c_api_executor.cc
+++ b/src/c_api/c_api_executor.cc
@@ -809,7 +809,7 @@ int _SimpleBindImpl(SymbolHandle symbol_handle,
       ret->ret_vec_charp.push_back(ret->ret_vec_str.back().c_str());
     }
     *shared_buffer_len = shared_buffer_map.size();
-    *updated_shared_buffer_handle_list = &(ret->ret_handles[nd_idx]);
+    *updated_shared_buffer_handle_list = &(ret->ret_handles.at(nd_idx));
     *updated_shared_buffer_name_list = &(ret->ret_vec_charp[0]);
   }

OR follow the instructions in #17987 to trigger this via glibc assertions in debug build.

Run test_init.test_rsp_const_init to trigger the bug.

CC: @eric-haibin-lin

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions