cancel
Showing results for 
Search instead for 
Did you mean: 

Valgrind on Linux showing RFC SDK has memory leaks?

Former Member
0 Kudos

Hi there,

I have an application written in C that is running on AIX, Solaris and Linux. I seem to have a small memory leak and am trying to track it down..

I have run Valgrind on Linux and get the following after running Valgrind.

==12811== LEAK SUMMARY:

==12811== definitely lost: 70,794 bytes in 11 blocks

==12811== indirectly lost: 0 bytes in 0 blocks

==12811== possibly lost: 69,960 bytes in 19 blocks

==12811== still reachable: 61,795 bytes in 133 blocks

==12811== suppressed: 0 bytes in 0 blocks

Now I am not worried about the "definetly lost" or "possibly lost", but more the "still reachable" as that is the ONLY one that continues to grow.

So for example I get quite a number of the following....this code is for an RFC SERVER program:

==12811== 11,252 bytes in 116 blocks are still reachable in loss record 43 of 48

==12811== at 0x4A067BA: malloc (vg_replace_malloc.c:263)

==12811== by 0x5AC0A7D: rstg_get (in /home/lynton/Geany/projects/idoclink/rfcsdk/lib/librfccm.so)

==12811== by 0x5AC1A75: ItCreate (in /home/lynton/Geany/projects/idoclink/rfcsdk/lib/librfccm.so)

==12811== by 0x5AE6329: tab_search_init (in /home/lynton/Geany/projects/idoclink/rfcsdk/lib/librfccm.so)

==12811== by 0x5AE6BDC: ab_rfctinfo (in /home/lynton/Geany/projects/idoclink/rfcsdk/lib/librfccm.so)

==12811== by 0x5AE25B8: ab_rfcget_error_exception (in /home/lynton/Geany/projects/idoclink/rfcsdk/lib/librfccm.so)

==12811== by 0x5AEF588: RfcExtendedReceive (in /home/lynton/Geany/projects/idoclink/rfcsdk/lib/librfccm.so)

==12811== by 0x5AF003D: ab_rfcreceive (in /home/lynton/Geany/projects/idoclink/rfcsdk/lib/librfccm.so)

==12811== by 0x5AE0407: ab_rfcxgdata (in /home/lynton/Geany/projects/idoclink/rfcsdk/lib/librfccm.so)

==12811== by 0x5ADCA9C: RfcGetData (in /home/lynton/Geany/projects/idoclink/rfcsdk/lib/librfccm.so)

==12811== by 0x565A835: idoc_handler (sender.c:139)

==12811== by 0x5AA9A29: ab_RfcDispatchLoc (in /home/lynton/Geany/projects/idoclink/rfcsdk/lib/librfccm.so)

...

...

==12811== 28,041 bytes in 1 blocks are still reachable in loss record 46 of 48

==12811== at 0x4A067BA: malloc (vg_replace_malloc.c:263)

==12811== by 0x5AC0A7D: rstg_get (in /home/lynton/Geany/projects/idoclink/rfcsdk/lib/librfccm.so)

==12811== by 0x5AF233E: ab_rfcresize (in /home/lynton/Geany/projects/idoclink/rfcsdk/lib/librfccm.so)

==12811== by 0x5AF8CED: ab_rfcallocbuffer (in /home/lynton/Geany/projects/idoclink/rfcsdk/lib/librfccm.so)

==12811== by 0x5AF8DE7: open_channel (in /home/lynton/Geany/projects/idoclink/rfcsdk/lib/librfccm.so)

==12811== by 0x5AFC7B2: ab_rfcaccept_ex (in /home/lynton/Geany/projects/idoclink/rfcsdk/lib/librfccm.so)

==12811== by 0x5AFCA57: ab_rfcaccept (in /home/lynton/Geany/projects/idoclink/rfcsdk/lib/librfccm.so)

==12811== by 0x5AA1FDD: RfcRegisterProgram (in /home/lynton/Geany/projects/idoclink/rfcsdk/lib/librfccm.so)

==12811== by 0x5AA2EF1: RfcAccept (in /home/lynton/Geany/projects/idoclink/rfcsdk/lib/librfccm.so)

==12811== by 0x5AA3438: RfcAcceptExt (in /home/lynton/Geany/projects/idoclink/rfcsdk/lib/librfccm.so)

==12811== by 0x565A4A8: saprfc_sender_initialise (sender.c:35)

==12811== by 0x4C0E12E: saprfc_sender_proxy_initialize (sender_proxy.c:26)

I see I also get lots of the following....seem to be on some "RfcProcessAttach" call that is made on the RFC Server I have made....

==12811== 2,464 bytes in 1 blocks are still reachable in loss record 36 of 48

==12811== at 0x4A067BA: malloc (vg_replace_malloc.c:263)

==12811== by 0x5CC1688: rscpgtm__get_thread_mem (in /home/lynton/Geany/projects/idoclink/rfcsdk/lib/librfccm.so)

==12811== by 0x5CB09D8: rscpce_clear_error (in /home/lynton/Geany/projects/idoclink/rfcsdk/lib/librfccm.so)

==12811== by 0x5CBCECE: rscpi__init (in /home/lynton/Geany/projects/idoclink/rfcsdk/lib/librfccm.so)

==12811== by 0x5CBE062: rscpi_init (in /home/lynton/Geany/projects/idoclink/rfcsdk/lib/librfccm.so)

==12811== by 0x5AA14AA: RfcInitInternal (in /home/lynton/Geany/projects/idoclink/rfcsdk/lib/librfccm.so)

==12811== by 0x5AA1D6B: RfcProcessAttach (in /home/lynton/Geany/projects/idoclink/rfcsdk/lib/librfccm.so)

==12811== by 0x5CCD091: ??? (in /home/lynton/Geany/projects/idoclink/rfcsdk/lib/librfccm.so)

==12811== by 0x5A96A22: ??? (in /home/lynton/Geany/projects/idoclink/rfcsdk/lib/librfccm.so)

==12811== by 0x7FF000346: ???

==12811== by 0x6F6274756F5F6B6D: ???

==12811== by 0x636F646900646E74: ???

I am using ItFree etc, but is there any way I can get rid of there "memory leaks" as it is causing my application to gradually grow in size if it runs non stop for days and days....

Any advise? Thanks for the help

Lynton

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Your question isn't related to SAP.

You might get more help in a C programming forum.

regards

Former Member
0 Kudos

Hi Joe,

But I am speaking directly about the SAP RFC SDK? Of course this is SAP related...

No worries, thanks

Lynton

Former Member
0 Kudos

Well, you may be right ...

Nevertheless I don't think that in this forum you will get a lot of response from knowledgeable readers.

I would either try a C programming forum elsewhere, or open a support call with SAP. That way you could get in touch with SAP developers.

(Or maybe wait for a few days, for someone to prove me wrong.)

hope this helps

Former Member
0 Kudos

I will try the SAP NW RFC SDK to see if it runs better......