KB3061220 - Memory leak with Winsock Stress Test in FreeScale i.MX6 Quad Sabre platform RRS feed

  • Question

  • Hi,

    using the iMX6 WEC2013 BSP and I could see a memory leak while stress testing the ENET (ethernet) driver with our custom test tool (basically a socket connection with PC, sending and receiving data in the same port).

    I saw that in the update of April 2015 that a fix was done which seems to be related with the issue that we found.

    I merged the changes that were introduced in that fix but I'm still seeing the memory leak.

    As far as I see it is probably happening in the MiniportSendNetBufferList function. Some work was done in that function in the fix.

    I would like to know if somebody is also facing the same issue.

    Thanks in advance.



    Thursday, June 25, 2015 11:36 AM

All replies

  • There is one  more fix released on Aug 2014 related to Network stack memory leak. did you install it?

    Please mark as answer, if it is correct.
    Please vote,if it is helpful post.

    Thursday, June 25, 2015 1:03 PM
  • Hi Vinoth,

    yes, I have all the updates installed.

    It seems that in the function MiniportSendNetBufferList, the call to NdisMAllocateNetBufferSGList does the leak. I am trying to figure out why is this happening.



    Thursday, June 25, 2015 1:41 PM
  • Hi,

    Just a wild guess here. I had some problems running winsock perf test on iMX6 as well. I disabled SMP and the test started working fine.

    But that was a data abort , issue seems to be different in your case.



    Monday, June 29, 2015 4:39 AM
  • Hi,

    No, disabling SMP does not help.

    In debug mode, using KITL over USB, I am able to debug the ENET driver. I got a kernel assert:

    DEBUGCHK failed in file d:\bt\2262\private\winceos\net\ndis\sys\sendm.c at line 5291

    after the call to NdisMSendNetBufferListsComplete in MiniportSendNetBufferList function (mp_nic.c).

    EF7A2C78 D002                 beq         |ndisMSendCompleteNetBufferListsInternal+8Ch (ef7a2c80)|
    EF7A2C7A 2301                 movs        r3,#1
    EF7A2C7C 930D                 str         r3,[sp,#0x34]
    EF7A2C7E E009                 b           |ndisMSendCompleteNetBufferListsInternal+0A0h (ef7a2c94)|
    EF7A2C80 F241 43AB            movw        r3,#0x14AB
    EF7A2C84 4A6C                 ldr         r2,| (ef7a2e38)|
    EF7A2C86 496B                 ldr         r1,| (ef7a2e34)|
    EF7A2C88 4869                 ldr         r0,| (ef7a2e30)|
    EF7A2C8A F029 FB51            bl          |NKDbgPrintfW (ef7cc330)|
    EF7A2C8E DEFE                 __debugbreak
    EF7A2C90 2300                 movs        r3,#0
    EF7A2C92 930D                 str         r3,[sp,#0x34]

    Checking the content of the passed net buffer list, it seems that it is ok (Next is NULL and status is SUCCESS).

    I am starting to think that it should be a bug in the NDIS library since this code in MiniportSendNetBufferList is not NIC especific as far as I see.



    Thursday, July 2, 2015 4:47 PM
  • Hi,

    You could be right. But considering the fact that NdisMSendNetBufferListsComplete is causing the issue , you'd need to check if you are passing the right pointer(s) back. Also, if you allocated any NET_BUFFER_LIST within your driver , you should take care of handling them within the driver. The NET_BUFFER_LIST and corresponding buffer if allocated within your driver for your use shouldn't be sent to NDIS to be returned or freed. Highly unlikely that you'd do that , but my guess would be more towards pointers and some corruption within the NET_BUFFER_LIST structure.



    Thursday, July 2, 2015 7:21 PM
  • Alexander,

    I know you are not using the GuruCE iMX6 BSP (even though you should... ;-)), but can you please try to reproduce this on our latest version? We have free downloadable demo kernels available for a lot of off-the-shelf boards including the SABRE Lite, so it should be quite easy for you to try.

    We don't see any memory leaks and see sustained throughput of ~20 MByte/s on the network (both TCP and UDP). What speeds are you getting on your BSP?

    If you are able to reproduce the problem on our BSP we are very interested in getting the exact steps to reproduce so we can fix it.


    Good luck,

    Michel Verhagen, eMVP
    Check out my blog:

    Microsoft Embedded Partner
    Consultancy, training and development services.

    Thursday, July 9, 2015 10:34 AM