treeform / puppy

Puppy fetches via HTTP and HTTPS
MIT License
184 stars 27 forks source link

SIGSEGV on Apple Silicon ( M1 ) #59

Closed heinthanth closed 2 years ago

heinthanth commented 2 years ago

I've tried to compile and run simple code like below:

import puppy

echo fetch("https://ifconfig.me")

On Intel mac ( with rosetta2 ) compiled with x86-64 nim, it works fine! But when compiled with arm64 nim, it resulted in SIGSEGV.

ARM64:

Screen Shot 2022-01-27 at 12 58 23 PM

AMD64:

Screen Shot 2022-01-27 at 12 59 28 PM

I traced and found out objc_msgSend is causing the problem. But can't solve since I'm not quite familiar with macOS system lib and objc.

https://github.com/treeform/puppy/blob/0efd3cef961a91e6b47117cfa6acf026cdb775a9/src/puppy/macdefs.nim#L72-L76

Hope you can fix it 🙇

guzba commented 2 years ago

We noticed this with https://github.com/treeform/windy too. We figured out the issue over there and are porting the fix here now.

guzba commented 2 years ago

Will be tagged tmrw, is late here https://github.com/treeform/puppy/pull/61