02-07-2014 05:44 AM
function that make FatalError is below, error is on *val = atoi(buf), with 32 bits compilation (not able to make 64bit at the moment)
=====
I32 IniGetInteger (
I8 *ficini, ///< nom du fichier INI
I8 *section, ///< section où lire la valeur
I8 *cle, ///< clé dans la section
I32 *val) ///< valeur retournée
{
I8 buf[256]; ///< buffer pour la lecture dans le fichier *.ini
I32 result; ///< valeur retournée
// Lire le nombre entier correspondant à la clé dans la section
//-------------------------------------------------------------
if (LitCleIni(ficini, section, cle, buf, sizeof(buf)) < 1)
{
LogError("INI : Fic(%s) Sect(%s) Clé(%s)", ficini, section, cle);
result= ERR_INI;
}
else
{
*val = atoi(buf);
LogInfos(GRP_ACCES_FICHIERS, "IniGetInteger : File %s, Section %s, Key %s, Integer => %d", ficini, section, cle, *val);
result = NOERR;
}
// Et retour
//----------
return result;
}
=====
This afternoon, I'll look to send you project on your FTP location.
04-23-2014 02:04 AM
Is there something to do?
I'm still working with CVI 13.0.0 (647) as evaluation mode, till I get an official version from purchasing department, and I CAN'T debug my application (DLL louched from Teststand) as I always have a Fatal Error with this message "dereference of a 4 byte obnject where only 1 bytes exist", preventing reaching the place I've to work on.
Please help me.
04-23-2014 03:11 AM
Issue is not always present at each call of function.
It rises up when val=0x30AF4B8 but not at 0x30B0515 nor from 0x30B00BD to 0x30B00111 4 bytes per 4 bytes.
I hope it helps
04-23-2014 07:02 AM
CVI 13.0.1 fixed the problem for me.
04-23-2014 07:34 AM
OK, I'm in touch with NI France to get the appropriate licence that make me able to apply patches: till now I use an evaluation version and can't. The purchase order in in the circuit but a little bit long to reach NI sales dpt 😞
04-25-2014 10:27 AM
I'll get soon the CVI 2013 SP1 and be able to confirm it solves or not this issue.
04-28-2014 01:46 AM
It is better with SP1: I can compile both 32- & 64-bits versions without changing selected libs.
BUT the dereference error remains in debug mode (only) that prevents me to work on the project...
Note: it seems that more warning are delivered and it is a good thing to make the code safer.
04-28-2014 05:41 AM
It's hard to say what the problem might be without knowning how your function is called. Can you post code snippets for the calling function? That is, the function that calls IniGetInteger when you hit the error. Thanks.
Have you tried to disable pointer checking for 'val' before performing the assignment? Obviously, you should not have to do that, it's still a bug in CVI somewhere. But does it allow you to continue working until we find and fix the problem?
#define DISABLE_RUNTIME_CHECKING(ptr) ((ptr) = (void *) ((uintptr_t)(ptr)))
... DISABLE_RUNTIME_CHECKING(val);
*val = atoi(buf);
...
04-28-2014 07:26 AM
See message on 02-07-2014 05:44 AM with code extract.
I'll try your workaround to disable pointer check.
04-28-2014 07:34 AM
I saw the message on 02-07-2014. It's the definition of IniGetInteger, which is useful. But I also need to see how IniGetInteger is called. When you run into the error, can you go up one frame on the stack (Run >> Up Call Stack) and show us what that code looks like?
The problem appears to be that the pointer information for 'val' is incorrect or getting corrupted. It's hard to find out where that may happen without having full access to your source code. (I realize that you may not be allowed to share your code with NI.)