OpenSSL icon indicating copy to clipboard operation
OpenSSL copied to clipboard

I took same error. I returned the 1.1.1500 version then its fixed.

Open burakCokyildirim opened this issue 2 years ago • 21 comments

I took same error. I returned the 1.1.1500 version then its fixed. I think, 1.1.1700 build has a problem. @krzyzanowskim

Originally posted by @burakCokyildirim in https://github.com/krzyzanowskim/OpenSSL/issues/152#issuecomment-1199272835

burakCokyildirim avatar Jul 29 '22 13:07 burakCokyildirim

Most likely because something cached old version for you (Cocoapods? DerivedData? Xcode project?) and do not fetch newer version properly. I'd love to know the problem, but from my investigation there's no setup changes between 1.1.1501 and 1.1.1700 other than updated binaries.

Notice the previous version: 1.1.1501

krzyzanowskim avatar Jul 29 '22 13:07 krzyzanowskim

I see, but i depended openssl-universal from a pod. I didn't add openssl directly to my podfile

I executed these commands;

rm -rf ~/Library/Caches/CocoaPods rm -rf Pods rm Podfile.lock pod install --repo-update

And i got this error at the runtime. (Library not loaded: @rpath/OpenSSL.framework/OpenSSL ...)

Then I noticed a difference in podfile.lock. OpenSSL-Universal version was changed.

If i add to OpenSSL-Universal 1.1.1501 version to Podfile, I don't get the error.

note, i have tried the delete derived data and clean project.

burakCokyildirim avatar Jul 29 '22 13:07 burakCokyildirim

try one more

pod deintegrate
pod install

I'd give it a try with new sample project. I wonder if you can reproduce it there.

krzyzanowskim avatar Jul 29 '22 18:07 krzyzanowskim

With 1.1.1700 the app crashes right away, saying OpenSSL cannot be loaded.

With any older version such as pod 'OpenSSL-Universal', '1.1.1501' everything works fine.

ivfit avatar Aug 11 '22 15:08 ivfit

can you reproduce it with a newly created sample project that you may attach here?

krzyzanowskim avatar Aug 11 '22 15:08 krzyzanowskim

Actually with 1.1.1700 the app works on simulator, but on the real device it crashes:

dyld[32675]: Library not loaded: '@rpath/OpenSSL.framework/OpenSSL'
  Referenced from: '/private/var/containers/Bundle/Application/xxx/test.app/test'
  Reason: tried: '/private/var/containers/Bundle/Application/xxx/test.app/Frameworks/OpenSSL.framework/OpenSSL' (no such file), '/private/var/containers/Bundle/Application/xxx/test.app/Frameworks/OpenSSL.framework/OpenSSL' (no such file), '/System/Library/Frameworks/OpenSSL.framework/OpenSSL' (no such file)
Library not loaded: '@rpath/OpenSSL.framework/OpenSSL'
  Referenced from: '/private/var/containers/Bundle/Application/xxx/test.app/test'
  Reason: tried: '/private/var/containers/Bundle/Application/xxx/test.app/Frameworks/OpenSSL.framework/OpenSSL' (no such file), '/private/var/containers/Bundle/Application/xxx/test.app/Frameworks/OpenSSL.framework/OpenSSL' (no such file), '/System/Library/Frameworks/OpenSSL.framework/OpenSSL' (no such file)
(lldb)

You can send me over sample project to test.

ivfit avatar Aug 11 '22 16:08 ivfit

as I said before. It looks like an Xcode project (maybe Cocoapods) issue where it does not embed framework in the app bundle properly for some reason (??)

krzyzanowskim avatar Aug 11 '22 16:08 krzyzanowskim

But why does it work with the older versions? There has to be some breaking change?

ivfit avatar Aug 11 '22 16:08 ivfit

I don't know tbh https://github.com/krzyzanowskim/OpenSSL/issues/154#issuecomment-1199280044

can you send me this test project you created?

krzyzanowskim avatar Aug 11 '22 16:08 krzyzanowskim

It's not the test project, I've just replaced the IDs.

I see 3 commits after 1.1.1501, one of them is definitely breaking things: https://github.com/krzyzanowskim/OpenSSL/commits/master

Maybe to reference a specific commit in Podfile instead of using pod 'OpenSSL-Universal'?

ivfit avatar Aug 11 '22 16:08 ivfit

I see 3 commits after 1.1.1501, one of them is definitely breaking things

not sure what you mean by that, there's a single commit between 1.1.1501 and 1.1.1700 https://github.com/krzyzanowskim/OpenSSL/commit/9429bf89fe0df2d2f25f3a9a51cbf7092e69640f

krzyzanowskim avatar Aug 11 '22 16:08 krzyzanowskim

Doesn't work: pod 'OpenSSL-Universal', :git => 'https://github.com/krzyzanowskim/OpenSSL.git', :commit => '9429bf89fe0df2d2f25f3a9a51cbf7092e69640f'

Works: pod 'OpenSSL-Universal', :git => 'https://github.com/krzyzanowskim/OpenSSL.git', :commit => '033fcb41dac96b1b6effa945ca1f9ade002370b2'

ivfit avatar Aug 11 '22 17:08 ivfit

Doesn't work on your project. can you reproduce it with a newly created sample project that you may attach here? https://github.com/krzyzanowskim/OpenSSL/issues/154#issuecomment-1212177941

krzyzanowskim avatar Aug 11 '22 17:08 krzyzanowskim

I've created test project and it crashes even in simulator.

Just download it, do pod update, open Test.xcworkspace and run it.

Test.zip

ivfit avatar Aug 12 '22 06:08 ivfit

I cannot reproduce any crash with a Test project you provided. It runs on Simulator and on Device here.

pod --version 1.11.3

Screen Shot 2022-08-12 at 15 24 24@2x

IMG_1228 Large

krzyzanowskim avatar Aug 12 '22 13:08 krzyzanowskim

pod version 1.11.3 Xcode version 13.4.1 macOS Monterey version 12.5

Are you running the same?

ivfit avatar Aug 13 '22 14:08 ivfit

The issue is reproduced on the new empty project on the Mac with M1 chip when the terminal is not running in Rosetta mode. The empty project is built successfully with OpenSSL-Universal 1.1.1700 pod when the terminal is running in Rosetta mode.

KarinaLipnyagova avatar Aug 16 '22 08:08 KarinaLipnyagova

getting a similar error with OpenSSL-Universal 1.1.1700, app crash while we tap on the app icon

Termination Description: DYLD, dyld: Using shared cache: EC12EBDC-CAE3-34EC-ACCB-0B6E5ABC73EB | dependent dylib '@rpath/OpenSSL.framework/OpenSSL' not found for '/private/var/containers/Bundle/Application/62AEA174-7CD0-4D1A-9DEA-86183FBFAD2A/mID Verify.app/mID Verify', tried but didn't find: '/usr/lib/swift/OpenSSL.framework/OpenSSL' '/private/var/containers/Bundle/Application/62AEA174-7CD0-4D1A-9DEA-86183FBFAD2A/mID Verify.app/Frameworks/OpenSSL.framework/OpenSSL' '@rpath/OpenSSL.framework/OpenSSL' '/System/Library/Frameworks/OpenSSL.framework/OpenSSL' Highlighted by Thread: 0

Backtrace not available

Unknown thread crashed with ARM Thread State (64-bit): x0: 0x0000000000000006 x1: 0x0000000000000001 x2: 0x000000016fa39ff0 x3: 0x000000000000009f x4: 0x000000016fa39bf0 x5: 0x0000000000000000 x6: 0x0000000000000000 x7: 0x0000000000000000 x8: 0x0000000000000020 x9: 0x0000000000000009 x10: 0x0000000000000001 x11: 0x00000000000000eb x12: 0x00000000000000dc x13: 0x00000000000000ca x14: 0x00000000000000e3 x15: 0x0000000000000034 x16: 0x0000000000000209 x17: 0x00000001008bf488 x18: 0x0000000000000000 x19: 0x0000000000000000 x20: 0x000000016fa39bf0 x21: 0x000000000000009f x22: 0x000000016fa39ff0 x23: 0x0000000000000001 x24: 0x0000000000000006 x25: 0x000000016fa3a8b8 x26: 0x00000001008e8000 x27: 0x00000001008e8000 x28: 0x000000016fa3b924 fp: 0x000000016fa39bc0 lr: 0x00000001008cda88 sp: 0x000000016fa39b80 pc: 0x00000001008c5848 cpsr: 0x00000000 esr: 0x00000000 Address size fault

Binary images description not available

Error Formulating Crash Report: Failed to create CSSymbolicatorRef - corpse still valid ¯_(ツ)_/¯

EOF

Dhananjay-Fartyal avatar Sep 01 '22 11:09 Dhananjay-Fartyal

I got similar error with @Dhananjay-Fartyal. My mac is intel based. can it be related with that ? What is your mac's chip does all of them intel ?

mketizmen avatar Sep 07 '22 13:09 mketizmen

is it all related to CocoaPods setup for everyone, or do anyone see issues with SwiftPM setup too? I still cannot reproduce it on my end and can't really do anything about it.

krzyzanowskim avatar Sep 07 '22 13:09 krzyzanowskim

I got similar error with @Dhananjay-Fartyal. My mac is intel based. can it be related with that ? What is your mac's chip does all of them intel ?

@mketizmen Yes, My mac is Intel-based, and I don't think it is chip related issue, Somehow OpeSSL 1.1.1700 framework is not embedded in my app which causes crashes, I downgraded it to 1.1.1501, which works for me.

It seems cocoapod issue with this version (maybe architecture), still investigating the exact root cause.

Dhananjay-Fartyal avatar Sep 07 '22 13:09 Dhananjay-Fartyal

is it all related to CocoaPods setup for everyone, or do anyone see issues with SwiftPM setup too? I still cannot reproduce it on my end and can't really do anything about it.

Hello @krzyzanowskim, my team can reproduce this issue on both Intel and m1 macs using SPM. It doesn't seem cocoapods related

Claes34 avatar Oct 24 '22 13:10 Claes34

I still cannot reproduce it on my end. Just yesterday integrated 1.1.1700 as SPM in new app and it worked just fine here (Xcode 14)

krzyzanowskim avatar Oct 24 '22 13:10 krzyzanowskim

I'm happy to continue trying to reproduce. send me a project and exact spec so I can be as close as possible and see if I can reproduce

krzyzanowskim avatar Oct 24 '22 13:10 krzyzanowskim

That said, we can setup up a pair debugging session and try to diagnose and solve the problem on your machine. that exceed the free support for this project I can provide.

krzyzanowskim avatar Oct 24 '22 13:10 krzyzanowskim

That said, we can setup up a pair debugging session and try to diagnose and solve the problem on your machine. that exceed the free support for this project I can provide.

Don't worry, we will try to investigate the reason on our side first. Just wanted to mention that it's not specifically cocoapods related as you asked the question :D

Claes34 avatar Oct 24 '22 13:10 Claes34

Running into this issue when using OpenSSL via SPM, I setup an example project here that hits the issue only on physical devices and when embedding openssl in a sub framework. https://github.com/jacoblange-dev/OpenSSLBugExample

jacoblange-dev avatar Dec 13 '22 01:12 jacoblange-dev

UPDATE After following steps from https://github.com/krzyzanowskim/OpenSSL/issues/159#issuecomment-1336302130

Uninstall ruby gems sudo gem uninstall --all
Remove workspace project, delete Podfile.lock
Deleted the pods directory
Install cocoapods sudo gem install cocoapods
Run pod install

it actually works for me, the diff is gone, and the framework folder now has OpenSSL.framework and content correctly.

It should be a nasty bug from cocoapods core's dependency or code.

I notice on the working macOS, the framework folder contains correct OpenSSL.framework, while on my mac, it's named OpenSSL-Universal and has no content. Not sure if this helps.


On my side, I met similar issue as well, same git branch, same Podfile.lock, nothing touched, once I do pod install, it will have below diff: 1678157557629

but on another macOS, same pod 1.11.3, it will never have this diff.

and in the simulator it will carsh as framework not found.

liuxuan30 avatar Mar 07 '23 03:03 liuxuan30