The std::sort function, which was not problematic until version 15.2, causes a crash, perhaps because of a modified [The performance of std::sort and std::ranges::sort was improved by up to 50% for arithmetic types (120908845)] entry in xcode 15.3.

The std::sort function, which was not problematic until version 15.2, causes a crash, perhaps because of a modified [The performance of std::sort and std::ranges::sort was improved by up to 50% for arithmetic types (120908845)] entry in xcode 15.3.

For your information, std::vector contained instances of the class I had written, and I was comparing them through a custom Comp function.

However, items that should not be null are recognized as null and crash as a null reference.

Please check it and return it.

Post not yet marked as solved Up vote post of PIRUA Down vote post of PIRUA
101 views

Replies

This bug is happening for me in one specific location where I use std::sort on a vector of pointers out of nearly 200. I haven't been able to identify what specifically triggers this bad behavior, have you?

Actually, I was just able to identify my issue as a comparator that didn't QUITE meet the requirements. The old implementation of std::sort was testing elements in an order where my comparator never exhibited its lack of strict ordering. I'm not 100% sure this is what OP is experiencing but if you see this, check your comparator carefully.