Giter VIP home page Giter VIP logo

Comments (9)

bsrdjan avatar bsrdjan commented on September 17, 2024

new kind of error, did not have it before. Is it reproducible or happens randomly?
Which os release, nodejs and node-rfc version are used ? Can you share the script to reproduce ?

from node-rfc.

jaulz avatar jaulz commented on September 17, 2024

Unfortunately it is not reproducible... it just happens at some point. Now that I upgraded to NodeJS V7 the error above does not occur anymore but instead NodeJS simply stops with exit status 139 (i.e. segmentation fault). Could it be related to memory problems if too many RFCs are triggered?

from node-rfc.

bsrdjan avatar bsrdjan commented on September 17, 2024

looks more like a concurrency issue but that is just guessing. On which os platform / node-rfc release combination it happens?

from node-rfc.

jaulz avatar jaulz commented on September 17, 2024

That could be indeed a problem as I have two node-rfc instances I use in parallel. The problem occurs on Ubuntu 16.04 and the latest node-rfc from Github. Now I also got this error:

*** Error in `node': corrupted double-linked list: 0x00007fb410011ec0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7fb43b2417e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x7e6f8)[0x7fb43b2486f8]
/lib/x86_64-linux-gnu/libc.so.6(+0x800a8)[0x7fb43b24a0a8]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7fb43b24d98c]
/usr/sap/nwrfcsdk/lib/libsapnwrfc.so(+0x1d1598)[0x7fb438981598]
/usr/sap/nwrfcsdk/lib/libsapnwrfc.so(+0x1d8cae)[0x7fb438988cae]
/usr/sap/nwrfcsdk/lib/libsapnwrfc.so(+0x1e6bd2)[0x7fb438996bd2]
/usr/sap/nwrfcsdk/lib/libsapnwrfc.so(+0x14b850)[0x7fb4388fb850]
/usr/sap/nwrfcsdk/lib/libsapnwrfc.so(+0x7b80d)[0x7fb43882b80d]
/usr/sap/nwrfcsdk/lib/libsapnwrfc.so(+0x85cd0)[0x7fb438835cd0]
/usr/sap/nwrfcsdk/lib/libsapnwrfc.so(RfcCloseConnection+0x4a)[0x7fb4387ff53a]
/opt/node-rfc/build/Release/rfc.node(_ZN6ClientD2Ev+0x43)[0x7fb438fbf753]
/opt/node-rfc/build/Release/rfc.node(_ZN6ClientD0Ev+0x11)[0x7fb438fbf811]
node(_ZN2v88internal13GlobalHandles31DispatchPendingPhantomCallbacksEb+0x109)[0xe63699]
...

from node-rfc.

bsrdjan avatar bsrdjan commented on September 17, 2024

The node-rfc supports concurrent connections in a single nodejs instance, with multiple calls per connection in parallel. Based on the log I am not sure what the cause could be.

I tried to reproduce on Ubuntu 16.04 using the new unit test in dev branch and got no errors.

It opens 10 concurrent connections and starts 100 calls in parallel, in each connection.

Could you please try to reproduce on your system using the script from the unit test ? If no error occurs, could you please try reproduce using similar test script and upload the script ?

Which sapnwrfc lib are you using ? The output of:

var rfc = require('./build/rfc/rfc.node');
var c = new rfc.Client({})
console.log(c.getVersion());

from node-rfc.

koemaeda avatar koemaeda commented on September 17, 2024

I've managed to reproduce this error somehow.
If I call client.ping() while an RFC call is underway, I get the "segmentation fault" error.

I found this trying to reuse a client connection. I was testing if it was still alive by pinging the server.
(Yes, I know the documentation says it's not supposed to be used like that...)

Anyway, here's a simple script to reproduce the error:

var rfc = require('node-rfc');

var abapSystem = {
  user: '...',
  passwd: '...',
  ashost: '...',
  sysnr: '00',
  client: '400'
};

var rfcClient = new rfc.Client(abapSystem);

console.log('RFC Client is connecting...');
rfcClient.connect(function(err) {
  if (err)
    return console.error('(rfc.Client) Could not connect to server', err);
  console.log('RFC Client is connected.');
  
  setInterval(function() {
    console.log('ping');
    rfcClient.ping(); // <---- THIS is what causes the segmentation fault
  }, 100);

  console.log('Calling RFC function...');

  rfcClient.invoke('RFC_SYSTEM_INFO', {}, (rfcErr, rfcRes) => {
    if (rfcErr)
      return console.error('Error invoking RFC_SYSTEM_INFO:', rfcErr);
    console.log('Result from RFC_SYSTEM_INFO:', rfcRes);
  });
});

OS: Windows 7 Professional x64
Node: v6.10.3
NW RFC SDK: [ 7210, 0, 42 ]

from node-rfc.

bsrdjan avatar bsrdjan commented on September 17, 2024

reproduced on Windows and Linux, sometimes segfault, sometimes gets stalled:

var binary = require('node-pre-gyp');
var path = require('path');
var rfcPath = binary.find(path.resolve(path.join(__dirname,'../package.json')));
console.log('rfc path:', rfcPath);
var rfc = require(rfcPath);

var abapSystem = {
  user: 'DEMO    ',
  passwd: 'welcome',
  ashost: '10.68.104.164',
  sysnr: '00',
  client: '620',
//  trace: '3',
  lang: 'EN'
};

var rfcClient = new rfc.Client(abapSystem);

console.log('rfcClient:', rfcClient.getVersion());

console.log('RFC Client is connecting...');
rfcClient.connect(function(err) {
  if (err)
    return console.error('(rfc.Client) Could not connect to server', err);
  console.log('RFC Client is connected.');

  setInterval(function() {
    console.log('ping');
    rfcClient.ping(); // <---- THIS is what causes the segmentation fault
  }, 100);


  setInterval(function() {
    console.log('Calling RFC function...');
    rfcClient.invoke('BAPI_USER_GET_DETAIL', {USERNAME: 'DEMO'}, (rfcErr, rfcRes) => {
    //rfcClient.invoke('RFC_SYSTEM_INFO', {}, (rfcErr, rfcRes) => {
      if (rfcErr)
        return console.error('Error invoking function:', rfcErr);
      console.log('Result from RFC function:', rfcRes);
    });}, 2000);
});

from node-rfc.

atsjj avatar atsjj commented on September 17, 2024

I'm having segfault issues as well in our app.

I'm not going to bother with posting my code, it's very similar to that of @bsrdjan.

from node-rfc.

bsrdjan avatar bsrdjan commented on September 17, 2024

Fixed in NAPI, with async ping.

from node-rfc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.