core icon indicating copy to clipboard operation
core copied to clipboard

[BUG] Mutex lock failed: Invalid argument

Open mister-teddy opened this issue 2 years ago • 5 comments

描述你的问题(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)

  • OS: MacOS Sonoma
  • Electron 18.3.4
  • OpenSumi Version: 2.24.1

Thank you!

mister-teddy avatar Dec 18 '23 04:12 mister-teddy

@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.

erha19 avatar Dec 21 '23 03:12 erha19

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!

mister-teddy avatar Dec 21 '23 04:12 mister-teddy

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

yantze avatar Dec 22 '23 06:12 yantze

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!

mister-teddy avatar Dec 22 '23 08:12 mister-teddy

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:

  • https://stackoverflow.com/questions/66773247/libcabi-dylib-terminating-with-uncaught-exception-of-type-std-1system-er

bytemain avatar Apr 11 '24 03:04 bytemain