LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Error Messages

Solved!
Go to solution

Hello,

 

I post this message because I have an important problem at a customer.

I develop an application in LabWindows/CVI 9.0 and since a few time the software installed at the customer works and bug at the end of several days (3 or 4 days and somtimes at the end of a week).

The message which appears is a windows error message and indicate me nothing to fond where is the problem.

I made test to the office, in particular in mode debbug, so that the problem re-occurs but this problem don't occur on my computer.

The computer at the customer is our supply, and is installed by myself. When I installed it, I made tests and any problem occured.

 

Have you an idea which could help me please?

 

As attachment error messages.

 

The OS is Windows XP PRO.

 

Thank you. ++

0 Kudos
Message 1 of 6
(3,968 Views)
Solution
Accepted by topic author kalcutt

It looks like the crash might be happening in the strncpy function. Do you call this function from your program? If so, the most likely culprit is that at some point in your program, you're passing invalid values -- either a bad pointer, or a size count that's too large.

 

Since the problem only happens after the program has been running for three days, traditional debugging is not possible. The best strategy might be to add some logging code to your program that outputs to a file (and flushes the output buffer, since you never know when the program might crash) the value of the three parameters that you pass to this function.

 

Luis

0 Kudos
Message 2 of 6
(3,953 Views)

Thanks you a lot!

0 Kudos
Message 3 of 6
(3,919 Views)

Just a last question please, the problem risks to be the same with the function "strcpy"?

0 Kudos
Message 4 of 6
(3,915 Views)

I don't think so. In cvirte.dll, version 9.0.0.355, the address range of the strcpy function is from 0x68521fa0 to 0x68521fd0. The address range of the strncpy function is from 0x68521fd0 to 0x68522020. Since your crash is happening in 0x68521fe4, that places the crash in the strncpy function.

 

More specifically, that particular offset seems to indicate that the pointer passed as the first argument to strncpy is invalid.

 

Now, if you don't call strncpy directly from your code, then you have to start looking at other pre-compiled code modules that your program might be using which might themselves call strncpy. The CVI Programmer's Toolbox is a good example of this. Because this library is open-source, you can take a look at it (toolslib\toolbox\toolbox.c) and see for yourself if some function you call calls strncpy.

 

Other possibilities include static libraries or DLLs that your program might use, if they were built with CVI.

 

Finally, other functions in the CVI ANSI C library also call strncpy. These include strftime, asctime, and strxfrm.

 

Luis

0 Kudos
Message 5 of 6
(3,884 Views)

Hello, I can't send a new message so I write following this one.

 

I have another problem this time with Labwindows/CVI and the communication OPC.

I have to communicate with a plc Phoenix Contact and via AX OPC Server supplied by Phoenix Contact. I can handle the read of the data in the plc but I can't handle the write of the data.

The situation is this one, in the PLC several tables are declared. I have to read tables, that is ok, and I have to write the others tables.

I can't handle the writing of a table so I handle each item of the table. When I create the DSHandle of every item, this declaration returns that is incorrect but if I write this item it works!!! And the plc receives the information and the update of data is made.

I would like to know how write a table if it's possible please ?

Or how to declare the item of a table correctly to have no more error please ? For that it's necessary to create every item in the plc rathet than a table?

 

Thanks.

Best Regards.

Karine.

0 Kudos
Message 6 of 6
(3,736 Views)