Search code examples
c++visual-studio-2015tcpwindows-embedded

ucrtbase.dll crash on c++ windows embedded standard involving tcp communication


I am developing a software for windows embedded standard x64 (win 7) and keep getting a ucrtbase.dll crash. I would like to know how to solve this.

The application is going to receive data via TCP from a client and foreward it to a different application. The application works fine on the development maschine (Win 10 with Visual Studio 2017 ...).

When the application is copied to the windows embedded system environment it is not working. When the Server-Client connection is established, some data is received and printed to the console, but finally my application will crash within a few seconds (5s or less).

I am using the Visual Studio 2015 - Windows XP (v140_xp) toolset Platform version 10.0.17763.0 I have tested it with a multi threaded runtime library (Multi-threaded DLL) and also with staticly linked multi-threaded runtime library, because i thought it is a environment error.

The application uses a socket-library from here https://github.com/DFHack/clsocket

I have also observed that when i connect to my target and send data at slower datarates i do not get this error. But running the software on my development maschine will run in all configurations. The cpu of my target should be fast enough Core i7-3xxxQE, 4GB RAM and i have installed many redistributables installed 2010, 2012, 2013, 2015-2019, non of which match the platform version number. The closest is 10.0.30319. Is there a way to determine the correct redistributable for my application?

Here is the fault that i am getting.

Problem signature:
  Problem Event Name:   APPCRASH
  Application Name: t50adapter.exe
  Application Version:  0.0.0.0
  Application Timestamp:    5d52aabc
  Fault Module Name:    ucrtbase.DLL
  Fault Module Version: 10.0.10586.788
  Fault Module Timestamp:   5879aa7b
  Exception Code:   40000015
  Exception Offset: 0008469a
  OS Version:   6.1.7601.2.1.0.320.65
  Locale ID:    1033
  Additional Information 1: 1c3c
  Additional Information 2: 1c3cee0f1ec6458708cdeeeb1a339ee4
  Additional Information 3: 204a
  Additional Information 4: 204a8c5270b5b704eeac649e2bb5f58c

Read our privacy statement online:
  http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
  C:\Windows\system32\en-US\erofflps.txt

I was expecting, that my application will work when the correct redistributable packages are installed. What am i missing?

Please tell me, in case you need more information.


Solution

  • In case someone stumbles upon this question, i have found my problem.

    My software uses 4 circular buffers for incoming data (RX,TX) and outgoing data (RX, TX) when monitoring the buffer loads, i was seeing that one buffer fills up and reaches its maximum. It seems like that communication line can not handle the amount of data. When i reduce the traffic for that buffer everything works fine.

    So in conclusion the error was in my circular buffer that somehow did not send me a "buffer full" and let my application crash. This crash only occurred when a specific client is connected that could not handle the traffic.

    Hope this will help someone else seeing ucrtbase.dll errors.