node-segfault-handler icon indicating copy to clipboard operation
node-segfault-handler copied to clipboard

Windows ARM64 not support

Open biduan opened this issue 1 year ago • 1 comments

While running npm install segfault-handler on a Windows ARM64 computer, encountered the following error:

npm error C:\github\temp\sherpa-onnx\nodejs-examples\node_modules\segfault-handler\src\StackWalker.cpp(971,1): error C1189: #error: "Platform not supported!" [C:\github\temp\sherpa-onnx\nodejs-examples\node_modules\segfault-handler\build\segfault-handler.vcxproj]

The reason for this error is that StackWalker.cpp does not support Windows ARM64. A workaround is to modify the code by adding the following lines:

#elif _M_ARM64 imageType = IMAGE_FILE_MACHINE_ARM64; s.AddrPC.Offset = c.Pc; s.AddrPC.Mode = AddrModeFlat; s.AddrFrame.Offset = c.Fp; s.AddrFrame.Mode = AddrModeFlat; s.AddrStack.Offset = c.Sp; s.AddrStack.Mode = AddrModeFlat; #else #error "Platform not supported!" #endif

This modification adds support for Windows ARM64 by defining the necessary values for the imageType, AddrPC, AddrFrame, and AddrStack fields.

biduan avatar Dec 17 '24 02:12 biduan

Thank you for request and suggestion on how to fix it. I see that it has been fixed in StackWalker (https://github.com/JochenKalmbach/StackWalker/pull/54), and I will try to upgrade to a more recent version.

kneth avatar Dec 21 '24 10:12 kneth