Announcement

Collapse
No announcement yet.

XPP crashing on shutdown()

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • XPP crashing on shutdown()

    We have a problem concerning the socket API. It seems that the call of the shutdown() function "crashes" the device and it restarts. When we use a current alpha version (V5.2.0.5B13) of the Evolution SDK, everything works fine. But with the older beta version (V5.2.1.0B8), the device simply restarts.

    Some facts:
    - XPort Pro Evolution OS (XPP100200-02R)
    - SDK V5.2.1.0B8 or SDK V5.2.0.5B13

    Here an rough abstract of the source:
    Code:
    // open a server socket
    servSock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
    
    // bind server socket and set it into listen mode
    memzero(&servAddr, sizeof(servAddr));
    servAddr.sin_family = AF_INET;
    servAddr.sin_addr.s_addr = htonl(INADDR_ANY);
    servAddr.sin_port = htons(iPort);
    bind(servSock, (struct sockaddr *) &servAddr, sizeof(servAddr);
    listen(servSock, 5);
    
    // wait for the incoming client connection
    clientSock = accept(servSock, &clientAddr, &clientAddr);
    
    // when client is connected: do multiple recv() and send() calls
    while (connected)
    {
      if (selectsocket((clientSock + 1), &fdSet, NULL, NULL, rTimeout))
      {
        recv(clientSocket, TX_DATA, bufLen, 0);
      }
      send(clientSock, RX_DATA, RX_DATA_LEN, 0);
      
      // ...
    }
    When we break the connection while RX/TX is active, the recv() function fails. The application then tries to close the sockets (first the client socket, then the server socket) using the same following function:
    Code:
    // debug message and delay to send the TLOG message
    TLOG_CRIT_F("tcpCloseOsSocket(%d) A", lSocket); 
    DELAY_THREAD(0, DLY_MSECS, 500); 
    
    // set socket to blocking mode -- 
    lSocketMode = 0; 
    lResult = ioctlsocket(lSocket, FIONBIO, &lSocketMode); 
    
    // debug message and delay to send the TLOG message
    TLOG_CRIT_F("tcpCloseOsSocket(%d) B %d", lSocket, lResult); 
    DELAY_THREAD(0, DLY_MSECS, 500); 
    
    // end connection (how=2: do not wait for FIN) -- 
    lResult = shutdown(lSocket, 2); 
    if (lResult != 0) 
    { 
      lErrno = errno; 
    
      if (lErrno != ENOTCONN) 
      { // display error only, if socket was connected 
        TLOG_ERROR_F("tcpCloseOsSocket() shutdown failed: %d %d", lResult, lErrno); 
      } 
    } 
    
    // debug message and delay to send the TLOG message
    TLOG_CRIT_F("tcpCloseOsSocket(%d) C", lSocket); 
    DELAY_THREAD(0, DLY_MSECS, 500); 
    
    // release handle -- 
    lResult = closesocket(lSocket); 
    if (lResult != 0) 
    { 
      TLOG_ERROR("tcpCloseOsSocket() close failed"); 
    } 
    
    // debug message and delay to send the TLOG message
    TLOG_CRIT_F("tcpCloseOsSocket(%d) D", lSocket); 
    DELAY_THREAD(0, DLY_MSECS, 500);
    Here the syslog output with SDK V5.2.1.0B8:
    Code:
    tcp.c: tcpCloseOsSocket(8) A    <==== close the client socket (=8)
    tcp.c: tcpCloseOsSocket(8) B -1 
    tcp.c: tcpCloseOsSocket(8) C 
    tcp.c: tcpCloseOsSocket(8) D 
    tcp.c: tcpCloseOsSocket(7) A    <==== close the server socket (=7)
    tcp.c: tcpCloseOsSocket(7) B 0 
    rtos main task started               <==== here is the reboot 
    Reset Reason: 0x10 
    Coldfire Bootloader 2.0.0.3
    With V5.2.0.5B13, all of the TLOG messages are sent and there is no restart of the XPP device.

    Can you please check, if there has been a change regarding the shutdown() function between the older version V5.2.1.0B8 (2011-11-02) and the current alpha V5.2.0.5B13 (2015-02-19)?

  • #2
    Sorry, I can't help you with the problem, but where are you getting the BETA SDKs? I was under the impression that the XPP was no longer really supported because of the death of the GCC toolchain.

    Comment


    • #3
      I got many beta versions from a former FAE. Unfortunately, he left Lantronix. Last year, I got another beta version (V5.4.0.0) from a Technical Support Manager due to TCP issues.

      He said, that there will be a release version of V5.4.x. I do not know anything about the roadmap, but I am anxious. This forum has been moved to "Legacy SDKs". But on the other hand, the product is still marked as "new". Our supplier told me, that the production goes on and the support is still active... (whatever this means). According to our supplier, there is no other product to replace the XPP. But please let me know, if anybody has knowledge about the roadmap.

      Comment


      • #4
        My information is the same as yours. I think unfortunately because CodeSourcery removed their GCC compiler, then Lantronix was left in a difficult situation because the Evolution OS requires it to compile on the ColdFire CPU.

        I think it is a great device, but the fact that it is not well supported anymore (and the prices are very high considering its capabilities), it will eventually lead to its own death. I don't think new users will utilize this part (because of lack of development environment, and high prices), and eventually existing users will be without an option.

        I really wish Lantronix ported this device to a Cortex-M4 based processor and lowered the price ($25). I think it would be a fantastic tool for industrial IoT development.

        Comment


        • #5
          Originally posted by TESK View Post
          I got many beta versions from a former FAE. Unfortunately, he left Lantronix. Last year, I got another beta version (V5.4.0.0) from a Technical Support Manager due to TCP issues.

          He said, that there will be a release version of V5.4.x. I do not know anything about the roadmap, but I am anxious. This forum has been moved to "Legacy SDKs". But on the other hand, the product is still marked as "new". Our supplier told me, that the production goes on and the support is still active... (whatever this means). According to our supplier, there is no other product to replace the XPP. But please let me know, if anybody has knowledge about the roadmap.
          Do you have any change logs for these? My FAE gave me a v5.4.0.0.A2, but he is looking for the change log. We are bidding on a large contract using these, but we have had stability issues, and it seems that the watchdog is causing the resets. I'm wondering if anything in the SDK was improved. I would be keen on getting your contact info so we could exchange notes.

          Comment

          Working...
          X