gusmanb / logicanalyzer

24 channel, 100Msps logic analyzer hardware and software
GNU General Public License v3.0
1.69k stars 206 forks source link

Crash when exporting data, Windows #45

Closed kuba2k2 closed 1 year ago

kuba2k2 commented 1 year ago

obraz

The program crashes whenever I try to export the data to a .lac or .csv file. I tested that on v2.0.0.0, v2.1.0.1 and v3.5.0.1 (latest).

Capturing data works fine, but I can't export it for further analysis in any way. How can I debug that crash?

gusmanb commented 1 year ago

If you want to debug it you need to download the source code and use Visual Studio. Maybe you can get info from the EventViewer, in the Application section it may have registered the crash.

When does it crash? Before or after selecting the filename to save/export?

Also, have you tried to execute it as administrator?

Cheers.

kuba2k2 commented 1 year ago

I'm afraid I don't currently meet the enormous disk space requirements of Visual Studio...

It crashes after selecting the filename and clicking OK, just in the moment when it should write the file. The file doesn't get created, even an empty one.

I have tried running both with admin rights and without.

Weirdly, it works just fine with the CLCapture program - the file gets created with all the data in it. I tried loading up the file in the GUI, and the same crash occurred (I know it expects a .lac and not .csv, so maybe that's the crash source in this case).

gusmanb commented 1 year ago

Ok, let's see if we can find what's happening.

Take this build, instead of crashing it will show you the crash info before closing whenever you try to open/save/export a file. Test the three operations (opening a file that is not a .lac one is going to crash for sure as it is not in the correct format) and take a screenshot of each message, it will show exactly where and why the crash happens.

Also here is a .lac file so you can test it properly.

BTW, this is built using my development branch and it contains something that I'm working on, so don't use the "New" menu under "File" or you will see strange things ;)

Cheers.

kuba2k2 commented 1 year ago

Same exception for all file operations: obraz

I looked into Avalonia's source code of that file, and found that the exception is probably thrown when retrieving the chosen file's path. As I was using my D:\ drive for opening/saving the .lac files, I tried opening it from C:\ root directory instead, and... it worked.

For easy access to my dev directories, I have them set up as Windows Explorer "Libraries". Turns out that picking the file from the "library" crashes the program: obraz

Picking the exact same file by manually navigating through PC->D:->Dev->.... works just fine: obraz

I'm not sure what's the cause of that behavior; I've written a few Windows programs that used file pickers before (in Python and in Delphi) and picking files via a "library" simply returned the physical path of the file.

So, anyway, consider the issue half-solved. It's possible that on Windows 10 going the "libraries" way works and that it's a problem with Windows 7 (but I didn't test it so it might be broken as well). Thanks for the quick response and helping to solve the problem! :grinning:

gusmanb commented 1 year ago

Excellent :)

I have tested it with a library in W10 and it works, so something must be different in the W7 libraries implementation. If I get enough time I will open a bug in AvaloniaUI.

Cheers!