Skip to content

[mlir][td] check-use-after-free.mlir failing (AppleSillcon + shared libs) #129216

@banach-space

Description

@banach-space

Hi,

check-use-after-free.mlir fails for for me on AppleSilicon (checked on M3 and M4) with:

  • -DBUILD_SHARED_LIBS=On

(static libs build is fine).

I've tracked it down to the TD logic incorrectly assuming that at runtime there will be only one instance of DerivedResource. That assumption is effectively made here:

return it.getSymbolRef() != value;

I actually end up with two instances of that class at runtime, both are instantiations of:

mlir::SideEffects::Resource::Base<mlir::transform::TransformMappingResource, mlir::SideEffects::Resource>:
  • one instance "lives" in libMLIRTransformDialectInterfaces.dylib,
  • another instances "lives" in libMLIRTransformDialectTransforms.dylib.

QUESITON:

Should I update getEffectsOnResource to compare ResourceID instead?

return it.getResource()->getResourceID() != resource->getResourceID();

TypeID getResourceID() const { return id; }

Alternatively, we could explore ways to ensure that there is only one instance across all shared objects, but I’m not sure how best to achieve that.

@ftynse, could you take a look when you get a chance? "git log" wasn’t very helpful here (this logic depends on quite a few components), and you’re my go-to TD expert. 🙂

—Andrzej

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions