0

I am running node-red on a Yocto Linux System (Processor: Intel Quark® x1020 400 MHz).

My application includes a S7-Node (node-red-contrib-s7) to read out values of a PLC (this is currently a test value which changes every 15sec from true to false and vice versa). An OPCUA-Server-Node (node-red-contrib-opcua) is initialized with the creation of a Boolean-variable and creates an OPCUA-Server to further read out the Data via OPC protocol. An OPC-Client writes the incoming true/false values from the PLC to the OPCUA-Server.

After an unspecified time period (approx. 20-40 min) node-red crashes.

Welcome to Node-RED
===================

22 Jun 07:53:37 - [info] Node-RED version: v0.15.2
22 Jun 07:53:37 - [info] Node.js  version: v6.9.2
22 Jun 07:53:37 - [info] Linux 4.4.18-yocto-standard ia32 LE
22 Jun 07:53:52 - [info] Loading palette nodes
22 Jun 07:55:13 - [info] Dashboard version 2.1.0 started at /ui
22 Jun 07:55:14 - [warn] ------------------------------------------------------
22 Jun 07:55:14 - [warn] [rpi-gpio] Info : Ignoring Raspberry Pi specific node
22 Jun 07:55:14 - [warn] ------------------------------------------------------
22 Jun 07:55:14 - [info] Settings file  : /home/root/.node-red/settings.js
22 Jun 07:55:14 - [info] User directory : /home/root/.node-red
22 Jun 07:55:14 - [info] Flows file     : /home/root/.node-red/flows_iot2000.json
22 Jun 07:55:15 - [info] Server now running at http://127.0.0.1:1880/
22 Jun 07:55:15 - [debug] red/runtime/nodes/credentials.load : no user key present
22 Jun 07:55:15 - [debug] red/runtime/nodes/credentials.load : using default key
22 Jun 07:55:15 - [info] Starting flows
22 Jun 07:55:35 - [info] Started flows
22 Jun 07:55:36 - [info] [debug:9e445757.340408]
{ opcuaCommand: 'addVariable' }
22 Jun 07:56:39 - [info] [debug:7f92b9a0.ab1b8] true
22 Jun 07:56:39 - [error] [OpcUa-Client:WRITE ] WRITE  OPC UA connection error: connect ECONNREFUSED 127.0.0.1:53880
22 Jun 07:56:39 - [info] [OpcUa-Client:WRITE ] TESTLOG: RESET CLIENT NACH CONNECTION ERROR
 Bad Session in  _on_ActivateSessionRequest 030691667bf38f6e20b540681a3c7a3e
22 Jun 07:57:29 - [error] [s7 endpoint:ac2f8250.edec] Failure (Bad values)
22 Jun 07:57:31 - [info] [debug:7f92b9a0.ab1b8] false
22 Jun 07:57:37 - [info] [debug:7f92b9a0.ab1b8] true
 Timeout .... waiting for response for  OpenSecureChannelRequest { /*RequestHeader*/
 authenticationToken           /* NodeId                           */: ns=0;i=0
 timeStamp                     /* UtcTime                          */: 2017-06-22T07:56:39.362Z
 requestHandle                 /* IntegerId                        */: 1               0x1
 returnDiagnostics             /* UInt32                           */: 0               0x0
 auditEntryId                  /* UAString                         */: null
 timeoutHint                   /* UInt32                           */: 0               0x0
 additionalHeader              /* ExtensionObject                  */: null
};
 Timeout .... waiting for response for  CloseSecureChannelRequest { /*RequestHeader*/
 authenticationToken           /* NodeId                           */: ns=0;i=0
 timeStamp                     /* UtcTime                          */: 2017-06-22T07:56:39.667Z
 requestHandle                 /* IntegerId                        */: 2               0x2
 returnDiagnostics             /* UInt32                           */: 0               0x0
 auditEntryId                  /* UAString                         */:
 timeoutHint                   /* UInt32                           */: 0               0x0
 additionalHeader              /* ExtensionObject                  */: null
};
22 Jun 07:57:43 - [error] [s7 endpoint:ac2f8250.edec] Failure (Bad values)
22 Jun 07:57:43 - [error] [OpcUa-Client:WRITE ] WRITE  OPC UA connection error: Transaction has timed out
22 Jun 07:57:43 - [info] [OpcUa-Client:WRITE ] TESTLOG: RESET CLIENT NACH CONNECTION ERROR
22 Jun 07:57:56 - [info] [debug:7f92b9a0.ab1b8] false
22 Jun 07:58:06 - [info] [debug:9e445757.340408]
{ opcuaCommand: 'addVariable' }
22 Jun 07:58:08 - [info] [debug:7f92b9a0.ab1b8] true
22 Jun 07:58:23 - [info] [debug:7f92b9a0.ab1b8] false
22 Jun 07:58:39 - [info] [debug:7f92b9a0.ab1b8] true
22 Jun 07:58:55 - [info] [debug:7f92b9a0.ab1b8] false
22 Jun 07:59:10 - [info] [debug:7f92b9a0.ab1b8] true
...
...
...
22 Jun 08:17:57 - [info] [debug:7f92b9a0.ab1b8] true
22 Jun 08:18:13 - [info] [debug:7f92b9a0.ab1b8] false
22 Jun 08:18:28 - [info] [debug:7f92b9a0.ab1b8] true
22 Jun 08:18:44 - [info] [debug:7f92b9a0.ab1b8] false
22 Jun 08:18:59 - [info] [debug:7f92b9a0.ab1b8] true


#
# Fatal error in , line 0
# unreachable code
#

==== C stack trace ===============================

 1: V8_Fatal
 2: 0x891e307
 3: v8::internal::LCodeGenBase::GenerateBody()
 4: v8::internal::LCodeGen::GenerateCode()
 5: v8::internal::LChunk::Codegen()
 6: v8::internal::OptimizedCompileJob::GenerateCode()
 7: v8::internal::Compiler::FinalizeOptimizedCompileJob(v8::internal::OptimizedCompileJob*)
 8: v8::internal::OptimizingCompileDispatcher::InstallOptimizedFunctions()
 9: v8::internal::StackGuard::HandleInterrupts()
10: v8::internal::Runtime_StackGuard(int, v8::internal::Object**, v8::internal::Isolate*)
11: 0x3dd0a07e
12: 0x3c43c8df
13: 0x3dd1fd9e
14: 0x3dd1bd23
15: 0x85da06a
16: v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*)
17: v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*)
18: v8::Function::Call(v8::Local<v8::Value>, int, v8::Local<v8::Value>*)
19: node::AsyncWrap::MakeCallback(v8::Local<v8::Function>, int, v8::Local<v8::Value>*)
20: 0x89a5cbb
21: 0x89f1d30
22: uv_run
23: node::Start(int, char**)
24: main
25: __libc_start_main
Illegal instruction

I want to understand why node crashes randomly. Can anybody help?

hardillb
  • 54,545
  • 11
  • 67
  • 105
scsi1042
  • 1
  • 2

1 Answers1

0

The Illigal instruction error implies that the JIT compiler in the version of node.js you have has generated an instruction that is not available on Intel Quark processor you are using.

Your best bet is to make sure the system is properly set up to generate a full core file at the time of failure and then raise an issue against the node.js project here

hardillb
  • 54,545
  • 11
  • 67
  • 105
  • So would you exclude that this error is due to the usage of node-red but rather a system related error? How can a full core file be generated? – scsi1042 Jun 23 '17 at 06:58
  • An interpreted language should never be able to cause a runtime to crash, especially not like this. Core file creation is normally controlled by the ulimits of the current shell I suggest you explore what defaults you have set – hardillb Jun 23 '17 at 07:31
  • This is a bit strange to me. Since there are no crashs when I only use s7 node for instance. When I run an OPC UA Server, it crashes. Consequently, I see this node as the initial cause of this issue. Can the program (and its opcua node) cause an issue which as a consequence leads to the illegal instruction? – scsi1042 Jun 23 '17 at 12:42
  • Yes, but the failure is in the native code generated by the JIT, it may possibly from that node (but that is not a given how modern JIT compilation works), this is still a failure in the V8 engine not the JavaScript code, so the place to fix this is in V8/NodeJS – hardillb Jun 23 '17 at 12:47
  • I just created the core file which has a size of about 160 MB. What exactly will be needed concerning the core file? – scsi1042 Jun 23 '17 at 15:20
  • No idea, open a bug with nodejs and ask them – hardillb Jun 23 '17 at 15:30