Skip to content

[UBSAN] Wrong geometry casting in FastTrackerRecHitMatcher #50665

@Dr15Jones

Description

@Dr15Jones

The UBSAN build is showing the following errors:

2 FastSimulation/TrackingRecHitProducer/plugins/FastTrackerRecHitMatcher.cc:151:40: runtime error: downcast of address 0x149590badd00 which does not point to an object of type 'GluedGeomDet'
2 FastSimulation/TrackingRecHitProducer/plugins/FastTrackerRecHitMatcher.cc:202:50: runtime error: member call on address 0x149590d990f0 which does not point to an object of type 'GluedGeomDet'
2 FastSimulation/TrackingRecHitProducer/plugins/FastTrackerRecHitMatcher.cc:233:34: runtime error: member call on address 0x1495905b8fa0 which does not point to an object of type 'StripTopology'
2 FastSimulation/TrackingRecHitProducer/plugins/FastTrackerRecHitMatcher.cc:274:34: runtime error: member call on address 0x14959059cb60 which does not point to an object of type 'StripTopology'
2 FastSimulation/TrackingRecHitProducer/plugins/FastTrackerRecHitMatcher.cc:338:54: runtime error: member call on address 0x149590bbfef0 which does not point to an object of type 'GluedGeomDet'

looking at some of these shows that they can all be traced back to C style casts

const GluedGeomDet* gluedDet = (const GluedGeomDet*)geometry.idToDet(DetId(stripSubDetId.glued()));

const StripTopology& topol = (const StripTopology&)stripdet->topology();

const StripTopology& partnertopol = (const StripTopology&)partnerstripdet->topology();

Where the one for line 151 being the most problematic (as the others are calls applied to the object after the cast).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions