Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with iOS version 9.0 #109

Closed
umangkathuria opened this issue May 27, 2019 · 29 comments
Closed

Compatibility with iOS version 9.0 #109

umangkathuria opened this issue May 27, 2019 · 29 comments
Labels
0.6.2 ios Affects iOS

Comments

@umangkathuria
Copy link

Hi Eric!

I am getting this error while running an application using LiquidCore version 0.6.1.

dyld: lazy symbol binding failed: Symbol not found: _JSContextGroupAddMarkingConstraint
Referenced from: / /* path to app*/ /Frameworks/LiquidCore.framework/LiquidCore (which was built for iOS 10.0)
Expected in: /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 9.0.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/JavaScriptCore.framework/JavaScriptCore

To reproduce-
Run the code with iOS Deployment Target 9.0
Simulator used- iOS 6S with OS version 9.0

Here's the screenshot of the file where we reach this exception.
Screenshot 2019-05-27 at 4 02 59 PM

I wanted to confirm if the LiquidCore framework can be used with iOS 10 and above only or if this is an actual bug ? If it is, is there any work around or fix to this problem?

Thank you!

@umangkathuria
Copy link
Author

@ericwlange - On further investigation, I found that the same issue occurs with iOS 10.0 and 11.0 as well.
Can you please have a look?
Has anyone else faced this issue before ?
Thank you in advance!

@umangkathuria
Copy link
Author

@ericwlange - Furthermore, I noticed that for iOS Version 11.0 the error is similar but not exactly same.

This is the error that I got -

dyld: lazy symbol binding failed: Symbol not found: _JSObjectGetGlobalContext
Referenced from: /path-to-app/Frameworks/LiquidCore.framework/LiquidCore
Expected in: /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 11.0.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/JavaScriptCore.framework/JavaScriptCore

The file where this exception is received is Object.cpp, under LiquidCore Framework. Whereas in the case of iOS9.0/10.0 it was NodeInstance.cpp

@ericwlange
Copy link
Member

I have not tested with below iOS 10, so I am not sure if this will work on 9. Nobody has reported this before, so any additional information you can provide would be helpful.

@umangkathuria
Copy link
Author

Okay.
I am facing the same issue with iOS10 as well. LiquidCore version 0.6.1 is being used.
The complete error log is -
_/Users/umang.kathuria/Library/Developer/CoreSimulator/Devices/03C8D4A2-710A-4A21-AD14-C92385EA8BF8/data/Containers/Data/Application/810196C6-49B8-4DAF-9D23-8A1FC2F1F4C2/Library/Application Support/liquid.bundle
dyld: lazy symbol binding failed: Symbol not found: JSContextGroupAddMarkingConstraint
Referenced from: /Users/umang.kathuria/Library/Developer/CoreSimulator/Devices/03C8D4A2-710A-4A21-AD14-C92385EA8BF8/data/Containers/Bundle/Application/BB18F4FE-2040-4D1E-B8D1-84D64708D8D7/MyDemoApp.app/Frameworks/LiquidCore.framework/LiquidCore
Expected in: /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 10.0.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/JavaScriptCore.framework/JavaScriptCore

_dyld: Symbol not found: JSContextGroupAddMarkingConstraint
Referenced from: /Users/umang.kathuria/Library/Developer/CoreSimulator/Devices/03C8D4A2-710A-4A21-AD14-C92385EA8BF8/data/Containers/Bundle/Application/BB18F4FE-2040-4D1E-B8D1-84D64708D8D7/MyDemoApp.app/Frameworks/LiquidCore.framework/LiquidCore
Expected in: /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 10.0.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/JavaScriptCore.framework/JavaScriptCore

xCode Version tested with- 10.1 and 10.2.1
Please do let me know what else you'd need to diagnose the issue better.
Thanks for your time!

@ericwlange
Copy link
Member

This is possibly related to #108. I made liberal use of the private JavaScriptCore API, but it seems that is not allowed. I need to figure out how to achieve the same goals without the use of this API.

@umangkathuria
Copy link
Author

@ericwlange thanks for the update.
Do you have any workaround for this as of now ? Or may be an estimate on how much time it would take for the resolution ?

Thanks!

@ericwlange
Copy link
Member

I don't have a workaround because I haven't been able to reproduce it yet. As for the issue with using private APIs, I will only be able to say after the weekend. I fear that this is going to be a massive undertaking, but since I work a full time job, I can't look at it in any detail until the weekend.

@ericwlange
Copy link
Member

Can you please try the latest commit?

pod 'LiquidCore', :git => 'https://github.com/LiquidPlayer/LiquidCore.git', :commit => '2f8d903'

This should fix issue #108. I would like to know if it also solves your issue.

@ericwlange ericwlange added the ios Affects iOS label Jun 3, 2019
@umangkathuria
Copy link
Author

Unfortunately, we are now getting error in some other file now. This is the error received-

>>> TypeError: Function_func.call is not a function. (In 'Function_func.call(this, ...arguments)', 'Function_func.call' is undefined)
Assertion failed: (exception==0), function exec, file /path to app /Pods/LiquidCore/LiquidCoreiOS/LiquidCore/V82JSC/V82JSC.h, line 265.

iOS Version 10.0
xCode version 10.0

@umangkathuria
Copy link
Author

On further investigation, it appears that something else is also broken with this commit.

I ran my sample app on iPhone Simulator with iOS Version 12.0

I hit the button that calls some methods in JavaScript file and I can see the logs were printed from JavaScript side, but even then there is a crash after that. **The crash occurs at line# 422 of JSCPrivate.cpp file. **

