RobotWebTools / rclnodejs

Node.js version of ROS 2.0 client
https://docs.ros.org/en/jazzy/Concepts/Basic/About-Client-Libraries.html#community-maintained
Apache License 2.0
334 stars 72 forks source link

Verify on all platforms: ARM/x86, 32/64bit #231

Open kenny-y opened 6 years ago

kenny-y commented 6 years ago

We're doing development on 64bit x64 Win/Linux/Mac... we don't have proof that rclnodejs works on other supported platforms yet.

qiuzhong commented 6 years ago

@kenny-y , I thought you mean x86-64 or amd64, which is totally different with ia64. Now IA32 32/64bit are supported and not tested on ARM platform.

kenny-y commented 6 years ago

Yes ia64 was a typo 👍

minggangw commented 6 years ago

I have checked the document of the three current ci we use, non of them supports the arm arch.

kenny-y commented 6 years ago

Let's keep this open and look for solution in the long run :)

sshmaxime commented 4 years ago

I'm trying to run it on a raspberry 4, 4gb, ARM64, it doesn't work when running yarn install.

error /home/workspace/node_modules/rclnodejs: Command failed.

Any update ?

ros2jsguy commented 4 years ago

Hmm. I just created a small test project that installs, builds and runs with no issues.

I've been running this configuration for about a week but primarily using npm. I just installed yarn trying to replicate your report. Can you share any additional details?

sshmaxime commented 4 years ago

It is running inside a docker container

I feel that the log start to make sense for the rclnodejs part but if you want the full log I can also send it. Running with verbose I can see a segmentation fault.

