ldv changed the topic of #strace to: https://strace.io | https://strace.io/logs/ | strace 4.23 is out | strace-devel@lists.strace.io for dev discussions
pkmoore has joined #strace
pkmoore has quit [Quit: pkmoore]
pkmoore has joined #strace
pkmoore_ has joined #strace
pkmoore has quit [Ping timeout: 245 seconds]
mjw has joined #strace
pkmoore_ has quit [Ping timeout: 276 seconds]
<zhibli> Hi, guys. It's me again :)
<zhibli> Unfortunately I'm stuck again :( so I'm here to ask questions.
<ldv> Go ahead :)
<zhibli> It's about print_get_linger in net.c
<zhibli> I saw line 594: printaddr(addr) is never hit
<zhibli> The condition is if (umoven(tcp, addr, len, &linger) < 0)
<zhibli> At first I think it's because the test doesn't contain an entry like "bad_addr"
<zhibli> But when I tried to follow the code path to see what's really happening
<zhibli> I found this in SYS_FUNC(getsockopt):
<zhibli> f (syserror(tcp) || umove(tcp, tcp->u_arg[4], &rlen) < 0) { printaddr(tcp->u_arg[3]); tprintf(", [%d]", ulen);} ...
<zhibli> And all the test with something like "bad_addr" will hit this condition if I'm not misunderstanding what syserror(tcp) is
<ldv> getsockopt optlen's bad address? yes, I think so
<zhibli> getsockopt optval's bad address is likewise? I've tried and it seems so
<zhibli> which means the following else { print_getsockopt... } will never be hit even if we test optval's bad address
<zhibli> So line 594: printaddr(addr) will not be executed in all conditions
<zhibli> Am I misunderstanding this part?
<ldv> if the kernel consistently fails the syscall when a bad address is specified to getsockopt, then print_get_linger will not be called with a bad address
<ldv> so it's very unlikely for umoven call in print_get_linger to fail
<ldv> it doesn't mean we can assume it will never fail, though
<zhibli> Yes, I agree.
<zhibli> But in what conditions will it fail?
<zhibli> Does "very unlikely" mean that it's not easy to include it into the test suite?
<ldv> Yes, I think so
<zhibli> Ok then I should move forward
<ldv> Definitely
<zhibli> BTW, am I supposed to speed up my pace on coding? Considering I've spent a lot of time on referring to the man pages :(
<zhibli> socket(2) and socket(7) really contain so much stuff
pombreda has joined #strace
<zhibli> I think I need some feedback :)
<ldv> zhibli: you've spent a lot of time reasearching things, it's time to write tests :)
<zhibli> Got it. I'll try my best :)
pombreda has quit [Ping timeout: 240 seconds]
pombreda has joined #strace
pkmoore_ has joined #strace
mjw has quit [Quit: Leaving]