Re: Memory management for io_read(), etc.

2021-04-24 Thread Samuel Thibault
Andrew Eggenberger, le sam. 24 avril 2021 17:29:23 -0500, a ecrit: > Thanks! But now I'm getting a segfault when I try to vm_deallocate. It seems > to > be the result of calling memchr on the vm_allocated buffer. Here is the > function that calls memchr: Where is the segfault exactly? Are you sur

Re: Memory management for io_read(), etc.

2021-04-24 Thread Andrew Eggenberger
Thanks! But now I'm getting a segfault when I try to vm_deallocate. It seems to be the result of calling memchr on the vm_allocated buffer. Here is the function that calls memchr: int binaryfilep(char* buf) { return memchr(buf, '\0', 1024) != NULL; } if I change it to int binaryfilep(char* buf

Re: Memory management for io_read(), etc.

2021-04-24 Thread Samuel Thibault
Andrew Eggenberger, le sam. 24 avril 2021 16:06:25 -0500, a ecrit: > Thanks Samuel. So if I'm understanding correctly, if I let the RPC vm_allocate > () filebuf I don't need to worry about vm_deallocating it? You have to vm_deallocate() it, otherwise it'll leak. > And if I wanted to pass a buffer

Re: Memory management for io_read(), etc.

2021-04-24 Thread Andrew Eggenberger
Thanks Samuel. So if I'm understanding correctly, if I let the RPC vm_allocate() filebuf I don't need to worry about vm_deallocating it? And if I wanted to pass a buffer in and reuse it, I should use vm_allocate() instead of malloc()? *Andrew Eggenberger*

Re: Memory management for io_read(), etc.

2021-04-24 Thread Samuel Thibault
Andrew Eggenberger, le jeu. 22 avril 2021 20:37:02 -0500, a ecrit: > But when I try to do the same in my translator, I get a "free(): invalid > pointer" > error. Here is the relevant portion of my code. > >       filebuf = malloc(s.st_size + 1); >       err = io_read(innerdir, &filebuf, &amt_writt

Re: [PATCH] Explain how to access data returned from dir_readdir

2021-04-24 Thread Samuel Thibault
Andrew Eggenberger, le ven. 23 avril 2021 07:12:22 -0500, a ecrit: > I see your point. But this is more about the hurd-specific nature of > dir_readdir than the dirent struct. readdir in glibc returns one dirent at a > time, not something called an array that can’t be reliably treated as one. > Tha

Re: pci arbiter being killed

2021-04-24 Thread Joan Lledó
El 17/4/21 a les 12:44, Damien Zammit ha escrit: Can you try rebasing on master and see if you have the same issues? After merging the last changes the arbiter hangs at startup, so it doesn't live enough to be killed. I think it's probably another effect of the same bug in my version of

Re: pci arbiter being killed

2021-04-24 Thread Joan Lledó
El 17/4/21 a les 14:14, Samuel Thibault ha escrit: Do you mean that without your changes there is no pci arbiter kill? Yes