g_app_info_launch crashes on macos
With this sample g_app_info_launch
crashes when launching applications.
Backtrace:
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
* frame #0: 0x00000001945c9ff8 CoreFoundation`CF_IS_OBJC + 24
frame #1: 0x000000019448284c CoreFoundation`CFStringGetLength + 148
frame #2: 0x0000000194587cf0 CoreFoundation`_CFURLCreateWithFileSystemPath + 84
frame #3: 0x00000001003f965c libgio-2.0.0.dylib`g_osx_app_info_launch_internal [inlined] create_url_from_cstr(cstr="@\x82k\U00000002", is_file=1) at gosxappinfo.m:238:11 [opt]
frame #4: 0x00000001003f958c libgio-2.0.0.dylib`g_osx_app_info_launch_internal at gosxappinfo.m:267:22 [opt]
frame #5: 0x00000001003f9534 libgio-2.0.0.dylib`g_osx_app_info_launch_internal [inlined] fill_urlspec_for_appinfo(urlspec=0x000000016fdfede8, info=<unavailable>, uris=<unavailable>, are_files=1) at gosxappinfo.m:282:23 [opt]
frame #6: 0x00000001003f9514 libgio-2.0.0.dylib`g_osx_app_info_launch_internal(appinfo=<unavailable>, uris=<unavailable>, are_files=1, error=0x0000000000000000) at gosxappinfo.m:460:3 [opt]
frame #7: 0x0000000100003e20 sample`main + 228
frame #8: 0x0000000194090274 dyld`start + 2840
From a cursory look at the source code (gosxappinfo.m
), I think the problem is that create_url_list_from_glist
is passing the list elements to create_url_from_cstr
as if they were strings, but if are_files=TRUE
they are actually GFile *
.