Skip to content

C++/CLI x86 marshalling misses copy ctor/dtor calls resulting in C++ STL iterator debugging breaking #100033

Closed
@tgani-msft

Description

@tgani-msft

Description

This issue is a mirror of DTS bug 1949402, meant to track it on Github.

@jkoritzinsky is looking at this issue.

Reproduction Steps

The DTS bug contains the repro. Essentially, a copy ctor of std::vector<>::iterator is not called when pushing the argument onto the stack for the call to the native method, which takes an argument of type iterator. This leads to STL's iterator debugging book-keeping code to later assert.

This happens only for x86 and does not repro in the desktop framework where the copy ctor is correctly called.

Expected behavior

The copy ctor is correctly called and no assert fails in STL iterator debugging code.

Actual behavior

STL iterator debugging assert popup.

Regression?

Yes. From desktop framework behavior. Customer is blocked from adopting Net 8.0

Known Workarounds

Disabling iterator debugging. But this still leaves open the question of silent bad codegen happening for similar code that is not protected by asserts.

Configuration

.NET 8 x86

Other information

No response

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