LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Insane editor bug

Hello all,
I've updated to CVI 2010 yesterday and I stumbled upon a crazy bug. Or if
it's an intended behavior, you REALLY have to explain it to me...

I often use Ctrl-Y to remove entire lines from source code.
When I do so, the editor adds random lines from the file at the end of the
file, and those lines do not show up in the editor (even if I close and
reopen the file) and do not cause errors when I compile with CVI.

But when I try to compile with an external compiler I get crazy errors (hey,
just look at what got added on the example below) and I can see the added
lines in any other editor.

....
CHECK(SetGpio(XPAR_XPS_GPIO_CONFIG_SYS_DEVICE_ID, ...);
[I removed the line here which was the same as below with Ctrl-Y]
CHECK(SetGpio(XPAR_XPS_GPIO_CONFIG_SYS_DEVICE_ID, ...);
}

int SaveBufferFromGpio(void) {
int N=0, St;

if (!Running) { Status=STATUS_UNDEF; return 0; }
SimpleLog_Write(SL_DBG, "Enter");

errno=0;
N=GetBufferFromXad(XadFd, &St);

if (St>0) Overruns+=St;

if (N <0) { Status=STATUS_ERROR; return -1; }
else if (N==0) Status=STATUS_UNDEF; // Timeout
else Status=STATUS_RUNNING;

TotalBlocks += N; // If incomplete, we still count it

return N;
} [This is the normal end of my code]
ING;

TotalBlocks += N; // If incomplete, we still count it

return N;
}

I should add that the files are on a network drive.
--
Guillaume Dargaud
http://www.gdargaud.net/
0 Kudos
Message 1 of 4
(2,768 Views)

Hello Guillaume -

 

I've tried a couple different times now, and I haven't yet been able to reproduce what you're reporting.  Could you attach a file and give instructions on which lines to cut to reproduce what you're seeing?  I'll keep trying in the meantime.


NickB

National Instruments

0 Kudos
Message 2 of 4
(2,756 Views)
> I've tried a couple different times now, and I haven't yet been able to
> reproduce what you're reporting.&nbsp; Could you attach a file and give
> instructions on which lines to cut to reproduce what you're seeing?&nbsp;
> I'll keep trying in the meantime.

Hmmm. OK, I start with a [Insert construct] generated main file, where I do
Ctrl-Y on the return line. I end up with:

$ cat TestEditorBug.c
#include <cvirte.h>

int main (int argc, char *argv[]) {
if (InitCVIRTE (0, argv, 0) == 0)
return -1; /* out of memory */

}
turn 0;
}

Which doesn't show up in the CVI editor. I can compile fine.
If I Ctrl-Z and save, the file returns to its original normal state.

Doing Ctrl-Y on the blank line before the return leads to:

$ cat TestEditorBug.c
#include <cvirte.h>

int main (int argc, char *argv[]) {
if (InitCVIRTE (0, argv, 0) == 0)
return -1; /* out of memory */
return 0;
}
}

Doing it on the 1st line:

$ cat TestEditorBug.c

int main (int argc, char *argv[]) {
if (InitCVIRTE (0, argv, 0) == 0)
return -1; /* out of memory */

return 0;
}
/

return 0;
}

Doing Ctrl-Y on every line of the file, starting from the 1st one:

$ cat TestEditorBug.c
#include <cvirte.h>

int main (int argc, char *argv[]) {
if (InitCVIRTE (0, argv, 0) == 0)
return -1; /* out of memory */

return 0;
}

(this should be an empty file !!!)

I can reproduce this every time.

My setup is a bit complex:
- CVI runs into a WinXP inside a VirtualBox virtual machine
- The PC running virtualbox 4.0.8 is Ubuntu 11.04.
- the folder where the project sits is on an NFS server
The CVI UIR editor is actually the _only_ reason why I still use Windows at
all.

If I save the file on the VirtualBox filesystem, the problem doesn't arise.
If I save it through virtualbox on the Linux filesystem (local, non NFS),
the problem arises.

There must be some truncation problem that fails through VirtualBox, maybe
not CVI's fault but I don't really know how to test that with other apps.

--
Guillaume Dargaud
http://www.gdargaud.net/
0 Kudos
Message 3 of 4
(2,732 Views)

Hello Guillaume -

 

I've successfully reproduced what you're seeing.  I've created bug report 299976 for further investigation.  At this point, it's unclear who or what is at fault for the file corruption, but it looks like it only happens for certain types of network shares.  For instance, I'm hosting a Win 7 guest OS from a Win 7 host OS with Virtual Box, and if I 'Share' one of the host folders through Win 7, I can access that share in the guest OS and I do not see the problem.  Hopefully you can find a similar method of sharing in the meantime (maybe Dropbox would work for you?) as we investigate this issue.

 

Sorry for any inconvenience -

 

NickB

National Instruments

0 Kudos
Message 4 of 4
(2,723 Views)