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

[2.4.0-beta.4] [Darwin] [BLOCKLY-PYTHON] Blockly & python 2.7 & python 3 crash with a simple rule #696

Closed
oben01 opened this issue Sep 1, 2020 · 7 comments

Comments

@oben01
Copy link
Member

oben01 commented Sep 1, 2020

Which environnement

  1. Yadoms version : 2.4.0-beta.4
  2. Host hardware : MacOS
  3. OS and Version MacOS Catalina build version : 10.15.6

Describe the bug
I create a simple script with blockly to log "Hello world".

Capture d’écran 2020-09-01 à 19 41 51

The rule crash just after I run it

Python 2.7 & python 3 crash with the same error.
The callstack :

# Log file created/rotated Tuesday, 1 Sep 20 17:45:29 GMT
Tue, 19:45:29 : [Information] : #### START ####
Tue, 19:45:29 : [Error] : Traceback (most recent call last):
Tue, 19:45:29 : [Error] :   File "scriptCaller.py", line 14, in <module>
Tue, 19:45:29 : [Error] :     import yScriptApiWrapper3
Tue, 19:45:29 : [Error] :   File "/Users/user/Downloads/Yadoms-2.4.0-beta.4-Darwin/bin/scriptInterpreters/yPython3/yScriptApiWrapper3.py", line 17, in <module>
Tue, 19:45:29 : [Error] :     import _yScriptApiWrapper3
Tue, 19:45:29 : [Error] : ImportError: dlopen(/Users/odahmaz/Downloads/Yadoms-2.4.0-beta.4-Darwin/bin/scriptInterpreters/yPython3/_yScriptApiWrapper3.so, 2): Library not loaded: /opt/local/Library/Frameworks/Python.framework/Versions/3.8/Python
Tue, 19:45:29 : [Error] :   Referenced from: /Users/odahmaz/Downloads/Yadoms-2.4.0-beta.4-Darwin/bin/scriptInterpreters/yPython3/_yScriptApiWrapper3.so
Tue, 19:45:29 : [Error] :   Reason: image not found

Python is already installed

Capture d’écran 2020-09-02 à 09 15 08

@oben01 oben01 changed the title [2.4.0-beta.4] [Darwin] [BLOCKLY] Blockly crash with a simple rule [2.4.0-beta.4] [Darwin] [BLOCKLY-PYTHON] Blockly & python 2.7 & python 3 crash with a simple rule Sep 1, 2020
@oben01 oben01 added this to the 2.4 milestone Sep 1, 2020
@oben01 oben01 added the Python label Sep 2, 2020
@sgallou
Copy link
Contributor

sgallou commented Oct 6, 2020

Did you install python-dev package ?

@jano42
Copy link
Member

jano42 commented Oct 7, 2020

I've tried to run 2.4.0-beta.5
And I've got many security alerts for each "executable" (each plugin, each script interpreter,... each .so (script wrapper).
I have to authorize them all manually (one by one....)

@jano42
Copy link
Member

jano42 commented Oct 7, 2020

Wed, 20:41:42 : [Error] : /Users/jeanmicheldecoret/Downloads/Yadoms-2.4.0-beta.5-Darwin/bin/scriptInterpreters/yPython27/_yScriptApiWrapper27.so: code signature in (/Users/jeanmicheldecoret/Downloads/Yadoms-2.4.0-beta.5-Darwin/bin/scriptInterpreters/yPython27/_yScriptApiWrapper27.so) not valid for use in process using Library Validation: library load disallowed by system policy

@jano42
Copy link
Member

jano42 commented Oct 7, 2020

@jano42
Copy link
Member

jano42 commented Oct 8, 2020

OK after having disabled apple security by running this command into yadoms folder:
xattr -r -d com.apple.quarantine .

I have the same error as @oben01

Thu, 06:08:21 : [Error] : ImportError: dlopen(/Users/jeanmicheldecoret/Downloads/Yadoms-2.4.0-beta.5-Darwin/bin/scriptInterpreters/yPython27/_yScriptApiWrapper27.so, 2): 
Library not loaded: /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Python
Thu, 06:08:21 : [Error] :   Referenced from: /Users/jeanmicheldecoret/Downloads/Yadoms-2.4.0-beta.5-Darwin/bin/scriptInterpreters/yPython27/_yScriptApiWrapper27.so
Thu, 06:08:21 : [Error] :   Reason: image not found

I've checked the real error and it seems a "rpath" error. At build time (into docker) the scriptWrapper are linked with python libs located at /opt/local/Library/Frameworks/Python.framework/Versions/2.7/Python. And at runtime, it search for with library at the same place.
Have to review cmake settings about that. (its a common problem with dynamic linking)

@jano42
Copy link
Member

jano42 commented Oct 28, 2020

I've created an issue on cross toolchain repository
tpoechtrager/osxcross#247

@jano42
Copy link
Member

jano42 commented Oct 28, 2020

Fied by installing python2 and python3 using macports

sudo port install python27 python38

In fact the build system is too much linked with a specific python version and path.

Create new issue to solve this one
#707

@jano42 jano42 closed this as completed Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants