Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error occurs when using an ASC log file #847

Open
haikhongtam opened this issue Sep 20, 2024 · 4 comments
Open

An error occurs when using an ASC log file #847

haikhongtam opened this issue Sep 20, 2024 · 4 comments

Comments

@haikhongtam
Copy link

I am using windows 11 64 bit. I have a log file in ASC format with a size of about 12mb. When I open the file, the software automatically exits and closes. I tried another way, selecting play back, but the application still exits. Even though I have 6GB of free RAM, I tried again with the CSV file and it opened again. There is a problem here, I hope you can fix it soon.

@rusoku
Copy link
Contributor

rusoku commented Sep 20, 2024

Is it possible to get this file for testing ?

@haikhongtam
Copy link
Author

logfile1.zip
I use V213

@GavStorie
Copy link

I've had similar issues and it seems to be linked to the auto detect filetype feature. Try selecting the correct file type when you are loading the file and see if that works. It works for me that way. If i try to load without selecting the file type it crashes every time. Not just ASC but many TRC and CSV files as well.

@GerryFerdinandus
Copy link

Some issues found are:

Issue 1
Software crash in CANHacker file decoding.

if (tokens[d + 3] != "")

read memory address bigger than tokens[]
need to change to

-                    if (tokens[d + 3] != "")
+                    if (tokens.length() > (d + 3))

It is assumed that the DLC value is correct. If not, the program will crash.
There are other code parts that use the same method in this file.
if (tokens[d + a_value] != "")
IMO they should also be updated to check for length()

if (tokens[d + 5] != "")

Issue 2
Wrong valid file detection of this ASC issue file by isCANHackerFile()

int len = tokens[2].toInt();

-                        int len = tokens[2].toInt();
-                        if (len > -1 && len < 9)
+                        bool isValidlen;
+                        int len = tokens[2].toInt(&isValidlen, 10);
+                        if (isValidlen && len > -1 && len < 9)    

After this additional validation check, the test ASC file is ignored as a valid CANhacker file.

Issue 3
Issue ASC file is not detected because savvyCAN expects multiple header items that are not present in the file.
*.ASC detection code

bool FrameFileIO::isCanalyzerASC(QString filename)

It's missing:
logged
version

This issue test file:

date Sat May 18 02:09:30 PM 2024
base hex timestamps absolute

000134.714376	1	178	Rx	d	8	9E 2D 80 35 F2 80 35 FF
etc..

Note that the *.ASC generated by savvyCAN is also not detected because it uses the word
logging
and not logged

outFile->write("no internal event logging\n");

*.ASC file generated by savvyCAN

date ma sep. 23 10:00:54.792 p.m. 2024
base hex  timestamps absolute
no internal event logging
// version 11.0.0

A possible solution is to detect only the first two *.ASC lines and not four lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants