Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.

TBB captured exception

morle
Beginner
577 Views
Hi,

yesterday I got this exception while working with a concurrent vector and some std::vectors inside a task:

terminate called after throwing an instance of 'tbb::captured_exception'
what(): vector::_M_range_check


My question is: was the exception raised because I tried to access a position out of bounds in the concurrent vector, or could it be throw by the std::vector too but it was captured by the task scheduler?

Thanks.
0 Kudos
1 Solution
SergeyKostrov
Valued Contributor II
577 Views
Quoting morle
...
My question is: was the exception raised because I tried to access a position out of bounds in the concurrent vector,

[SergeyK] That is possible. Would you be able to provide a Test-Case?

or could it be throw by the std::vector too but it was captured by the task scheduler?

...
what(): vector::_M_range_check
...

[SergeyK]Ithink Yes. STL vector exception messages have a'vector::' part. Check
these STLheaders:

stl_vector.h
stl_bvector.h
stl_deque.h

for more technical details.

Best regards,
Sergey

View solution in original post

0 Kudos
3 Replies
SergeyKostrov
Valued Contributor II
578 Views
Quoting morle
...
My question is: was the exception raised because I tried to access a position out of bounds in the concurrent vector,

[SergeyK] That is possible. Would you be able to provide a Test-Case?

or could it be throw by the std::vector too but it was captured by the task scheduler?

...
what(): vector::_M_range_check
...

[SergeyK]Ithink Yes. STL vector exception messages have a'vector::' part. Check
these STLheaders:

stl_vector.h
stl_bvector.h
stl_deque.h

for more technical details.

Best regards,
Sergey
0 Kudos
tehpikachu
Beginner
577 Views
my sig
Thanks a lot
0 Kudos
morle
Beginner
577 Views
Thanks!!

It was a STL vector!
0 Kudos
Reply