PDA

View Full Version : PKH_BOARD_GetInfo ... Memory error ?



gwouite
04-02-09, 05:31 AM
Hello Again,

Here is a part of code :


// GetInfos de la carte
PKH_TBoardInfo Info;
status = PKH_BOARD_GetInfo(*(TPikaHandle*)this->hSystem, &Info);
if (status != PK_SUCCESS) {
Logs::send(1, LOGS_TYPE_PIKA_ISDN_ERR, 0, "Erreur PKH_BOARD_GetInfo !\n Erreur : %#x / %s",-status, PikaAPI::get_Error(status));
return false;
}I execute my program with valgrind (i'm sure you know it), and i have this memory access error :


==17782==
==17782== Syscall param ioctl(generic) points to uninitialised byte(s)
==17782== at 0x40007F2: (within /lib/ld-2.7.so)
==17782== by 0x41843EC: CBoard::getInfo(PKH_TBoardInfo*) (in /usr/lib/libpikahmpapi.so.2.7.5)
==17782== by 0x41ADFC3: PKH_BOARD_GetInfo (in /usr/lib/libpikahmpapi.so.2.7.5)
==17782== by 0x804D6EE: PikaAPI_ISDN_Board::init(void*) (class.PikaAPI_ISDN_Board.cc:132)
==17782== by 0x804CFBC: PikaAPI_ISDN::init() (class.PikaAPI_ISDN.cc:100)
==17782== by 0x804CA9B: PikaAPI::init() (class.PikaAPI.cc:169)
==17782== by 0x804AB4D: main (serveur.cc:225)
==17782== Address 0xbea03770 is on thread 1's stackMaybe it's not important ?

My System Config :
linux 2.6.27-21 on Debian Lenny (5.0)

My Pika Config :
Version : 2.7.5.2
Comment : Standard Build
osVersion : Linux 2.6.27.21-ipv6
On a PCIe Digital Gateway

Best Regards, Guillaume.

gwouite
04-04-09, 04:31 PM
Juste replace


PKH_TBoardInfo Info;

with


PKH_TBoardInfo Info = {0};and the valgrind memory access error disappear ...

Bye !

rboileau
07-31-09, 02:34 PM
Thank you !

Your suggestion has been forwarded to R&D.

Best Regards,