Hello,

While I'm often identifying the issue in our C source (compiled as 64bit on
Linux) I have here a case, which I do not understand and I'd like to ask
for some help. I have below the valgrind warnings and the C-code with
line numbers (from vim). It starts already with the 1st complaint about 
"Invalid write of size 4" on line 2131. There is no code, just the start
of the function with a '{'.

Thanks for some explanations.

        matthias





 2128 PFSTAB FstabInit(
 2129 FSTAB_SetId id                         /* Set-Id fuer die jeweilige FSTAB 
       */
 2130 )
 2131 {
 2132 
/*-------------------------------------------------------------------------*/
 2133     char *funk = "FstabInit()";
 2134 
 2135     /* t_sik_fstab lesePuffer=SIK_FSTAB_EMPTY; */
 2136     DB_ERR        dbError;
 2137     PFSTAB fstab = NULL;         
 2138 
 2139     int anzFstabElemente = 0, anzIndikatorfelder = 0;
 2140     int anzRows = 0;
 2141 
 2142     /* SRP-23121: we read the complete FSTAB into memory because we
 2143      * have to pass twice through it for the logic of indicator fields
 2144      *
 2145      * maybe we should malloc() the space ...
 2146      * the number MAX_FSTAB_ROWS is the limit for one set in FSTAB
 2147      */
 2148     t_sik_fstab myFSTABrows[MAX_FSTAB_ROWS];
 2149 
 2150     /* check  the SetId                            */
 2151     if( id == FSTAB_Null || id >= FSTAB_Alle ) goto ABBRUCH;
 2152 
 2153     /* init the buffer for read                    */
 2154     memset( &myFSTABrows[anzRows], 0, sizeof( t_sik_fstab ));
 2155 


---------------------------

==9332== Invalid write of size 4
==9332==    at 0x9DE90EF: FstabInit (BKFstab.c:2131)
==9332==    by 0x6BFF1E8: OpsInitDatabase (SRVServerInit.c:1299)
==9332==    by 0x413B48: SlnpInitDaemon (OPDaemon.c:738)
==9332==    by 0x413657: main (OPDaemon.c:272)
==9332==  Address 0xffed476bc is on thread 1's stack
==9332==  in frame #0, created by FstabInit (BKFstab.c:2131)
==9332==
==9332== Invalid read of size 4
==9332==    at 0x9DE911D: FstabInit (BKFstab.c:2151)
==9332==    by 0x6BFF1E8: OpsInitDatabase (SRVServerInit.c:1299)
==9332==    by 0x413B48: SlnpInitDaemon (OPDaemon.c:738)
==9332==    by 0x413657: main (OPDaemon.c:272)
==9332==  Address 0xffed476bc is on thread 1's stack
==9332==  in frame #0, created by FstabInit (BKFstab.c:2131)
==9332==
==9332== Invalid read of size 4
==9332==    at 0x9DE912A: FstabInit (BKFstab.c:2151)
==9332==    by 0x6BFF1E8: OpsInitDatabase (SRVServerInit.c:1299)
==9332==    by 0x413B48: SlnpInitDaemon (OPDaemon.c:738)
==9332==    by 0x413657: main (OPDaemon.c:272)
==9332==  Address 0xffed476bc is on thread 1's stack
==9332==  in frame #0, created by FstabInit (BKFstab.c:2131)
==9332==
==9332== Invalid write of size 8
==9332==    at 0x9DE915A: FstabInit (BKFstab.c:2154)
==9332==    by 0x6BFF1E8: OpsInitDatabase (SRVServerInit.c:1299)
==9332==    by 0x413B48: SlnpInitDaemon (OPDaemon.c:738)
==9332==    by 0x413657: main (OPDaemon.c:272)
==9332==  Address 0xffed47688 is on thread 1's stack
==9332==  in frame #0, created by FstabInit (BKFstab.c:2131)
==9332==
==9332== Invalid write of size 8
==9332==    at 0x4C305C7: memset (vg_replace_strmem.c:1224)
==9332==    by 0x9DE915E: FstabInit (BKFstab.c:2154)
==9332==    by 0x6BFF1E8: OpsInitDatabase (SRVServerInit.c:1299)
==9332==    by 0x413B48: SlnpInitDaemon (OPDaemon.c:738)
==9332==    by 0x413657: main (OPDaemon.c:272)
==9332==  Address 0xffed476c0 is on thread 1's stack
==9332==  in frame #1, created by FstabInit (BKFstab.c:2131)
==9332==
==9332== Invalid write of size 1
==9332==    at 0x4C305E0: memset (vg_replace_strmem.c:1224)
==9332==    by 0x9DE915E: FstabInit (BKFstab.c:2154)
==9332==    by 0x6BFF1E8: OpsInitDatabase (SRVServerInit.c:1299)
==9332==    by 0x413B48: SlnpInitDaemon (OPDaemon.c:738)
==9332==    by 0x413657: main (OPDaemon.c:272)
==9332==  Address 0xffed47a70 is on thread 1's stack

-- 
Matthias Apitz, ✉ g...@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub
What is a good definition for Legacy Software? -- This is one which works.


_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to