« first day (2836 days earlier)   

5:43 AM
I'm trying to debug some code. When compiled with g++ it runs into an infinite loop with no errors (even when using fsanitize). However with Visual Studios it gives the error message "Debug Assertion Failed!" and "Expression: cannot dereference end list iterator".
 
I don't think gcc has those DEBUG_ITERATOR_LEVEL things that VS has
but yeah, dereferencing an end() iterator would do the trick as far as undefined behavior is concerned
 
Why would Visual Studio produce a runtime error but not g++? It would seem an assertion is failing from inside one of the used libraries. Does running the debugger in VS enable assertion within the libraries?
How do I find which line of source code is messing things up?
 
if you have an assertion firing then using the debugger to set a breakpoint on assert should do the trick
then look up the callstack
 
@PeterT how do you set a break point in the std::list library?
 
just set a breakpoint on the names "assert' and "_assert". At least that's what I would do
 
5:50 AM
Let me rephrase, how do I open the library?
 
the headers that include the implementation are included with your compiler
but if you just set the breakpoint and run the program then you'll find the file, otherwise you can go looking to where they're stored and open them yourself
the container part of the STL is almost fully implemented in headers, there's no runtime library that you need to open for that if that's what you're lookin for
 

« first day (2836 days earlier)