Here are the screenshots-
Screenshot 2019-06-03 at 4 11 55 PM
Screenshot 2019-06-03 at 4 11 50 PM

Also, on the console- there is no error at all, we just end up at :"lldb"
The same sample code works fine with the 0.6.1. version of liquidcore.

let me know if you need more information regarding this.

Thanks for all the efforts, Eric!

@ericwlange
Copy link
Member

Thanks for reporting. I can chase down that second bug; it should be simple. Can you give the full stack information on the first one?

@ericwlange
Copy link
Member

Can you actually give me the full call stack from both of these issues?

@ericwlange
Copy link
Member

Actually, nevermind on the m_collection_thread crash. I figured that one out by inspection. That should be fixed with commit fd96e3d. Please try that and verify that the second crash does not happen anymore.

@umangkathuria
Copy link
Author

For the 1st one here are further details of the thread stack -

Screenshot 2019-06-04 at 1 54 21 PM

The error that I got in console is -

>>> TypeError: Function_func.call is not a function. (In 'Function_func.call(this, ...arguments)', 'Function_func.call' is undefined)
Assertion failed: (exception==0), function exec, file /Users/umang.kathuria/Documents/Applications- xCode/MySampleApp/Pods/LiquidCore/LiquidCoreiOS/LiquidCore/V82JSC/V82JSC.h, line 265.
(lldb)

There is nothing more in the console. Please let me know if you need anything more.

Thanks!

@umangkathuria
Copy link
Author

On the m_collection_thread crash- I can confirm its working fine now.
No crash reported.

@umangkathuria
Copy link
Author

Hi @ericwlange !

Any update on this please ?

Thanks!

@ericwlange
Copy link
Member

I've been struggling with this all day. I "fix" (read: I just change the way it is doing it -- there should be nothing wrong with my original code) one thing and then something else breaks.

At the moment, iOS 10.0 does not appear to be supported. I have not downloaded enough simulator versions to find out where it stops breaking. Have you?

@umangkathuria
Copy link
Author

The original issue that I posted - I have tested a same app with simulators running 9.0, 10.0 , 11.0 and 12.0. Out of these four versions I found that the code broke with all except for version 12.0. So therefore I have tested with maximum 11.0 and not 11.1/2/3
I also tried it with 12.1, 12.2 and the code runs fine.

The branch you gave with the fix( commit => '2f8d903'), I have only tried on 10.0

@ericwlange
Copy link
Member

I have tried both 10.0 and 10.3.1. They both fail because JavaScriptCore doesn't like when node does something like this:

class FastBuffer extends Uint8Array {
  constructor(arg1, arg2, arg3) {
    super(arg1, arg2, arg3);
  }
}
FastBuffer.prototype.constructor = Buffer;

Calling the super constructor bails with the error:

TypeError: %TypedArray% should not be called directly

This works fine on the bundled version of V8 and also on iOS 12+. I am in the process of downloading the 11.0 simulator to try and pinpoint where this starts working. But I will not try to go much further to solve the problem. I don't want to modify the node bootstrap code. This gets too difficult to maintain.

@ericwlange
Copy link
Member

Ok, I have tried my newer version with 11.0 and it works. I will check in the mods and change the minimum support from 10.0 to 11.0. It is not at far back as we'd like, but it is the best we can do with version 8.9 of node.

@umangkathuria
Copy link
Author

Could you provide the latest commit id for which 11.0 is working ?
And so I believe you'd be making 11.0 as the minimum OS version compatible with LiquidCore?

Thanks!

ericwlange added a commit that referenced this issue Jun 11, 2019
Older JSC version has issues with JSObjectSetPrototype in some places
@ericwlange
Copy link
Member

Ok, please try 6920f8d. This should work with 11.0. Minimum compatible version will be 11.0 going forward. I've changed it in LiquidCore.podspec. The differences in the javascript engine are just too much in 10.x and earlier.

@umangkathuria
Copy link
Author

@ericwlange Seems like somethings not right with the commit. I tried installing, and at first it takes alot of time. Then after a while installation fails with this error-

[!] Error installing LiquidCore
[!] Failed to download 'LiquidCore': [!] /usr/bin/git clone https://github.com/LiquidPlayer/LiquidCore.git /var/folders/dz/gvkzfsxx6r55swyy7364h7w80000gp/T/d20190613-72089-1maeyvm --template=

Cloning into '/var/folders/dz/gvkzfsxx6r55swyy7364h7w80000gp/T/d20190613-72089-1maeyvm'...
error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 60
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

Here's the screenshot as well
Screenshot 2019-06-13 at 12 58 08 PM

@umangkathuria
Copy link
Author

Okay, on third attempt, it worked and installed the library correctly. Please ignore the last comment.

@ericwlange
Copy link
Member

Yeah it sounds like a github glitch.

@umangkathuria
Copy link
Author

@ericwlange The library seems compatible with iOS 11.0 now. I have tried it a few times, and haven't seen a crash with the commit ID you gave.
Works fine with iOS 11.0

@ericwlange
Copy link
Member

@umangkathuria Glad to hear it. I am trying to figure out what is happening with #113 (which I am having trouble reproducing), but then I will push out an 0.6.2 release.

@umangkathuria
Copy link
Author

Thanks for all the effort, Eric!
Would it be possible for you to give a rough timeline for this to be released?

@ericwlange
Copy link
Member

This has been pushed in 0.6.2 today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.6.2 ios Affects iOS
Projects
None yet
Development

No branches or pull requests

2 participants