I am having trouble in a multithreaded environment. I have a correctly "Multiple Read-Single Write"-Lock set up environment, that modifies a std::list
.
My problem now is, that i recieve an "list iterator not dereferencable"-exception and Visual is only displaying this if I inspect it:
The first item in the list has the value "0xcdcdcdcd".
What could be the cause? I would love to provide you more details, but I have no idea where to start, it already costed me several days of debugging into it, but if the code runs with breakpoints, this does not happen.
UPDATE
I have reduced it to now to a much more simple problem (sadly still not able to reduce it to a small non-working example). It is now run only in a single threaded environment - so no more multithreading issues can apply.
The list is filled with aroud 5000 elements, I make a call to data.resize(100)
and it crashes - having removed ~3500 elements.
Every element is always handled exactly the same, they all are contained in shared_ptr<>
I do not save any iterators, that may get invalid, it just crashes by having by having erased a random element in the list. I have no clue where to start.