LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

GetFileAttrs Crashes CVI 2010 SP1 for 64-bit compile if Windows Volume does not exist

When I compile an application as 64-bit running on Win7 64-bit OS,  and use the GetFileAttrs function where the Windows Volume (say Z:\) does not exist,  the application crashes.  In Debug mode,  the application simple goes away,  whereas in run-time mode,  a fatal run-time error occurs.

 

This behavior is not observed if when application is compiled as 32-bit.

0 Kudos
Message 1 of 11
(4,052 Views)

Hm,

 

I was wondering if I could reproduce this behavior. What I found out using Win7 64 bit, CVI 2010 is that even in 32 bit debug mode this function causes the program to stop without notice (I don't know if I should call it a crash, but status is not populated):

 

 

    ... something: executed properly

    status = GetFileAttrs ( "z:\test.txt", &a, &b, &c, &d );
    ... something: never executed

 

Also in my case the volume z does not exist

 

If I replace z:\test.txt with c:\test.txt I do get a return value of status = -1 (as expected, because I don't have a file test.txt)

0 Kudos
Message 2 of 11
(4,050 Views)

You are correct, Wolfgang.  It does not work for either build.

0 Kudos
Message 3 of 11
(4,043 Views)

It should be "z:\\test.txt". You are putting a tab in the string by not escaping the backslash.

0 Kudos
Message 4 of 11
(4,029 Views)

Mohan,

 

You are right - partially Smiley Wink

 

  • However, the same tab is present in "c:\test.txt" - and in this case the function behaves properly, i.e. returns an error
  • Even a wrong argument of a function should not crash CVI but result in a meaningful error message
0 Kudos
Message 5 of 11
(4,026 Views)

Yes, the "crash" is not acceptable and is a bug and will be fixed in the next release. I just wanted to point out the tab typo.

0 Kudos
Message 6 of 11
(4,024 Views)

Thanks Smiley Happy

0 Kudos
Message 7 of 11
(4,019 Views)

This issue has been reported internally with ID 343157. Just in case you want to track this. It should be fixed soon.

0 Kudos
Message 8 of 11
(4,017 Views)

Hi Mohan,

 

I couldn't find 343157, neither in the current list of known issue here nor in the list of fixed bugs here

0 Kudos
Message 9 of 11
(3,983 Views)

You are correct, it is in neither of those reports. It looks like the bug was accidentally mismarked to not be included in the list. It will update the list again.

 

The bug is fixed in CVI 2012. You should no longer see a crash with this function. Thank you for the feedback.

National Instruments
0 Kudos
Message 10 of 11
(3,974 Views)