[so] Tema 4 linux bizar!!!!

cosminratiu at gmail.com cosminratiu at gmail.com
Sat Dec 16 14:31:43 EET 2006


Aici e problema:
140             bzero( &str_read, sizeof (struct aiocb));
Presupun ca str_read e un pointer, caz in care tu faci 0 memoria incepand cu
pointerul str_read, nu cu zona de memorie spre care pointeaza el.
Scoate &.



On 12/16/06, Vladimir <vtanasiev at gmail.com> wrote:
>
> O mica problema, clientul trimite serverului o structura creata de mine.
> Intrebarea mea este cum e posibil sa se intample urmatoarea chestie
> constatata cu ajutorul debugerului
> 139             struct aiocb *List=str_read;
> (gdb) display file_name
> 1: file_name = 0xbfbe95f0 "Makefile"
> (gdb) step
> 140             bzero( &str_read, sizeof (struct aiocb));
> 1: file_name = 0xbfbe95f0 "Makefile"
> (gdb) step
> 142             str_read->aio_fildes=open(file_name,O_RDONLY,0644); /*
> File descriptor. */
> 1: file_name = 0x0         -> dupa care imi da segmentation fault.
>
> unde Makefile reprezinta fisierul care trebuie deschis.
>
> _______________________________________________
> so mailing list
> so at cursuri.cs.pub.ro
> http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/so
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cursuri.cs.pub.ro/pipermail/so/attachments/20061216/1391ed17/attachment.htm


More information about the so mailing list