PCAN-Ethernet Gateway DR probably crash with exception code 0xc0000374 in Windows 10 ver 1909

This forum covers issues concerning multiple software products.
Post Reply
andrea90
Posts: 5
Joined: Tue 14. Jul 2020, 11:25

PCAN-Ethernet Gateway DR probably crash with exception code 0xc0000374 in Windows 10 ver 1909

Post by andrea90 » Tue 14. Jul 2020, 12:00

Hi,
i'm using the PCAN-UDS.dll (32bit, 1.3.4.63) and PCANBasic.dll (32bit, 4.4.0.288) 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:
crash_app.PNG
crash_app.PNG (72.14 KiB) Viewed 1151 times
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.

K.Wagner
Software Development
Software Development
Posts: 767
Joined: Wed 22. Sep 2010, 13:36

Re: PCAN-Ethernet Gateway DR probably crash with exception code 0xc0000374 in Windows 10 ver 1909

Post by K.Wagner » Tue 14. Jul 2020, 14:59

Hello,

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.
Best regards,
Keneth

andrea90
Posts: 5
Joined: Tue 14. Jul 2020, 11:25

Re: PCAN-Ethernet Gateway DR probably crash with exception code 0xc0000374 in Windows 10 ver 1909

Post by andrea90 » Thu 16. Jul 2020, 09:44

Hello,
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.

andrea90
Posts: 5
Joined: Tue 14. Jul 2020, 11:25

Re: PCAN-Ethernet Gateway DR probably crash with exception code 0xc0000374 in Windows 10 ver 1909

Post by andrea90 » Thu 16. Jul 2020, 10:33

Hi,
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:
log_crash_vs2019.PNG
log_crash_vs2019.PNG (2.81 KiB) Viewed 1091 times

K.Wagner
Software Development
Software Development
Posts: 767
Joined: Wed 22. Sep 2010, 13:36

Re: PCAN-Ethernet Gateway DR probably crash with exception code 0xc0000374 in Windows 10 ver 1909

Post by K.Wagner » Thu 16. Jul 2020, 11:02

Hello,

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.
Best regards,
Keneth

andrea90
Posts: 5
Joined: Tue 14. Jul 2020, 11:25

Re: PCAN-Ethernet Gateway DR probably crash with exception code 0xc0000374 in Windows 10 ver 1909

Post by andrea90 » Fri 17. Jul 2020, 08:41

Hello,
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):
crash_app_OK_doppio.PNG
crash_app_OK_doppio.PNG (294.83 KiB) Viewed 1062 times
crash_app_OK_doppio_con_stack.PNG
crash_app_OK_doppio_con_stack.PNG (202.8 KiB) Viewed 1062 times

K.Wagner
Software Development
Software Development
Posts: 767
Joined: Wed 22. Sep 2010, 13:36

Re: PCAN-Ethernet Gateway DR probably crash with exception code 0xc0000374 in Windows 10 ver 1909

Post by K.Wagner » Fri 17. Jul 2020, 09:11

Hello,

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.
Best regards,
Keneth

andrea90
Posts: 5
Joined: Tue 14. Jul 2020, 11:25

Re: PCAN-Ethernet Gateway DR probably crash with exception code 0xc0000374 in Windows 10 ver 1909

Post by andrea90 » Fri 17. Jul 2020, 09:35

Don’t worry. If it can helps, in this test software, i'm using only periodic SvcTesterPresent like this (every 4 seconds):

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?

K.Wagner
Software Development
Software Development
Posts: 767
Joined: Wed 22. Sep 2010, 13:36

Re: PCAN-Ethernet Gateway DR probably crash with exception code 0xc0000374 in Windows 10 ver 1909

Post by K.Wagner » Fri 17. Jul 2020, 11:08

hello,

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.
Best regards,
Keneth

F.Vergnaud
Software Development
Software Development
Posts: 170
Joined: Mon 9. Sep 2013, 12:21

Re: PCAN-Ethernet Gateway DR probably crash with exception code 0xc0000374 in Windows 10 ver 1909

Post by F.Vergnaud » Mon 20. Jul 2020, 11:58

Hello,

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?

Thanks.
Best regards,
Fabrice

Post Reply