jcsxky wrote:

> > Debug the #72783 can prove it. Address interval (local from 0x3a9a00 to 
> > 0x3aaa00) allocated by allocator contains a IdentifierInfo variable (local 
> > address:0x3aa190) whose address is freed early.
> 
> In this case, it looks better to extract the use-after-free variable only 
> instead of extracting the whole ASTUnit.

- From my local debugging, it's a `IdentifierInfo` type variable which is freed 
by allocator. The variable is subnode of AST. Thanks to `ASTUnit` is out of 
scope, some related memory is freed (which is allocated by 
`SpecificBumpPtrAllocator`) as destructor called and we can't extract only 
`IdentifierInfo` type variable.


> 
> > As system header like stdio.h or math.h can't be put into test, it's hard 
> > to add testcase. Could anyone give me some guidance? Thanks in advance!
> 
> Generally, we need to reduce them in this case. e.g., we need to preprocess 
> them, and remove unncessary parts until we can't. It is time consuming but it 
> is worthy.

- Small piece of code can't reproduce the crash. The crash is caused by growing 
of size of `OnDiskChainedHashTableGenerator` when add `IdentifierInfo` type 
variable. As mentioned in the 
[issue](https://github.com/llvm/llvm-project/issues/72783), when remove header 
file, it runs OK. Small-scale code wouldn't cause resize of 
`OnDiskChainedHashTableGenerator`


https://github.com/llvm/llvm-project/pull/73096
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to