When using some profiles in non-registration contexts, the profiles will crash CiviCRM with a fatal when submitted. Error message is the "this profile cannot be used..." message. Which turns out to be bogus.
Cause: CRM_ACL_BAO_ACL::group() returns the keys of a non-associative array rather than the values when there is an ACL granting access for all profiles to a role. This causes some UF ID to be out of range, and creates a bogus priv string upstream.
Patch is enclosed.