Re: System calls that return file descriptors

2014-05-22 Thread Dmitry V. Levin
On Thu, May 22, 2014 at 07:15:39PM +0530, Zubin Mithra wrote: > On Thu, May 22, 2014 at 7:12 PM, Fiedler Roman wrote: > > > > Von: Zubin Mithra [mailto:[email protected]] > > > > > > Hey everyone, > > > > > > I just had a look around for system calls that return file descriptors > > on a > >

Re: System calls that return file descriptors

2014-05-22 Thread Dmitry V. Levin
On Thu, May 22, 2014 at 08:45:44PM +0530, Zubin Mithra wrote: > I've restructured it a bit more, added in dup* calls, please see commit at > [1] and sample output at [2]. > > [1] > https://github.com/eQu1NoX/strace/commit/3d471ba8fccc531b8bc33b6467644b2d17ba8cc0 > [2] https://gist.github.com/eQu1N

Re: Undefined behavior in decode_select

2014-05-22 Thread Dmitry V. Levin
On Fri, May 23, 2014 at 02:11:54AM +0200, Robert Święcki wrote: > Hi, > > strace will behave in an undefined way (crash under current glibc), if the > fd argument to FD_ISSET() macro is >= FD_SETSIZE. It was fixed by commit v4.8-72-gc2982b5. Thanks for reporting. :) -- ldv pgpHYCHzti_9a.pgp

Undefined behavior in decode_select

2014-05-22 Thread Robert Święcki
Hi, strace will behave in an undefined way (crash under current glibc), if the fd argument to FD_ISSET() macro is >= FD_SETSIZE. I guess, the code needs to check (in decode_select) that nfd (first select's arg) is < FD_SETSIZE. $ cat a.c #include int main(void) { fd_set set; select(1200, &

Re: System calls that return file descriptors

2014-05-22 Thread Zubin Mithra
I've restructured it a bit more, added in dup* calls, please see commit at [1] and sample output at [2]. [1] https://github.com/eQu1NoX/strace/commit/3d471ba8fccc531b8bc33b6467644b2d17ba8cc0 [2] https://gist.github.com/eQu1NoX/ccd6e2f9d45e2e0e82f9 > > There is a receive call, that allows to forw

Re: System calls that return file descriptors

2014-05-22 Thread Zubin Mithra
On Thu, May 22, 2014 at 7:12 PM, Fiedler Roman wrote: > > Von: Zubin Mithra [mailto:[email protected]] > > > > Hey everyone, > > > > I just had a look around for system calls that return file descriptors > on a > > couple of docs[1][2][3] and the ones I could find are `sys_creat` and > > `sys

AW: System calls that return file descriptors

2014-05-22 Thread Fiedler Roman
> Von: Zubin Mithra [mailto:[email protected]] > > Hey everyone, > > I just had a look around for system calls that return file descriptors on a > couple of docs[1][2][3] and the ones I could find are `sys_creat` and > `sys_open`(not looking at the ones that return socket fds right now). Ther

System calls that return file descriptors

2014-05-22 Thread Zubin Mithra
Hey everyone, I just had a look around for system calls that return file descriptors on a couple of docs[1][2][3] and the ones I could find are `sys_creat` and `sys_open`(not looking at the ones that return socket fds right now). The commit that introduces the -yy flag can be found here[4]. The c