Hi @eskimo,
Thank you for your time and elaboration on this ticket. Your investigations have helped us move forward.
The shared cfstring_isa.c code (below) shows the working and crashing behavior on both x86_64 and ARM64.
We are working on applying the updates suggested to our UI code, to make them compatible with Sonoma. Once again a big thanks for all the effort put in from your end.
//
// Compile with:
//
// clang --target=x86_64-darwin-macos11 -o cfstring_isa_x86 cfstring_isa.c -framework CoreFoundation
// clang --target=arm64-darwin-macos11 -o cfstring_isa_arm cfstring_isa.c -framework CoreFoundation
//
#include <stdint.h>
#include <stdio.h>
#include <CoreFoundation/CFString.h>
struct ConstString
{
void *isa;
int32_t value;
int32_t unused;
char *asciiz;
size_t length;
} __attribute__((packed));
void ClassReference() asm("___CFConstantStringClassReference");
const struct ConstString Hello = {
.isa = ClassReference,
.value = 1992,
.unused = 0,
.asciiz = "Hello",
.length = 5,
};
const struct ConstString World = {
.isa = 0,
.value = 1992,
.unused = 0,
.asciiz = "World",
.length = 5,
};
int main (int argc, char *argv[]) {
CFStringRef hello = (void *)&Hello;
CFStringRef world = (void *)&World;
printf("Works on Sonoma:\n");
printf("%s\n", CFStringGetCStringPtr(hello, kCFStringEncodingMacRoman));
printf("\n");
printf("Works on Ventura, crashes on Sonoma:\n");
printf("%s\n", CFStringGetCStringPtr(world, kCFStringEncodingMacRoman));
printf("\n");
return 0;
}