* Re: [9front] ip/torrent crash
@ 2019-01-07 12:36 qwx
0 siblings, 0 replies; 6+ messages in thread
From: qwx @ 2019-01-07 12:36 UTC (permalink / raw)
To: 9front
> we want to find the file that the block at "off" belongs to,
> but this block appears to be part of no file at all, so we crash.
>
> off == end means the block is just PAST the file. so changing the
> check from > to >= is wrong.
>
> so this means the block index is wrong. [...]
How about this?
diff -r b048db97b5ea sys/src/cmd/ip/torrent.c
--- a/sys/src/cmd/ip/torrent.c Fri Jan 04 02:51:29 2019 +0100
+++ b/sys/src/cmd/ip/torrent.c Mon Jan 07 13:33:44 2019 +0100
@@ -811,7 +811,8 @@
}
}
}
- havepiece(off / blocksize, w->str);
+ if(off < f->off + f->len)
+ havepiece(off / blocksize, w->str);
havepiece(f->off / blocksize, w->str);
close(fd);
exits(0);
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [9front] ip/torrent crash
@ 2019-01-08 12:24 qwx
0 siblings, 0 replies; 6+ messages in thread
From: qwx @ 2019-01-08 12:24 UTC (permalink / raw)
To: 9front
The torrent completed and was verified successfully.
Pushed.
Thanks for the help!
qwx
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [9front] ip/torrent crash
@ 2019-01-07 16:11 qwx
0 siblings, 0 replies; 6+ messages in thread
From: qwx @ 2019-01-07 16:11 UTC (permalink / raw)
To: 9front
> yeah, that makes more sense.
>
> --
> cinap
I'll push the patch once the torrent downloads and I verify it completed
successfully.
Thanks again for the help!
qwx
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [9front] ip/torrent crash
@ 2019-01-07 15:31 cinap_lenrek
0 siblings, 0 replies; 6+ messages in thread
From: cinap_lenrek @ 2019-01-07 15:31 UTC (permalink / raw)
To: 9front
yeah, that makes more sense.
--
cinap
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [9front] ip/torrent crash
@ 2019-01-07 11:00 qwx
0 siblings, 0 replies; 6+ messages in thread
From: qwx @ 2019-01-07 11:00 UTC (permalink / raw)
To: 9front
> so this means the block index is wrong. can you make a stacktrace
> and see where the block index comes from?
>
> --
> cinap
; ip/torrent -pv < ../idgames_archive.torrent | aux/statusbar idgames
idgames/idgames-2013-07-31.zip
idgames/.____padding_file/0
idgames/idgames_meta.xml
idgames/.____padding_file/2
torrent 18533: suicide: sys: trap: fault read addr=0x18 pc=0x2004a4
; acid 18533
/proc/18533/text:amd64 plan 9 executable
/sys/lib/acid/port
/sys/lib/acid/amd64
acid: lstk()
rwpiece(data=0x42a0b8,len=0x7fff67b5cbe4,index=0xb91,poff=0x7fff00000000,wr=0x400000)+0xa7 /sys/src/cmd/ip/torrent.c:205
n=0x42a0b800000000
havepiece(x=0xb91,from=0x429a3d)+0x91 /sys/src/cmd/ip/torrent.c:225
m=0x42a0b840
p=0x42a0b8
n=0xfeffadf867b5cbe4
hash=0x52200007ffffe
webseed(w=0x429a18,f=0x429c58)+0x1e8 /sys/src/cmd/ip/torrent.c:815
w0=0x429a18
fd=0x20444d0000000b
err=0xb00000000
off=0x2e4400000
len=0x0
buf=0x0
y=0xb9100000b91
o=0xb6800000522
n=0x0
x=0xb91
m=0xb68
p=0x52200000000
main(argc=0x0,argv=0x7ffffeffefa0)+0x8a2 /sys/src/cmd/ip/torrent.c:1376
wlist=0x429a18
alist=0x429838
cflag=0x100000000
vflag=0x100000001
pflag=0x1
sflag=0x204d7900000000
_argc=0x76
_args=0x41a620
s=0x41a805
fd=0x0
p=0x406e38
n=0x70000ed59
torrent=0x418c00
d=0x41a8a0
l=0x429a18
info=0x419420
fp=0x429c58
f=0x429c58
di=0x41a620
len=0x2e4400000
i=0x7
_main+0x40 /sys/src/libc/amd64/main9.s:15
Thanks for the help,
qwx
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [9front] ip/torrent crash
@ 2019-01-07 10:48 cinap_lenrek
0 siblings, 0 replies; 6+ messages in thread
From: cinap_lenrek @ 2019-01-07 10:48 UTC (permalink / raw)
To: 9front
no. this is wrong.
a file goes from:
[start, end)
start = f->off
end = f->off + f->len
we want to find the file that the block at "off" belongs to,
but this block appears to be part of no file at all, so we crash.
off == end means the block is just PAST the file. so changing the
check from > to >= is wrong.
so this means the block index is wrong. can you make a stacktrace
and see where the block index comes from?
--
cinap
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-01-08 12:24 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-07 12:36 [9front] ip/torrent crash qwx
-- strict thread matches above, loose matches on Subject: below --
2019-01-08 12:24 qwx
2019-01-07 16:11 qwx
2019-01-07 15:31 cinap_lenrek
2019-01-07 11:00 qwx
2019-01-07 10:48 cinap_lenrek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).