-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
nodejs example failed on Alpine3.11 #352
Comments
Can you provide the docker file that you're using? And if you can include
the failing commands in the docker file, that would be great too
…On Sat, Aug 28, 2021, 7:42 AM 王鑫 ***@***.***> wrote:
Currently, we need to use alpine to do some web application. We tried to
build zcm in docker with base image "node:12.22.5-alpine3.11".
*What we did to make it work?*
apk add bash git g++ make pkgconfig python tar zeromq-dev
mv zcm/transport/transport_serial.cpp zcm/transport/transport_serial.abb
mv zcm/transport/transport_can.cpp zcm/transport/transport_can.abb
sed -i 's/uint/unsigned int/g' zcm/transport/udpm/udpmsocket.cpp
sed -i 's/uint/unsigned int/g' gen/GetOpt.cpp
sed -i "s@<sys/poll.h>@***@***.***" zcm/transport/udpm/udpm.hpp
./waf configure --use-ipc --use-udpm --use-zmq --use-nodejs
./waf build
./waf install
*What happened?*
When we tried to run the node example, we got unexpected segment fault.
This does not happen on system like ubuntu. The error log is as below.
bash-5.0# node app.js
listening on *:3000
Segmentation fault
But cpp examples can run successfully.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#352>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXKUUESAHAAOMVER5OXOPLT7DDRBANCNFSM5C7BH5XA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
The dockerfile is as below. FROM node:12.22.5-alpine3.11
RUN apk update && apk upgrade && \
apk add --no-cache bash git g++ make pkgconfig python tar zeromq-dev && \
git config --global url.git://github.com/.insteadOf https://github.com/ && \
yarn config set registry https://registry.npm.taobao.org/ && \
wget https://github.com/ZeroCM/zcm/archive/v1.0.3.tar.gz && \
tar xzf v1.0.3.tar.gz && \
cd zcm-1.0.3 && \
./waf configure --use-ipc --use-udpm --use-zmq --use-nodejs && \
mv zcm/transport/transport_serial.cpp zcm/transport/transport_serial.abb && \
mv zcm/transport/transport_can.cpp zcm/transport/transport_can.abb && \
sed -i 's/uint/unsigned int/g' zcm/transport/udpm/udpmsocket.cpp && \
sed -i 's/uint/unsigned int/g' gen/GetOpt.cpp && \
sed -i "s@<sys/poll.h>@<poll.h>@g" zcm/transport/udpm/udpm.hpp && \
./waf build && \
./waf install && \
cd .. && \
rm -fr zcm-1.0.3 v1.0.3.tar.gz
ENV ZCM_DEFAULT_URL="udpm://239.255.76.67:7667?ttl=0" After docker image is successfully built, I just run THX. |
You need to build the zcm repo in order to use the examples. I would recommend building from source (very fast) over using a published image. You'll need to configure with |
Okay so I pushed up a branch that allows you to build only examples you configure for - |
Confirmed that the segfault happens on receipt of a message. Can also confirm that gdb thinks it's happening in the |
Thank you for your quick response. Hope this can be solved soon. |
Yeah I'm sorry I wasn't able to track it down with a few hours of work. Unfortunately I don't have more time than that right now to dedicate to this. Are you unable to just use an ubuntu image for now? I think the node code really needs to be rewritten at this point. The ffi interface that nodes uses I don't even think is supported anymore |
After more research into alpine, while technically you can build zcm on alpine by just making sure to install all the proper dependencies, there is no clang support, no sanitizer support, and no glibc support. So debugging is a huge pain. Unfortunately I am not going to be able to put in the time to support fixing this bug. I have a gut feeling that simply moving to the new nodejs c API would fix this issue. But I have no idea how long it will be until we do that. |
Currently, we need to use alpine to do some web application. We tried to build zcm in docker with base image "node:12.22.5-alpine3.11".
What we did to make it work?
What happened?
When we tried to run the node example, we got unexpected segment fault. This does not happen on system like ubuntu. The error log is as below.
bash-5.0# node app.js listening on *:3000 Segmentation fault
But cpp examples can run successfully.
The text was updated successfully, but these errors were encountered: