You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.
Dynamic subgraph code accesses elements of empty vector, causing MXNet to abort.
The PR only passed CI because of the outdated toolchain used on CI. CI with updated toolchain (ie #17984) catches the bug.
Compile MXNet with gcc7+ and _GLIBCXX_ASSERTIONS, for example via CC=gcc-7 CXX=g++-7 cmake -GNinja -DUSE_CUDA=0 -DCMAKE_BUILD_TYPE=RelWithDebInfo ..; ninja.
Run python3 -m nose --verbose ../tests/python/unittest/test_extensions.py -m test_subgraph.
This will raise the error above.
Hi @leezu, @rondogency and I have discussed unifying the resource requests for custom ops and custom subgraph ops and have made the change in #17762 to remove DefaultSubgraphOpResourceRequest. This change will fix the issue such that ctx.requested will always have at least one element.
But @rondogency being the overly cautious expert that he is also changed it to ctx.requested.at(0) and added CHECK(ctx.requested.size() >= 2) too.
Description
Dynamic subgraph code accesses elements of empty vector, causing MXNet to abort.
The PR only passed CI because of the outdated toolchain used on CI. CI with updated toolchain (ie #17984) catches the bug.
Error Message
/usr/include/c++/7/bits/stl_vector.h:815: std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) const [with _Tp = mxnet:: Resource; _Alloc = std::allocator<mxnet::Resource>; std::vector<_Tp, _Alloc>::const_reference = const mxnet::Resource&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Asser tion '__builtin_expect(__n < this->size(), true)' failed.
To Reproduce
Compile MXNet with gcc7+ and
_GLIBCXX_ASSERTIONS
, for example viaCC=gcc-7 CXX=g++-7 cmake -GNinja -DUSE_CUDA=0 -DCMAKE_BUILD_TYPE=RelWithDebInfo ..; ninja
.Run
python3 -m nose --verbose ../tests/python/unittest/test_extensions.py -m test_subgraph
.This will raise the error above.
OR apply the following simple patch
and MXNet will always crash with
vector: :_M_range_check: __n (which is 0) >= this->size() (which is 0)
during the dynamic subgraph test.cc @samskalicky @rondogency
The text was updated successfully, but these errors were encountered: