i'm using the PCAN-UDS.dll (32bit, 22.214.171.124) and PCANBasic.dll (32bit, 126.96.36.1998) in a C# software with the "PCAN-Ethernet Gateway DR" for communicating with an ECU on a system with Windows 10 ver 1909. Until some month ago everything has worked perfectly, but since from an update of Windows 10 to the version 1909, i've noticed sometimes a crash of the application with this error report:
The software send periodics "Tester Present" with PCAN-UDS class and periodics can messages with PCANBasic.
I suppose that the problem is something with PCAN-UDS.dll or PCANBasic.dll because this software has only Peak libraries as external dependencies and .NET can't catch the crash in any way.
These days i'm running some tests with the same software in pc with Windows 10 ver 1903 and nothing happened.
only to be sure what you are doing: you are using PCAN-UDS with a PCAN-LAN channel (PCAN_LANBUS1..16) using only the function SvcTesterPresent, and using PCAN-Basic on the same channel to transmit custom CAN data, right? Please just be warned, that if you read using PCAN-Basic, those message will be not worked out in PCAN-UDS and the UDS communication may fail.
Now to the crash. Well, with this kind of exception messages it is actual not possible to say 100% if the problem is caused by any of the dlls or by the parent application. As you mention, the problem seems to happen only with the last version of Windows 10. Even when you explicitly don't use other binaries but ours, it could be possible that something in the .NET environment is working different now with this new update and is causing such a behavior.
I did see crashes, where native dlls were involved and the compiler states that the problem for the crash was in those, so if the problem is directly caused by one of our dlls then you should see something like "error in module PCAN-UDS.dll" or something like that at debugging time.
Please try debugging your software until it crashes and check which exception you receive. The best is if you can isolate the problem in a project that you can share, so we can try to reproduce the issue here.
regarding the first question, i'm using PCAN-Basic only for send "raw" CAN message for keeping alive the ECU. With PCAN-UDS i'm using the function SvcTesterPresent for keeping alive the ECU too and other functions for diagnostics. Anyway, for this thing always seems works perfect.
About the crash, this morning i've had the same problem with Windows 10 version 2004 after 3 days of trying but there wasn't the debugger attached... Now i'm retrying with the debugger attached and i'm working in a project that i can share with you for try to reproduce the issue.
i've launched the sw in debug and it crashed with the same error code, but the debugger closed without a break and reported this line:
digging a little in the documentation of Windows, it seems that the error code 0xC0000374 means a memory heap corruption has occurred. Since this problem didn't happen in Windows revisions older than 2004 it is to suppose, that Microsoft changed some rules.
Unfortunately, as I said before, the problem can be in any module being used in the project. For instance, here is the same problem being seen directly on Explorer.exe.
If you get the problem isolated we will check if this corruption is happening in one of our dlls.
i've attached to the process the "ntsd" debugger and when it caught the exception, it has shown these messages (i've ran 2 debugging session with the same exe in two different bus can):
you're right. It looks like the problem is caused by the UDS_SvcRequestTransferExit function.
We will investigate this. Thank you for pointing this out to us.
UDSApi.SvcTesterPresent(CAN_Channel, ref _request, UDSApi.TPUDSSvcParamTP.PUDS_SVC_PARAM_TP_ZSUBF);
And 2 periodic CAN messages, 1 every 250ms and 1 every 1000ms for keep alive the ECU.
For now, since we have the production line stopped, we will try with older version of PCAN-UDS.dll.
Do you have any idea when you will be able to fix the problem?
I forgot to mention, that we are already working on the next version of PCAN-UDS (based on the revision 2016, with CAN FD capabilities). It is already in beta state. If you like, you could test if with this version the problem still occurs. If you are interested, then send an email to support[at]peak-system.com making reference to this post.
I have already informed the responsables for this to check the issue. I cannot tell you a concrete date for the check, but normally this should happen within the next two weeks. Note that we are now in high season and some of our developers have (will have) holydays, so it may take a while.
You was writing a test application demonstrating this problem. Will you give us this for reproduction? this can actually speed up things when investigating the issue. You can send this per email to support[at]peak-system.com making reference to this post.
I'm going to investigate your issue, but I'd like to be sure where to begin with.. to sum up:
- your are getting a crash in function UDS_SvcRequestTransferExit,
- but you are ONLY using function UDS_TesterPresent and CAN_Write functions.
Your application never calls UDS_SvcRequestTransferExit?