gyp info using node-gyp@5.1.0
gyp info using node@12.18.3 | linux | arm64
gyp info find Python using Python version 2.7.18 found at "/usr/bin/python2"
gyp http GET https://nodejs.org/download/release/v12.18.3/node-v12.18.3-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v12.18.3/node-v12.18.3-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v12.18.3/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v12.18.3/SHASUMS256.txt
gyp info spawn /usr/bin/python2
gyp info spawn args [
gyp info spawn args   '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/home/workspace/node_modules/int64-napi/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/root/.cache/node-gyp/12.18.3/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/root/.cache/node-gyp/12.18.3',
gyp info spawn args   '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/root/.cache/node-gyp/12.18.3/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/workspace/node_modules/int64-napi',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/home/workspace/node_modules/int64-napi/build'
  CC(target) Release/obj.target/int64/src/int64.o
  SOLINK_MODULE(target) Release/obj.target/int64.node
  COPY Release/int64.node
[3/3] ⠠ rclnodejs
[-/3] ⠠ waiting...
verbose 74.418493883 gyp info it worked if it ends with ok
gyp info using node-gyp@5.1.0
gyp info using node@12.18.3 | linux | arm64
gyp info find Python using Python version 2.7.18 found at "/usr/bin/python2"
gyp info spawn /usr/bin/python2
gyp info spawn args [
gyp info spawn args   '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/home/workspace/node_modules/rclnodejs/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/root/.cache/node-gyp/12.18.3/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/root/.cache/node-gyp/12.18.3',
gyp info spawn args   '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/root/.cache/node-gyp/12.18.3/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/workspace/node_modules/rclnodejs',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/home/workspace/node_modules/rclnodejs/build'
  CXX(target) Release/obj.target/rclnodejs/src/addon.o
In file included from ../src/addon.cpp:15:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2294:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
 2294 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
In file included from ../../nan/nan.h:56,
                 from ../src/addon.cpp:15:
../src/addon.cpp: At global scope:
/root/.cache/node-gyp/12.18.3/include/node/node.h:608:43: warning: cast between incompatible function types from ‘void (*)(v8::Local<v8::Object>)’ to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
  608 |       (node::addon_register_func) (regfunc),                          \
      |                                           ^
/root/.cache/node-gyp/12.18.3/include/node/node.h:642:3: note: in expansion of macro ‘NODE_MODULE_X’
  642 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
      |   ^~~~~~~~~~~~~
../src/addon.cpp:83:1: note: in expansion of macro ‘NODE_MODULE’
   83 | NODE_MODULE(rclnodejs, InitModule);
      | ^~~~~~~~~~~
  CXX(target) Release/obj.target/rclnodejs/src/executor.o
In file included from ../src/rcl_handle.hpp:18,
                 from ../src/executor.hpp:25,
                 from ../src/executor.cpp:15:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2294:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
 2294 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
  CXX(target) Release/obj.target/rclnodejs/src/handle_manager.o
In file included from ../src/handle_manager.hpp:18,
                 from ../src/handle_manager.cpp:15:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2294:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
 2294 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
  CXX(target) Release/obj.target/rclnodejs/src/rcl_action_bindings.o
In file included from ../src/rcl_action_bindings.hpp:18,
                 from ../src/rcl_action_bindings.cpp:15:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2294:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
 2294 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
../src/rcl_action_bindings.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE rclnodejs::ActionProcessCancelRequest(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/rcl_action_bindings.cpp:632:36: warning: ignoring return value of ‘rcl_ret_t rcl_action_cancel_response_fini(rcl_action_cancel_response_t*)’, declared with attribute warn_unused_result [-Wunused-result]
  632 |     rcl_action_cancel_response_fini(cancel_response_ptr);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
  CXX(target) Release/obj.target/rclnodejs/src/rcl_bindings.o
In file included from ../src/rcl_bindings.hpp:18,
                 from ../src/rcl_bindings.cpp:15:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2294:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
 2294 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
../src/rcl_bindings.cpp: In function ‘std::unique_ptr<rmw_qos_profile_t> rclnodejs::GetQosProfileFromObject(v8::Local<v8::Object>)’:
../src/rcl_bindings.cpp:1198:26: warning: variable ‘currentContent’ set but not used [-Wunused-but-set-variable]
 1198 |   v8::Local<v8::Context> currentContent = Nan::GetCurrentContext();
      |                          ^~~~~~~~~~~~~~
  CXX(target) Release/obj.target/rclnodejs/src/rcl_handle.o
In file included from ../src/rcl_handle.hpp:18,
                 from ../src/rcl_handle.cpp:15:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2294:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
 2294 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
  CXX(target) Release/obj.target/rclnodejs/src/rcl_utilities.o
  CXX(target) Release/obj.target/rclnodejs/src/shadow_node.o
In file included from ../src/shadow_node.hpp:18,
                 from ../src/shadow_node.cpp:15:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2294:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
 2294 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
  SOLINK_MODULE(target) Release/obj.target/rclnodejs.node
  COPY Release/rclnodejs.node
[3/3] ⠄ rclnodejs
[-/3] ⠄ waiting...
verbose 98.581956056 Error: /home/workspace/node_modules/rclnodejs: Command failed.
Exit code: 139
Command: node scripts/generate_messages.js
Arguments: 
Directory: /home/workspace/node_modules/rclnodejs
Output:
Start JavaScript message generation...
Generation complete.
Segmentation fault (core dumped)
    at ProcessTermError.ExtendableBuiltin (/usr/lib/node_modules/yarn/lib/cli.js:721:66)
    at ProcessTermError.MessageError (/usr/lib/node_modules/yarn/lib/cli.js:750:123)
    at new ProcessTermError (/usr/lib/node_modules/yarn/lib/cli.js:790:113)
    at ChildProcess.<anonymous> (/usr/lib/node_modules/yarn/lib/cli.js:25884:17)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1021:16)
    at Socket.<anonymous> (internal/child_process.js:443:11)
    at Socket.emit (events.js:315:20)
    at Pipe.<anonymous> (net.js:674:12)
error /home/workspace/node_modules/rclnodejs: Command failed.
Exit code: 139
Command: node scripts/generate_messages.js
Arguments: 
Directory: /home/workspace/node_modules/rclnodejs
Output:
Start JavaScript message generation...
Generation complete.
ros2jsguy commented 4 years ago

That's helpful.

Start JavaScript message generation...
Generation complete.
Segmentation fault (core dumped)
    at ProcessTermError.ExtendableBuiltin (/usr/lib/node_modules/yarn/lib/cli.js:721:66)
    at ProcessTermError.MessageError (/usr/lib/node_modules/yarn/lib/cli.js:750:123)
    at new ProcessTermError (/usr/lib/node_modules/yarn/lib/cli.js:790:113)
    at ChildProcess.<anonymous> (/usr/lib/node_modules/yarn/lib/cli.js:25884:17)
    at ChildProcess.emit (events.js:315:20)
    at maybeClose (internal/child_process.js:1021:16)
    at Socket.<anonymous> (internal/child_process.js:443:11)
    at Socket.emit (events.js:315:20)
    at Pipe.<anonymous> (net.js:674:12)
error /home/workspace/node_modules/rclnodejs: Command failed.
Exit code: 139
Command: node scripts/generate_messages.js

I have seen this segfault issue on my mac workstation a few times but hard to replicate consistently. Please try uninstalling and then reinstalling rclnodejs. That has worked for me in such situations. Sorry you hit this glitch. We can look into this issue more closely.

sshmaxime commented 4 years ago

The thing is it's in a docker container. For the sake of dev purpose, every time it launch it yarn install. So it is re installing rclnodejs. And it keeps coming up. Actually, it did compile correctly one time when I build the first time with --verbose

ros2jsguy commented 4 years ago

@MaximeAubanel :( bummer this is blocking you. I'm trying to replicate and isolate the issue in my rclnodejs dev env now.

sshmaxime commented 4 years ago

Have you found anything interesting ?

ros2jsguy commented 4 years ago

Making progress. Had to setup lldb and llnode to get deep insight into the core dump. I have not isolated the issue fully yet but circling in. Will update as soon as I know something definitive.

ros2jsguy commented 4 years ago

I have a work-around (hack) that is working consistently in my testing. I'll submit a PR shortly.

sshmaxime commented 4 years ago

Thank you @ros2jsguy 🚀