[Lldb-commits] [lldb] b6b3fcd - [lldb] Don't iterate over a std::set<Type*> in SymbolFileDWARF::GetTypes to make it deterministic

Shafik Yaghmour via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 3 14:00:38 PST 2020



> On Mar 2, 2020, at 3:47 PM, Davide Italiano via lldb-commits <lldb-commits at lists.llvm.org> wrote:
> 
> 
> 
>> On Mar 2, 2020, at 15:44, Raphael “Teemperor” Isemann <teemperor at gmail.com> wrote:
>> 
>> I was just grepping for unordered data structures (e.g. ’std::set<‘) that use pointers/pointer-like objects (e.g. CompilerType with its operator<) and then reading the related code. Not sure if there is a good way to detect this stuff automatically. I guess we could have had a Clang plugin that creates a warning when code iterates over an unordered data structure that has a pointer-like type as a key (probably would cause a bunch of false-positives but if someone ran this on his own machine from time to time that would be enough I think).
> 


It came up when we chatted on Monday and I had some non-determinism when dealing with one of the bug recently. It was like 1 in 10 thing so I was able to work around it but we spent a little bit of time looking at all the places we used std::set and std::map and there are a several of them.

He felt it was a good build czar side project and I agreed.

> 
> I don’t think there’s a great way to detect this automatically, but I’m happy to hear because I was bitten by the problem several times.
> I guess my question was more motivated by the curiosity than anything else. Good work.
> 
>> D
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits



More information about the lldb-commits mailing list