Hi, I've faced one more issue when ran generate_appcast in ui-separation-and-xpc branch. It fails with next error: segmentation fault.
Here are some details:
Process 37880 launched: './bin/generate_appcast' (x86_64)
Process 37880 stopped
* thread #4, queue = 'com.apple.root.default-qos', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #0: 0x00000001004bef9f generate_appcast`swift_getObjectType + 47
generate_appcast`swift_getObjectType:
-> 0x1004bef9f <+47>: andq (%rbx), %rax
0x1004befa2 <+50>: testq %rax, %rax
0x1004befa5 <+53>: jne 0x1004befb9 ; <+73>
0x1004befa7 <+55>: jmp 0x1004befcb ; <+91>
Target 0: (generate_appcast) stopped.
Are you able to build & run this tool yourself? If so, could you try it in Debug mode, so that it will print more details about the crash?
Yes, I successfully built it following the doc. How can I run it in Debug mode?
Hi @kornelski, here is more detailed stack trace when running a tool built in debug mode:
* thread #4, queue = 'com.apple.root.default-qos', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
* frame #0: 0x000000010051234f generate_appcast`swift_getObjectType + 47
frame #1: 0x00000001004cd823 generate_appcast`_dynamicCastFromExistential(swift::OpaqueValue*, swift::OpaqueValue*, swift::TargetExistentialTypeMetadata<swift::InProcess> const*, swift::TargetMetadata<swift::InProcess> const*, swift::DynamicCastFlags) + 83
frame #2: 0x000000010002ae20 generate_appcast`dsaSignature(path="file:///Users/teologov/AppBuilds/App/Dev/appcast/App-1.3.0.dmg", privateKey=0x0000000100d10750) at DSASignature.swift:52
frame #3: 0x0000000100021e98 generate_appcast`closure #2 in makeAppcast(update=0x0000000100c034c0, privateKey=0x0000000100d10750, group=0x0000000100d10d70) at Appcast.swift:37
frame #4: 0x00000001000228b5 generate_appcast`partial apply for closure #2 in makeAppcast(archivesSourceDir:privateKey:) at <compiler-generated>:0
frame #5: 0x00000001000220fd generate_appcast`thunk for @escaping @callee_guaranteed () -> () at <compiler-generated>:0
frame #6: 0x00007fff7570bd4f libdispatch.dylib`_dispatch_call_block_and_release + 12
frame #7: 0x00007fff7570cdcb libdispatch.dylib`_dispatch_client_callout + 8
frame #8: 0x00007fff7570f23c libdispatch.dylib`_dispatch_queue_override_invoke + 767
frame #9: 0x00007fff7571ad1a libdispatch.dylib`_dispatch_root_queue_drain + 325
frame #10: 0x00007fff7571b4b1 libdispatch.dylib`_dispatch_worker_thread2 + 90
frame #11: 0x00007fff7594c6ee libsystem_pthread.dylib`_pthread_wqthread + 619
frame #12: 0x00007fff7594c415 libsystem_pthread.dylib`start_wqthread + 13
Hopefully, it helps.
I am creating the signed with my identity .dmg file using https://github.com/LinusU/node-appdmg. I also tried to sign the .dmg by myself without this tool, and it still is failing with the same error.
@kornelski, it seems it's something very similar to #1155 and #1285. I managed to make it work with 1028 byte key (Sparkle 1.20.0):
openssl gendsa <(openssl dsaparam 1028) -out dsa_priv.pem
openssl dsa -in dsa_priv.pem -pubout -out dsa_pub.pem
This is 鈥nexpected! If I specify size 2047, it generates a 2048-bit key, but with an older digest algorithm (that's probably what macOS wants).
So I think this issue may be fixed in the XPC branch.
You need to generate keys again, and put new dsa_pub.pem in the app, and sign with the new key.
Got it. Ok, I'll test it again tonight. Thanks!
I've just generated keys again and tried to run generate_appcast. Everything works well. Thanks, @kornelski!