On Fri, Oct 9, 2009 at 5:39 PM, Holger Kiehl <Holger.Kiehl@xxxxxx> wrote: > Hello Manish > > First, sorry for the late responce! > > On Wed, 7 Oct 2009, Manish Katiyar wrote: > >> On Wed, Oct 7, 2009 at 7:51 PM, Holger Kiehl <Holger.Kiehl@xxxxxx> wrote: >>> >>> Hello Manish >>> >>> On Wed, 7 Oct 2009, Manish Katiyar wrote: >>> >>>> Hi Holger, >>>> >>>> I don't have the source code, so a bit hard to guess. But you can try >>>> to find out which member of your fsa structure is at offset 236 (0xec) >>>> and look around those lines in the function where you are accessing >>>> that member. >>>> >>>> I am trying to download the AFD source code, which looks like it will >>>> take ages on my slow broadband. Hopefully I can help after that. >>>> >>> If you download, please take afd-1.4.0-0.20.beta.tar.bz2 because that >>> is the one that caused the error. You can get it from: >>> >>> ftp://ftp.dwd.de/pub/afd/development/afd-1.4.0-0.20.beta.tar.bz2 >>> >>> You will find the relevant code in src/fd.c. >> >> Hi Holger, >> >> (gdb) set $offset = (int)(&((struct filetransfer_status *)0)->host_status) >> (gdb) p $offset >> $5 = 236 >> (gdb) p/x 236 >> $6 = 0xec >> >> host_status is at offset 236. In the function start_process I can see >> that this is used at places by dereferencing below >> "fsa[fsa_pos].host_status ". >> >> At this point my guess would be that you are getting fsa_pos as >> something illegal ie.. probably you are trying to access beyond the >> array. Since this is an input to the function, you can just check its >> value at the start and assert if that is ok and within reasonable >> range. >> >> HTH >> > Many thanks for finding this out! I think I now, with your help, have a > clue where the error could be. Is there a way to find out what value > fsa_pos had at that time? Since it is a runtime variable, probably we can get something by looking at the output of "info registers". But you can try putting if (fsa_pos <0 ) { printf("going to die ... \n"); return } in the start of the function itself and try. > If it was -1 then it is definitely the error > I am thinking of, but if it is something else then I don't know. > > Again many thanks for the valuable help! > > Regards, > Holger -- Thanks - Manish ================================== [$\*.^ -- I miss being one of them ================================== -- To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html