Uploaded image for project: 'EtherNet/IP Firmware V3'
  1. EtherNet/IP Firmware V3
  2. PSEISV3-329

Explicit class 3 access to large I/O data causes infinite loop.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: V3.4.0.0
    • Fix Version/s: V3.4.0.1, V3.4.1.0, V3.5.0.0
    • Component/s: None
    • Labels:
      None
    • Account:
      SPC EthernetIp Slave (SPCETHERNE)

      Description

      When large assemblies, e.g. 504 bytes each, are registered and I/O data is accessed via explicit CL3 or UCMM, the stack will be stuck in an endless loop calling TCP_Write().
      Seems as we allocate to much buffers and lwIP may run out of memory in certain situations:

      1) One buffer per CL3 instance (1500 bytes), malloced at initialization time

      memcpy'd to
      2) One buffer (variable size), LwIP_Buf_Alloc'd in EipEncapCl3_SendResponse()

      memcpy'd to
      3) One buffer (variable size), implicitly allocated in LwIP_Socket_Write()

      We are too short on resources for large sends. We should avoid the LwIP_Buf_Alloc() of buffer 2) and directly use buffer 1) instead by means of LwIP_Buf_Ref().
      This of course forces us to think about the lifecycle of especially the UCMM connection again, since TCP-sending happens asynchronously and we must not free that buffer 1) until the data was passed to the lwIP layer.

        Attachments

          Expenses

            Activity

              Status Description

                People

                • Reporter:
                  MBommert Marc Bommert
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: