opensumi / core

🚀 A framework helps you quickly build AI Native IDE products. https://preview.opensumi.com
https://opensumi.com
MIT License
2.84k stars 369 forks source link

[BUG] Mutex lock failed: Invalid argument #3248

Open teddyos opened 9 months ago

teddyos commented 9 months ago

描述你的问题(Describe the bug)

Our IDE is built on top of the OpenSumi framework, the electron-ide template. On Mac M1, the IDE could not start because of this error: [node]libc++abi.dylib: terminating with uncaught exception of type std::__1::system_error: mutex lock failed: Invalid argument

z4980186848475_f68a23be0d01b1404315564b5885645b

z4985195792737_9bad81d93d9f5bd1e849e9cf4807f139

复现路径(To Reproduce)

Steps to reproduce the behavior:

  1. Go to https://mini.zalo.me/devtools to download the IDE
  2. Open the IDE using terminal: /Applications/Zalo\ Mini\ App\ Studio.app/Contents/MacOS/Zalo\ Mini\ App\ Studio
  3. The IDE crashed before launching
  4. See error

预期表现(Expected behavior)

The IDE launches successfully without mutex errors:

Screenshot 2023-12-18 at 11 06 37

环境信息(Environment)

Thank you!

erha19 commented 9 months ago

@teddyfullstack Hi, I downloaded the (M1) IDE from https://mini.zalo.me/devtools, but I can not reproduce the error you showed on the issue.

Is this an issue on a specific computer model? It looks like some native environment is not completed.

teddyos commented 9 months ago

Is this an issue on a specific computer model?

Yes, it is!

It looks like some native environment is not completed.

Can you elaborate more on this? What could be the causes and how to fix them? Thanks!

yantze commented 9 months ago

You can double check where the Node.js native addon was used and check if it has been called multiple times.

teddyos commented 9 months ago

There was no native module usage in our codebase. I believe the @opensumi framework uses them under the hood. The only occurrence of these native module addons is in https://github.com/opensumi/ide-electron/blob/dcec2d74f87283cfe4e60e6f987c4a1c1ab42472/scripts/rebuild-native.js#L7C1-L13C3!

bytemain commented 5 months ago

this happened on opensumi: https://github.com/opensumi/core/actions/runs/8632026472/job/23661691843?pr=3521

libc++abi: terminating with uncaught exception of type std::__1::system_error: mutex lock failed: Invalid argument 69 Error: Process completed with exit code 1.

ref: