SAP / node-rfc

Asynchronous, non-blocking SAP NW RFC SDK bindings for Node.js
Apache License 2.0
251 stars 73 forks source link

Nodejs terminate itself after client called RFC #189

Closed valix999 closed 2 years ago

valix999 commented 3 years ago

image

I found a problem with calling RFC that returns more than 1,200 records and makes the application terminate itself with no error log or any exception. As from the image parameter "IM_LIMIT_BRANCH" will limit the amount of returned records (my return records are "ET_BRANCH"). Are there any missing configs from my node-rfc client?

bsrdjan commented 3 years ago

Need more info on your node-rfc environment. Could you please run the following command in your node project root folder and post the output:

node -p "require('node-rfc').environment" 
valix999 commented 3 years ago

Need more info on your node-rfc environment. Could you please run the following command in your node project root folder and post the output:

node -p "require('node-rfc').environment" 

image

here are my node-rfc environment

bsrdjan commented 3 years ago

The termination is the most likely related to one known bug in SAP NWRFC SDK PL7, causing accidental overwrite of RAM beyond string buffer boundaries.

Do you have the older SDK version at hand, like PL6, please try with that one.

Otherwise, please create a SAP standard support message for the BC-MID-RFC-SDK component, refer to this issue and request the preliminary shipment of the PL8 patch.

valix999 commented 3 years ago

Where can I find the PL6 SDK version, currently I follow this note (https://launchpad.support.sap.com/#/notes/2573790) and found only the PL7 version

bsrdjan commented 3 years ago

Only the latest SDK version is available, the PL7. The PL6 and older versions are not available.

valix999 commented 3 years ago

Do you have the release date of the PL8 version?

bsrdjan commented 3 years ago

This workaround should help with PL7 in the meantime.

Unpack the zip or tar archive and copy the sqpnwrfc.node to node-rfc\lib\binding folder:

node-rfc-v2.3.1-napi-v7-win32-x64.tar.gz

node-rfc-v2.3.1-napi-v7-win32-x64.zip

valix999 commented 3 years ago

I'm using new sqpnwrfc.node but it's still not working

bsrdjan commented 3 years ago

It could be a different error than and need some more info.

Could you please post your test script and the full console log, starting with the test script invocation and including any output, like:

C:>\test\node test.js

Did it work with older NWRFC SDK and which logon language is used ?

Does the function module works correctly in ABAP, with more than 1,200 records? You can test the ABAP remote function module in ABAP system, using test transaction SE37.

Can you reproduce the issue by calling ABAP standard remote function module or BAPI, not Z-module? Example with the module available in standard SAP system would help me locally reproduce and investigate.

You can also activate the remote ABAP debugging and run the node test script. When the ABAP debugger shows up, you can stop before the RETURN statement and check if ABAP processing completed and if all records are there.

bsrdjan commented 3 years ago

The test with the PL6 or PL8 is not necessary because the workaround we already tried did not help.

Before we close the support ticket 834664 / 2020, could you please update the ticket with the logon data, so that I can check the ZHHRC_INF_REF_DATA by myself? You could also prepare one test case in SE37, working with more than 1,200 records.

valix999 commented 3 years ago

The results in SE37 are working correctly with more than 1,200 records. But the system refers to the incident is not where RFC - ZHHRC_INF_REF_DATA exists. If I cannot find any solution, then I will re-open the incident again with another account. Thank you.

bsrdjan commented 3 years ago

Thank you @valix999, I think that would be fastest/easiest way, if I can check directly by myself.

Please write in that new incident that it is created only to get the system access, for processing this GitHub issue (insert the url).

After the incident is created, please let me know also which input data to use for testing, to return more than 1,200 records.

gimapei commented 3 years ago

could you check below.

  1. edit your node-rfc source. nwrfcsdk.cc . find wrapString function . find free((char*)utf8) and delete line
  2. recompile npm run addon
  3. run your code.
romankis95 commented 3 years ago

Same problem happens to when calling "RFC_READ_TABLE" on CAUFV table with this filter "FTRMI >='20210317" it return in average 15 records. Sometimes Nodejs terminate itself, no error message,

it happens 100% of times if returned records are 0;

No error occurred when reading full tables with 25k or more records.

gimapei commented 3 years ago

Same problem happens to when calling "RFC_READ_TABLE" on CAUFV table with this filter "FTRMI >='20210317" it return in average 15 records. Sometimes Nodejs terminate itself, no error message,

it happens 100% of times if returned records are 0;

No error occurred when reading full tables with 25k or more records.

could you tell me your environments. I had no problem with v2.4.0 and pl7

romankis95 commented 3 years ago

{ platform: { name: 'win32', arch: 'x64', release: '10.0.19042' }, env: { SAPNWRFC_HOME: 'C:\\nwrfcsdk', RFC_INI: '', nwrfcsdk_lib_on_path: true }, versions: { node: '14.16.0', v8: '8.4.371.19-node.18', uv: '1.40.0', zlib: '1.2.11', brotli: '1.0.9', ares: '1.16.1', modules: '83', nghttp2: '1.41.0', napi: '7', llhttp: '2.1.3', openssl: '1.1.1j', cldr: '37.0', icu: '67.1', tz: '2020a', unicode: '13.0' }, noderfc: { version: '2.4.0', nwrfcsdk: { major: 7500, minor: 0, patchLevel: 7 } } }

gimapei commented 3 years ago

{ platform: { name: 'win32', arch: 'x64', release: '10.0.19042' }, env: { SAPNWRFC_HOME: 'C:\\nwrfcsdk', RFC_INI: '', nwrfcsdk_lib_on_path: true }, versions: { node: '14.16.0', v8: '8.4.371.19-node.18', uv: '1.40.0', zlib: '1.2.11', brotli: '1.0.9', ares: '1.16.1', modules: '83', nghttp2: '1.41.0', napi: '7', llhttp: '2.1.3', openssl: '1.1.1j', cldr: '37.0', icu: '67.1', tz: '2020a', unicode: '13.0' }, noderfc: { version: '2.4.0', nwrfcsdk: { major: 7500, minor: 0, patchLevel: 7 } } }

In my case with 2.2.0 I had a similar problem. The problem was solved when I dis the following.

  1. get the source code
  2. edit your node-rfc source. nwrfcsdk.cc . find wrapString function . find free((char*)utf8) and delete line
  3. recompile npm run addon run your code.

test it if you have time.

romankis95 commented 3 years ago

{ platform: { name: 'win32', arch: 'x64', release: '10.0.19042' }, env: { SAPNWRFC_HOME: 'C:\\nwrfcsdk', RFC_INI: '', nwrfcsdk_lib_on_path: true }, versions: { node: '14.16.0', v8: '8.4.371.19-node.18', uv: '1.40.0', zlib: '1.2.11', brotli: '1.0.9', ares: '1.16.1', modules: '83', nghttp2: '1.41.0', napi: '7', llhttp: '2.1.3', openssl: '1.1.1j', cldr: '37.0', icu: '67.1', tz: '2020a', unicode: '13.0' }, noderfc: { version: '2.4.0', nwrfcsdk: { major: 7500, minor: 0, patchLevel: 7 } } }

In my case with 2.2.0 I had a similar problem. The problem was solved when I dis the following.

  1. get the source code
  2. edit your node-rfc source. nwrfcsdk.cc . find wrapString function . find free((char*)utf8) and delete line
  3. recompile npm run addon run your code.

test it if you have time.

for some reasons i get an error while running npm run addon

gimapei commented 3 years ago

{ platform: { name: 'win32', arch: 'x64', release: '10.0.19042' }, env: { SAPNWRFC_HOME: 'C:\\nwrfcsdk', RFC_INI: '', nwrfcsdk_lib_on_path: true }, versions: { node: '14.16.0', v8: '8.4.371.19-node.18', uv: '1.40.0', zlib: '1.2.11', brotli: '1.0.9', ares: '1.16.1', modules: '83', nghttp2: '1.41.0', napi: '7', llhttp: '2.1.3', openssl: '1.1.1j', cldr: '37.0', icu: '67.1', tz: '2020a', unicode: '13.0' }, noderfc: { version: '2.4.0', nwrfcsdk: { major: 7500, minor: 0, patchLevel: 7 } } }

In my case with 2.2.0 I had a similar problem. The problem was solved when I dis the following.

  1. get the source code
  2. edit your node-rfc source. nwrfcsdk.cc . find wrapString function . find free((char*)utf8) and delete line
  3. recompile npm run addon run your code.

test it if you have time.

for some reasons i get an error while running npm run addon

test this.

  1. download and unzip
  2. replace this file to node_modules/node-rfc/lib/binding
  3. test your code

sapnwrfc.zip

romankis95 commented 3 years ago

test this.

  1. download and unzip
  2. replace this file to node_modules/node-rfc/lib/binding
  3. test your code

sapnwrfc.zip

Nothing, same error.

gimapei commented 3 years ago

hmm.

could you try node-rfc version 1.2.0

2021년 3월 18일 (목) 17:51, Roman Kis @.***>님이 작성:

test this.

  1. download and unzip
  2. replace this file to node_modules/node-rfc/lib/binding
  3. test your code

sapnwrfc.zip https://github.com/SAP/node-rfc/files/6162514/sapnwrfc.zip

Nothing, same error.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/SAP/node-rfc/issues/189#issuecomment-801745627, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKW64ODP53HYILS3DOXRL3TEG5KDANCNFSM4UHMTP4A .

romankis95 commented 3 years ago

hmm. could you try node-rfc version 1.2.0 2021년 3월 18일 (목) 17:51, Roman Kis @.***>님이 작성: test this. 1. download and unzip 2. replace this file to node_modules/node-rfc/lib/binding 3. test your code sapnwrfc.zip https://github.com/SAP/node-rfc/files/6162514/sapnwrfc.zip Nothing, same error. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#189 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKW64ODP53HYILS3DOXRL3TEG5KDANCNFSM4UHMTP4A .

1.2.0 is not compatible with my node v14 (it throws an exception), i tried any other library version still app crashes when calling "RFC_READ_TABLE"

gimapei commented 3 years ago

if you can using other nodejs. you can change the node version to 12.x versing. using 'n' lib

  1. npm i -g n 2, n 12 or other version
  2. node -v

.. I think it would be better to build a debug environment.

bsrdjan commented 3 years ago

@gimapei, @CrownKingClown, could you please share the source code of the script used in this test?

I would like to reproduce and investigate:

"RFC_READ_TABLE" on CAUFV table with this filter "FTRMI >='20210317" it return in average 15 records. Sometimes Nodejs terminate itself, no error message,

it happens 100% of times if returned records are 0;

No error occurred when reading full tables with 25k or more records.

romankis95 commented 3 years ago

` router.post("/caufv", function (req, res) { const pool = new noderfc.Pool({ connectionParameters: { dest: "MME" } }); (async () => { try { const client = await pool.acquire(); var today = moment().format("YYYYMMDD"); var querysap = "FTRMI >= " + "'" + today + "'";

        client.invoke('RFC_READ_TABLE', {
                QUERY_TABLE: 'CAUFV',
                FIELDS: [{
                        FIELDNAME: "AUFNR", //Ordine                000001154730
                    },
                    {
                        FIELDNAME: "OBJNR", //OBJect id             OR000001154730
                    },
                    {
                        FIELDNAME: "GLTRP", //Data fine cardine 20210203
                    },
                    {
                        FIELDNAME: "GSTRP", //Data inizio cardine 20210128
                    },
                    {
                        FIELDNAME: "RSNUM", //Impegno               0069059068
                    },
                    {
                        FIELDNAME: "PLNBEZ", //Materiale            M74.008400.01
                    },
                    {
                        FIELDNAME: "FTRMI", //Data rilascio eff.    20210128
                    },
                    {
                        FIELDNAME: "PLNNR", //Gruppo cicli      MOT_1030
                    },
                    {
                        FIELDNAME: "GAMNG", //Quantità teorica  600.000
                    },
                    {
                        FIELDNAME: "GMEIN", //Unità di misura       ST (PZ)
                    },
                    {
                        FIELDNAME: "STLNR", //Distinta base     00001069
                    },
                    {
                        FIELDNAME: "DISPO", //Responsabile MRP  M02
                    },
                ],
                DELIMITER: "|",
                OPTIONS: [{
                    "TEXT": querysap 
                }]
            },
            async function (err, dati) {
                if (err) {
                    res.send(err);
                } else {
                    res.send(dati)
                }
            });
    } catch (err) {
        res.send(err);
    }
})();

});`

bsrdjan commented 3 years ago

Hi,

just tested on Windows and Darwin and got no errors. Could you please test with the latest node-rfc and NWRFC SDK ?

If the termination still occur, does it look like a timeout (how long it takes?) and is there any message?

Environment

  noderfc: {
    version: '2.4.1',
    nwrfcsdk: { major: 7500, minor: 0, patchLevel: 8 }
  }

Test script

const addon = require("node-rfc");

// client
const abapSystem = { dest: "MME" },
    client = new addon.Client(abapSystem);

// query
const today = "20210428",
    querysap = "FTRMI >= " + "'" + today + "'";

console.log(client.environment);
(async () => {
    try {
        await client.open();

        //console.log(client.connectionInfo);
        const res = await client.call("RFC_READ_TABLE", {
            QUERY_TABLE: "CAUFV",
            FIELDS: [
                {
                    FIELDNAME: "AUFNR", //Ordine                000001154730
                },

                {
                    FIELDNAME: "OBJNR", //OBJect id             OR000001154730
                },

                {
                    FIELDNAME: "GLTRP", //Data fine cardine 20210203
                },

                {
                    FIELDNAME: "GSTRP", //Data inizio cardine 20210128
                },

                {
                    FIELDNAME: "RSNUM", //Impegno               0069059068
                },

                {
                    FIELDNAME: "PLNBEZ", //Materiale            M74.008400.01
                },

                {
                    FIELDNAME: "FTRMI", //Data rilascio eff.    20210128
                },

                {
                    FIELDNAME: "PLNNR", //Gruppo cicli      MOT_1030
                },

                {
                    FIELDNAME: "GAMNG", //Quantità teorica  600.000
                },

                {
                    FIELDNAME: "GMEIN", //Unità di misura       ST (PZ)
                },

                {
                    FIELDNAME: "STLNR", //Distinta base     00001069
                },

                {
                    FIELDNAME: "DISPO", //Responsabile MRP  M02
                },
            ],
            DELIMITER: "|",
            OPTIONS: [
                {
                    TEXT: querysap,
                },
            ],
        });
        console.log(res);
    } catch (ex) {
        console.log(ex);
    }
})();

Output

{
  DELIMITER: '|',
  NO_DATA: '',
  QUERY_TABLE: 'CAUFV',
  ROWCOUNT: 0,
  ROWSKIPS: 0,
  DATA: [],
  FIELDS: [
    {
      FIELDNAME: 'AUFNR',
      OFFSET: '000000',
      LENGTH: '000012',
      TYPE: 'C',
      FIELDTEXT: 'Order Number'
    },
    {
      FIELDNAME: 'OBJNR',
      OFFSET: '000013',
      LENGTH: '000022',
      TYPE: 'C',
      FIELDTEXT: 'Object number'
    },
    {
      FIELDNAME: 'GLTRP',
      OFFSET: '000036',
      LENGTH: '000008',
      TYPE: 'D',
      FIELDTEXT: 'Basic finish date'
    },
    {
      FIELDNAME: 'GSTRP',
      OFFSET: '000045',
      LENGTH: '000008',
      TYPE: 'D',
      FIELDTEXT: 'Basic Start Date'
    },
    {
      FIELDNAME: 'RSNUM',
      OFFSET: '000054',
      LENGTH: '000010',
      TYPE: 'N',
      FIELDTEXT: 'Number of reservation/dependent requirements'
    },
    {
      FIELDNAME: 'PLNBEZ',
      OFFSET: '000065',
      LENGTH: '000018',
      TYPE: 'C',
      FIELDTEXT: 'Material Number'
    },
    {
      FIELDNAME: 'FTRMI',
      OFFSET: '000084',
      LENGTH: '000008',
      TYPE: 'D',
      FIELDTEXT: 'Actual release date'
    },
    {
      FIELDNAME: 'PLNNR',
      OFFSET: '000093',
      LENGTH: '000008',
      TYPE: 'C',
      FIELDTEXT: 'Key for Task List Group'
    },
    {
      FIELDNAME: 'GAMNG',
      OFFSET: '000102',
      LENGTH: '000013',
      TYPE: 'P',
      FIELDTEXT: 'Total order quantity'
    },
    {
      FIELDNAME: 'GMEIN',
      OFFSET: '000116',
      LENGTH: '000003',
      TYPE: 'C',
      FIELDTEXT: 'Base Unit of Measure'
    },
    {
      FIELDNAME: 'STLNR',
      OFFSET: '000120',
      LENGTH: '000008',
      TYPE: 'C',
      FIELDTEXT: 'Bill of material'
    },
    {
      FIELDNAME: 'DISPO',
      OFFSET: '000129',
      LENGTH: '000003',
      TYPE: 'C',
      FIELDTEXT: 'MRP controller for the order'
    }
  ],
  OPTIONS: [ { TEXT: "FTRMI >= '20210428'" } ]
}

Kind regards, srdjan

rbhuva commented 3 years ago

Hi,

I am also facing the same issue with "RFC_READ_TABLE".

Node.js process terminates after reading 10000 data. I am getting data in chunks of 2000 so, after 10 RFC call to RFC_READ_TABLE it terminates.

I tested it with different node-rfc version but still i got the same error after fetching 10000 record.

Error:

exited with code [3221226356] via signal [SIGINT].

It seems there is an issue with memory allocation.

My Runtime:

{ platform: { name: 'win32', arch: 'x64', release: '10.0.19041' }, env: { SAPNWRFC_HOME: 'C:\nwrfcsdk', RFC_INI: '', nwrfcsdk_lib_on_path: true }, versions: { node: '12.18.4', v8: '7.8.279.23-node.39', uv: '1.38.0', zlib: '1.2.11', brotli: '1.0.7', ares: '1.16.0', modules: '72', nghttp2: '1.41.0', napi: '6', llhttp: '2.1.2', http_parser: '2.9.3', openssl: '1.1.1g', cldr: '37.0', icu: '67.1', tz: '2019c', unicode: '13.0' }, noderfc: { version: '2.4.0', nwrfcsdk: { major: 7500, minor: 0, patchLevel: 8 } } }

Thanks, Rajdeep Bhuva

bsrdjan commented 3 years ago

@rbhuva, need a test script to try to reproduce the issue. Please consider that using RFC_READ_TABLE is not recommended and the priority of processing related issues is lower.

rbhuva commented 2 years ago

Hi @bsrdjan, Thanks for your comments.

To reproduce the issue, you can execute test_script attached

test_script.txt here.

Thanks, Rajdeep Bhuva

rbhuva commented 2 years ago

Hi @bsrdjan,

Please find below trace logs that appeared when the application is crashed.

Logs:- [APP/PROC/WEB.0] Error in `node': double free or corruption (fasttop): 0x0000000005087810 07:58:23.721: [APP/PROC/WEB.0] ======= Backtrace: ========= 07:58:23.721: [APP/PROC/WEB.0] /lib/x86_64-linux-gnu/libc.so.6(+0x70bfb)[0x7f03022ccbfb] 07:58:23.721: [APP/PROC/WEB.0] /lib/x86_64-linux-gnu/libc.so.6(+0x76fc6)[0x7f03022d2fc6] 07:58:23.721: [APP/PROC/WEB.0] /lib/x86_64-linux-gnu/libc.so.6(+0x7780e)[0x7f03022d380e] 07:58:23.721: [APP/PROC/WEB.0] /usr/src/app/node_modules/node-rfc/lib/binding/sapnwrfc.node(_ZN8node_rfc4PoolD2Ev+0xd3)[0x7f02fb5d2db3] 07:58:23.721: [APP/PROC/WEB.0] /usr/src/app/node_modules/node-rfc/lib/binding/sapnwrfc.node(_ZN4Napi10ObjectWrapIN8node_rfc4PoolEE16FinalizeCallbackEP10napi_envPvS6_+0x4b)[0x7f02fb5d8a7b] 07:58:23.721: [APP/PROC/WEB.0] node(_ZN4node13CallbackQueueIvJPNS_11EnvironmentEEE12CallbackImplIZN15node_napi_env__13CallFinalizerEPFvP10napi_envPvS8_ES8_S8_EUlS2_EE4CallES2+0x6b)[0x9f083b] 07:58:23.721: [APP/PROC/WEB.0] node(_ZN4node11Environment27RunAndClearNativeImmediatesEb+0x186)[0x9bbdb6] 07:58:23.721: [APP/PROC/WEB.0] node(_ZN4node11Environment14CheckImmediateEP10uv_check_s+0x72)[0x9bc412] 07:58:23.721: [APP/PROC/WEB.0] node[0x137be3c] 07:58:23.721: [APP/PROC/WEB.0] node(uv_run+0x12f)[0x137432f] 07:58:23.721: [APP/PROC/WEB.0] node(_ZN4node16NodeMainInstance3RunEv+0x1f6)[0xa5d726] 07:58:23.721: [APP/PROC/WEB.0] node(_ZN4node5StartEiPPc+0x2ac)[0x9eab6c] 07:58:23.721: [APP/PROC/WEB.0] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1)[0x7f030227c2e1] 07:58:23.721: [APP/PROC/WEB.0] node[0x982005] 07:58:23.721: [APP/PROC/WEB.0] ======= Memory map: ======== 07:58:23.721: [APP/PROC/WEB.0] 00400000-02ab6000 r-xp 00000000 07:00 2686016 /usr/local/bin/node 07:58:23.721: [APP/PROC/WEB.0] 02cb5000-02cb8000 r--p 026b5000 07:00 2686016 /usr/local/bin/node 07:58:23.721: [APP/PROC/WEB.0] 02cb8000-02cc9000 rw-p 026b8000 07:00 2686016 /usr/local/bin/node 07:58:23.721: [APP/PROC/WEB.0] 02cc9000-02ce9000 rw-p 00000000 00:00 0 07:58:23.721: [APP/PROC/WEB.0] 04caf000-05100000 rw-p 00000000 00:00 0 [heap] 07:58:23.721: [APP/PROC/WEB.0] 276ee80000-276eec0000 ---p 00000000 00:00 0 07:58:23.721: [APP/PROC/WEB.0] 5dd0a00000-5dd0a40000 ---p 00000000 00:00 0 07:58:23.721: [APP/PROC/WEB.0] 903cd40000-903cd80000 ---p 00000000 00:00 0 07:58:23.721: [APP/PROC/WEB.0] b3c6040000-b3c6080000 rw-p 00000000 00:00 0 07:58:23.721: [APP/PROC/WEB.0] 127fea80000-127feac0000 ---p 00000000 00:00 0 07:58:23.721: [APP/PROC/WEB.0] 14cd6a00000-14cd6a41000 rw-p 00000000 00:00 0 07:58:23.721: [APP/PROC/WEB.0] 415e5300000-415e5340000 ---p 00000000 00:00 0 07:58:23.722: [APP/PROC/WEB.0] 7f02e9c4c000-7f02e9d85000 r-xp 00000000 07:00 41466007 /usr/sap/nwrfcsdk/lib/libicui18n.so.34 07:58:23.722: [APP/PROC/WEB.0] 7f02e9d85000-7f02e9e85000 ---p 00139000 07:00 41466007 /usr/sap/nwrfcsdk/lib/libicui18n.so.34 07:58:23.722: [APP/PROC/WEB.0] 7f02e9e85000-7f02e9e8e000 rw-p 00139000 07:00 41466007 /usr/sap/nwrfcsdk/lib/libicui18n.so.34 07:58:23.722: [APP/PROC/WEB.0] 7f02e9e8e000-7f02e9e8f000 rw-p 00000000 00:00 0 07:58:23.722: [APP/PROC/WEB.0] 7f02e9e8f000-7f02ea6fd000 r--p 00000000 07:00 41466005 /usr/sap/nwrfcsdk/lib/libicudata.so.34 07:58:23.722: [APP/PROC/WEB.0] 7f02ea6fd000-7f02ea7fc000 ---p 0086e000 07:00 41466005 /usr/sap/nwrfcsdk/lib/libicudata.so.34 07:58:23.722: [APP/PROC/WEB.0] 7f02ea7fc000-7f02ea7fd000 rw-p 0086d000 07:00 41466005 /usr/sap/nwrfcsdk/lib/libicudata.so.34 07:58:23.722: [APP/PROC/WEB.0] 7f02f80b1000-7f02f81fd000 r-xp 00000000 07:00 41466008 /usr/sap/nwrfcsdk/lib/libicuuc.so.34 07:58:23.722: [APP/PROC/WEB.0] 7f02f81fd000-7f02f82fd000 ---p 0014c000 07:00 41466008 /usr/sap/nwrfcsdk/lib/libicuuc.so.34 07:58:23.722: [APP/PROC/WEB.0] 7f02f82fd000-7f02f830a000 rw-p 0014c000 07:00 41466008 /usr/sap/nwrfcsdk/lib/libicuuc.so.34 07:58:23.722: [APP/PROC/WEB.0] 7f02f830a000-7f02f830b000 rw-p 00000000 00:00 0 07:58:23.722: [APP/PROC/WEB.0] 7f02f830b000-7f02f831f000 r-xp 00000000 07:00 2163471 /lib/x86_64-linux-gnu/libresolv-2.24.so 07:58:23.722: [APP/PROC/WEB.0] 7f02f831f000-7f02f851e000 ---p 00014000 07:00 2163471 /lib/x86_64-linux-gnu/libresolv-2.24.so 07:58:23.722: [APP/PROC/WEB.0] 7f02f851e000-7f02f851f000 r--p 00013000 07:00 2163471 /lib/x86_64-linux-gnu/libresolv-2.24.so 07:58:23.722: [APP/PROC/WEB.0] 7f02f851f000-7f02f8520000 rw-p 00014000 07:00 2163471 /lib/x86_64-linux-gnu/libresolv-2.24.so 07:58:23.722: [APP/PROC/WEB.0] 7f02f8520000-7f02f8522000 rw-p 00000000 00:00 0 07:58:23.722: [APP/PROC/WEB.0] 7f02f8522000-7f02f8527000 r-xp 00000000 07:00 2163450 /lib/x86_64-linux-gnu/libnss_dns-2.24.so 07:58:23.722: [APP/PROC/WEB.0] 7f02f8527000-7f02f8726000 ---p 00005000 07:00 2163450 /lib/x86_64-linux-gnu/libnss_dns-2.24.so 07:58:23.722: [APP/PROC/WEB.0] 7f02f8726000-7f02f8727000 r--p 00004000 07:00 2163450 /lib/x86_64-linux-gnu/libnss_dns-2.24.so

Thanks, Rajdeep Bhuva

gimapei commented 2 years ago

hello. what version of node-rfc are you using?

2021년 11월 17일 (수) 오후 2:13, Rajdeep Bhuva @.***>님이 작성:

Hi @bsrdjan https://github.com/bsrdjan,

Please find below trace logs that appeared when the application is crashed.

Logs:- [APP/PROC/WEB.0] Error in `node': double free or corruption (fasttop): 0x0000000005087810 07:58:23.721: [APP/PROC/WEB.0] ======= Backtrace: ========= 07:58:23.721: [APP/PROC/WEB.0] /lib/x86_64-linux-gnu/libc.so.6(+0x70bfb)[0x7f03022ccbfb] 07:58:23.721: [APP/PROC/WEB.0] /lib/x86_64-linux-gnu/libc.so.6(+0x76fc6)[0x7f03022d2fc6] 07:58:23.721: [APP/PROC/WEB.0] /lib/x86_64-linux-gnu/libc.so.6(+0x7780e)[0x7f03022d380e] 07:58:23.721: [APP/PROC/WEB.0] /usr/src/app/node_modules/node-rfc/lib/binding/sapnwrfc.node(_ZN8node_rfc4PoolD2Ev+0xd3)[0x7f02fb5d2db3] 07:58:23.721: [APP/PROC/WEB.0] /usr/src/app/node_modules/node-rfc/lib/binding/sapnwrfc.node( ZN4Napi10ObjectWrapIN8node_rfc4PoolEE16FinalizeCallbackEP10napi_env__PvS6 +0x4b)[0x7f02fb5d8a7b] 07:58:23.721: [APP/PROC/WEB.0] node( ZN4node13CallbackQueueIvJPNS_11EnvironmentEEE12CallbackImplIZN15node_napi_env__13CallFinalizerEPFvP10napi_env__PvS8_ES8_S8_EUlS2_E_E4CallES2 +0x6b)[0x9f083b] 07:58:23.721: [APP/PROC/WEB.0] node(_ZN4node11Environment27RunAndClearNativeImmediatesEb+0x186)[0x9bbdb6] 07:58:23.721: [APP/PROC/WEB.0] node(_ZN4node11Environment14CheckImmediateEP10uv_check_s+0x72)[0x9bc412] 07:58:23.721: [APP/PROC/WEB.0] node[0x137be3c] 07:58:23.721: [APP/PROC/WEB.0] node(uv_run+0x12f)[0x137432f] 07:58:23.721: [APP/PROC/WEB.0] node(_ZN4node16NodeMainInstance3RunEv+0x1f6)[0xa5d726] 07:58:23.721: [APP/PROC/WEB.0] node(_ZN4node5StartEiPPc+0x2ac)[0x9eab6c] 07:58:23.721: [APP/PROC/WEB.0] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1)[0x7f030227c2e1] 07:58:23.721: [APP/PROC/WEB.0] node[0x982005] 07:58:23.721: [APP/PROC/WEB.0] ======= Memory map: ======== 07:58:23.721: [APP/PROC/WEB.0] 00400000-02ab6000 r-xp 00000000 07:00 2686016 /usr/local/bin/node 07:58:23.721: [APP/PROC/WEB.0] 02cb5000-02cb8000 r--p 026b5000 07:00 2686016 /usr/local/bin/node 07:58:23.721: [APP/PROC/WEB.0] 02cb8000-02cc9000 rw-p 026b8000 07:00 2686016 /usr/local/bin/node 07:58:23.721: [APP/PROC/WEB.0] 02cc9000-02ce9000 rw-p 00000000 00:00 0 07:58:23.721: [APP/PROC/WEB.0] 04caf000-05100000 rw-p 00000000 00:00 0 [heap] 07:58:23.721: [APP/PROC/WEB.0] 276ee80000-276eec0000 ---p 00000000 00:00 0 07:58:23.721: [APP/PROC/WEB.0] 5dd0a00000-5dd0a40000 ---p 00000000 00:00 0 07:58:23.721: [APP/PROC/WEB.0] 903cd40000-903cd80000 ---p 00000000 00:00 0 07:58:23.721: [APP/PROC/WEB.0] b3c6040000-b3c6080000 rw-p 00000000 00:00 0 07:58:23.721: [APP/PROC/WEB.0] 127fea80000-127feac0000 ---p 00000000 00:00 0 07:58:23.721: [APP/PROC/WEB.0] 14cd6a00000-14cd6a41000 rw-p 00000000 00:00 0 07:58:23.721: [APP/PROC/WEB.0] 415e5300000-415e5340000 ---p 00000000 00:00 0 07:58:23.722: [APP/PROC/WEB.0] 7f02e9c4c000-7f02e9d85000 r-xp 00000000 07:00 41466007 /usr/sap/nwrfcsdk/lib/libicui18n.so.34 07:58:23.722: [APP/PROC/WEB.0] 7f02e9d85000-7f02e9e85000 ---p 00139000 07:00 41466007 /usr/sap/nwrfcsdk/lib/libicui18n.so.34 07:58:23.722: [APP/PROC/WEB.0] 7f02e9e85000-7f02e9e8e000 rw-p 00139000 07:00 41466007 /usr/sap/nwrfcsdk/lib/libicui18n.so.34 07:58:23.722: [APP/PROC/WEB.0] 7f02e9e8e000-7f02e9e8f000 rw-p 00000000 00:00 0 07:58:23.722: [APP/PROC/WEB.0] 7f02e9e8f000-7f02ea6fd000 r--p 00000000 07:00 41466005 /usr/sap/nwrfcsdk/lib/libicudata.so.34 07:58:23.722: [APP/PROC/WEB.0] 7f02ea6fd000-7f02ea7fc000 ---p 0086e000 07:00 41466005 /usr/sap/nwrfcsdk/lib/libicudata.so.34 07:58:23.722: [APP/PROC/WEB.0] 7f02ea7fc000-7f02ea7fd000 rw-p 0086d000 07:00 41466005 /usr/sap/nwrfcsdk/lib/libicudata.so.34 07:58:23.722: [APP/PROC/WEB.0] 7f02f80b1000-7f02f81fd000 r-xp 00000000 07:00 41466008 /usr/sap/nwrfcsdk/lib/libicuuc.so.34 07:58:23.722: [APP/PROC/WEB.0] 7f02f81fd000-7f02f82fd000 ---p 0014c000 07:00 41466008 /usr/sap/nwrfcsdk/lib/libicuuc.so.34 07:58:23.722: [APP/PROC/WEB.0] 7f02f82fd000-7f02f830a000 rw-p 0014c000 07:00 41466008 /usr/sap/nwrfcsdk/lib/libicuuc.so.34 07:58:23.722: [APP/PROC/WEB.0] 7f02f830a000-7f02f830b000 rw-p 00000000 00:00 0 07:58:23.722: [APP/PROC/WEB.0] 7f02f830b000-7f02f831f000 r-xp 00000000 07:00 2163471 /lib/x86_64-linux-gnu/libresolv-2.24.so 07:58:23.722: [APP/PROC/WEB.0] 7f02f831f000-7f02f851e000 ---p 00014000 07:00 2163471 /lib/x86_64-linux-gnu/libresolv-2.24.so 07:58:23.722: [APP/PROC/WEB.0] 7f02f851e000-7f02f851f000 r--p 00013000 07:00 2163471 /lib/x86_64-linux-gnu/libresolv-2.24.so 07:58:23.722: [APP/PROC/WEB.0] 7f02f851f000-7f02f8520000 rw-p 00014000 07:00 2163471 /lib/x86_64-linux-gnu/libresolv-2.24.so 07:58:23.722: [APP/PROC/WEB.0] 7f02f8520000-7f02f8522000 rw-p 00000000 00:00 0 07:58:23.722: [APP/PROC/WEB.0] 7f02f8522000-7f02f8527000 r-xp 00000000 07:00 2163450 /lib/x86_64-linux-gnu/libnss_dns-2.24.so 07:58:23.722: [APP/PROC/WEB.0] 7f02f8527000-7f02f8726000 ---p 00005000 07:00 2163450 /lib/x86_64-linux-gnu/libnss_dns-2.24.so 07:58:23.722: [APP/PROC/WEB.0] 7f02f8726000-7f02f8727000 r--p 00004000 07:00 2163450 /lib/x86_64-linux-gnu/libnss_dns-2.24.so

Thanks, Rajdeep Bhuva

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/SAP/node-rfc/issues/189#issuecomment-971198179, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKW64P4FJX7A6TGSY6BGHLUMM2WNANCNFSM4UHMTP4A . 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.

rbhuva commented 2 years ago

Hi @gimapei,

node-rfc version : "2.4.2"

rbhuva commented 2 years ago

Hi @gimapei, Do you think any other version would help?

Thanks & Regards, Rajdeep Bhuva

bsrdjan commented 2 years ago

Hi and sorry for the late reply. Could you please test with the RFC SDK PL9, released in Dec 2021 ?

gimapei commented 2 years ago

Hi rbhuva. I think it's good to update.

I think most of the errors in my case were related to memory allocation in C++. In particular, I think it's caused by the logic that frees up memory usage. Therefore, if I commented on the part of memory-free logic from the source and compiled and used it myself, the error would disappear. At that time, the version was probably the early 2.x version. Afterward, when I tested the version provided by bsrdjan, it was confirmed that the problem was gone.

If the error occurs even after using the latest version how about making a code that connects RFC in java and making a node wrapper and using it?

I've heard from my colleagues, there is no error from Java lib.

Thanks Joe

rbhuva commented 2 years ago

Hi @gimapei , @bsrdjan ,

Thank you for your help. I got the issue. It was because, I followed functional approach to create client (function which will return RFC client). Pool variable was getting destroyed as it was in function scope and I was returning just the client variable. It got solved by preserving the pool variable by creating it at outer scope fixed this issue.

This is working fine and tested with latest version of node-rfc and SDK PL9.

Thanks, Rajdeep Bhuva

bsrdjan commented 2 years ago

Hi @rbhuva,

thank you very much for finding and sharing the root cause. It looks like a reproducible bug, that shall be investigated and fixed The issue remains open until that is done.

Regards, srdjan

gimapei commented 2 years ago

@rbhuva Congratulation, It's great.

bsrdjan commented 2 years ago

Not a bug, solved by newer SDK version and fixed application code.