Open mStirner opened 1 month ago
Forget to mention, i used a patched version of "raw-socket", since it currently does not work in worker threads: https://github.com/nospaceships/node-raw-socket/issues/89
diff --git a/src/raw.cc b/src/raw.cc
index b8e4850..b8f50e5 100644
--- a/src/raw.cc
+++ b/src/raw.cc
@@ -52,7 +52,9 @@ void InitAll (Local<Object> exports) {
SocketWrap::Init (exports);
}
-NODE_MODULE(raw, InitAll)
+// see #89
+//NODE_MODULE(raw, InitAll)
+NAN_MODULE_WORKER_ENABLED(raw, InitAll)
NAN_METHOD(CreateChecksum) {
Nan::HandleScope scope;
Patched version: raw.node.tar.gz
Speicherzugriffsfehler
This means segmentation fault, right.
Where is the error you mentioned in the title?
Speicherzugriffsfehler
This means segmentation fault, right.
Not sure what the exact translation is, but "Speicherzugriffsfehler" is loose translated to "Memory access error". There is no other error message than "Speicherzugriffsfehler". Thats all that is printed on the console.
I created a native add-on (to debug this issue) that prints the capabilities of the executable: https://stackoverflow.com/q/78496672/5781499
Event when there are some set on the /usr/bin/node
, they are not correctly inherited to child processes.
Node.js Version
v20.11.0
NPM Version
v10.5.1
Operating System
Linux workstation 6.5.0-28-generic #29-Ubuntu SMP PREEMPT_DYNAMIC Thu Mar 28 23:46:48 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
worker_threads
Description
Main thread, do not pass capabilities to worker threads. Setted capabilities on the node.js executable: E.g.:
Results in the worker who needs them in a "memory access error".
Minimal Reproduction
For the example above a the module "raw-socket" is used to create raw network sockets to send icmp ping messages. When used used with the argument
--direct
the script creates directly a raw socket. Without it, it spawns a worker thread and trys to create the raw socket in the worker thread, which results in the error described above.Output
sudo /usr/bin/node test.js
sudo /usr/bin/node test.js --direct
Before You Submit