07-16-2018 08:15 AM
there are no shortcuts.
Just files and folders.
Can you please run my vis on your enviroinmnent?
Just create a folder in a NAS with some subfolders and some files.
Now I will try to log to file, and I will upload.
If you don't run my VIs , we can't solve it, because I keep getting the bug.
If I won't solve it , I will need to use .net dll to do that (the code in the link works in any case)
07-16-2018 09:08 AM
This is with log.
Bug still present.
Somehow LV recurse indefinitely.
There is a clear stop recursion condition in my code.
The same code runs DIFFERENTLY with local folder input and share folder input.
07-16-2018 09:23 AM
Hi Ironman,
This is with log. Bug still present.
Surely the bug is not solved by implementing a log function…
Somehow LV recurse indefinitely. There is a clear stop recursion condition in my code.
The same code runs DIFFERENTLY with local folder input and share folder input.
The point is: at which folder/file does your routine start to recurse forever?
Can you recognize a pattern?
What is stored in your log? (Can you attach the log?)
I cannot run your VI due to missing OGTK subVIs. I haven't installed OpenG and will not do…
07-16-2018 09:58 AM
Maybe there is some unhandled file error that is keeping your code to end the recursion from executing? (Maybe you never see the error because LV crashes out first.)
07-16-2018 10:44 AM
This is the "File Exists_OGTK.vi" code. You can just replace it , you dont' need OpenG.
In the Log I append record of { time , SourceFilePath , DestFilePath } after a successfull copy.
What I see in the Log is this:
I am using .NET dll call as workaround now, if someone of you can forward my VIs to NI, they can test my code, I am 99,9% sure it's a serious NI bug.
It's a AAA bug critical 😄
thanks and have a nice day
07-16-2018 11:02 AM
Well so far we know that you have a Windows 2016 Server, a Windows 10 client build 1803 and that if you access a shared directory of the server you will get a crash. And if you reconstruct the Copy yourself you see that it keeps looping on the same three files.
To call this a LabVIEW bug is still kind of premature. Apparently something in your server config makes the Windows API that LabVIEW calls return the same three files over and over again. There might be a factor that causes LabVIEW to misbehave but the root cause seems more in something in the new Windows build that makes the Windows APIs FindFirstFile() and FindNextFile() misbehave for the path in question. There might be no shortcut files (which are really old Windows 95 workarounds for missing proper symlinks in the OS) but there might be still symlinks (NTFS junction points) in the server that create a recursive directory list.
You keep shouting here and claim lots of things but you have not delivered substantial evidence that has been repeatedly asked from you, such as the log file you say shows what is happening. And my preliminary tests after Microsoft finally frocefully pushed on me its latest Windows update yesterday have not evidenced the behaviour you see, so that is another indication that it has to do something that is specific to your server configuration.
07-16-2018 12:08 PM
07-16-2018 02:30 PM - edited 07-16-2018 02:37 PM
I'm about 99.99% sure that the included modification to your DirectoryCopy.vi will fix the issue for your LabVIEW VI, though it won't fix the LabVIEW built in Copy File function. Personaly I would avoid the recursive VI call altogether and rather build a stack of directory paths to enumerate and at each iteration add the directory entries from List Folder to that stack. Such stack based operation may seem more trouble at first but usually are not more complicated to build, and a lot easier to debug and control.
The problem that here happens is that Windows used to return the "current directory" entry (.) and the "parent directory" entry (..) always as the first two entries when enumerating directory entries and the LabVIEW List Directory function filters them as they make no sense to be returned in the list of directories. But this filtering assumed that those entries are always returned as the first two entries. Samba served file systems seem to break that assumption as they can easily provide other file entries that start with a non-alphanumeric character that can happen to be alphabetically sorted before those "current directory" and "parent directory" entries. Maybe something in your system setup also causes this to occur for your Windows 2016 server share.
Since the recursive File Copy variant internally makes use of the same List Folder function that the according List Folder node uses, it is also prone to this problem.
NI seems to have fixed that in either LabVIEW 2016 or 2017 as evidenced in this post. So upgrading your LabVIEW version is another option to even make the File Copy node work for your setup. The crash in the LabVIEW File Copy function is not because the function is recursively calling itself, which it isn't, but at each iteration it adds the current directory entry to the stack of paths to enumerate so that that stack will keep growing and eventually LabVIEW runs into a fatal out of memory error.
Of course if you had gone debugging the VI even for a few iterations you would easily have seen that there is most likely a "." entry returned as file directory and the LabVIEW path functions interprete that as the same directory as the path without this "." file name.
07-17-2018 04:43 AM
thanks to rolfk for taking the time to run my code!
I really missed the [.] and [..] return values!
that explains why it keeps recurring, and your modified vi fixed, now it's working.
So copy.vi can be used to copy single files even from network.
IT IS STILL BUGGED FOR RECURSION THOUGH up to LV2018
As far as the "server side" goes, nothing was changes in months.
The same server, the same OS server, never changed.
And it had always worked (windows 10 before 1803 + LV 2015)
The bug is not in windows, it's on NI side, because Microsoft will never change the OS for this, it's 3rd party apps that follow the new OS API.
So put some C++ code inside your LabVIEW , like if (OSversion)>=1803)
and deliver an update.
I don't know why you said I don't give evidence.
I showed evidences, if you read what I wrote.
I had a working VI with a working server, I updgrade my windows, it breaks.
It's not rocket science, it's something changed in LV or Windows workstation 1803 (99,9%).
Labview should be fixed to better support 1803.
The server side is not changed. It's Windows API that gave different result to lower level code, and lower level LV code gave a different result.
That's it.
At this point we have a Copy.vi that doesn't do what it claims
Quoting from NI Help file
"Copy Function
If you copy a directory, this function copies all its contents recursively to the new location."
---> PRETTY MUCH FALSE LOL, it crash
07-17-2018 05:26 AM - edited 07-17-2018 05:33 AM
Did you really test with LabVIEW 2018? According to the link I gave in my previous post, the issue with Samba served shares from Linux computers was not present in 2017 and 2018 anymore.
As to who is the bad guy, this obviously started to break for you due to Windows 10 build 1803. Your claim that Microsoft is not going to fix this is possibly not right because there are likely other much bigger fish than NI who somehow and somewhere, relied on this behaviour and will scream fire and war at Microsoft for this. Back in 1992 when large parts of the low level system interfaces in LabVIEW were developed to work on the various platforms, this kind of assumption about the workings of FindFirstFile() and FindNextFile() in the Windows API was actually present in example code from Microsoft. It also prevented the code from having to compare at every iteration of FindNextFile() if it was one of the special directory entries and such string comparisons done in a loop lots and lots of times was considered very CPU costly at that time.
Sure NI can and probably will improve the code, if they haven't already done as indicated in the other link, to make the code more stable in general but breaking API functionality is always a bad thing, even if it is sometimes unavoidable. In this case I doubt it is unavoidable but probably due to some optimization either intentionally or because of a different compiler setting when they build Windows 10 or a certain part of it.
Considering that Windows 10, Build 1803 was officially released on July 7, 2018, the right course of action would be to POLITELY report this to NI as a bug report , and not to scream in a public forum that this is a scandalous bug.