Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.io.IOException: The current offset on block-info isn't update correct, x!= -1 on 0 #339

Open
Carlos2927 opened this issue Nov 27, 2019 · 16 comments
Assignees
Labels
Milestone

Comments

@Carlos2927
Copy link

1.0.6版本下载报错 java.io.IOException: The current offset on block-info isn't update correct, 609015 != -1 on 0
下载链接:http://www.fyuniot.com:1885/Tools/Down.ashx?Code=93d698e8-674f-4324-8707-9282e8e07802
这个问题之前不是解决了吗 实际上出现这个问题时是下载成功的 我暂时强制做下载成功处理
图片

@rantianhua rantianhua self-assigned this Dec 7, 2019
@rantianhua
Copy link
Collaborator

我会用你给的链接进行尝试。

@rantianhua rantianhua added the bug label Dec 7, 2019
@rantianhua rantianhua added this to the 1.0.7 milestone Dec 7, 2019
rantianhua pushed a commit that referenced this issue Dec 7, 2019
@DaveBoy
Copy link

DaveBoy commented Dec 10, 2019

我也遇到了,主要这个问题有时候会导致我的任务不回调taskend。。。这才尴尬,不然我还可以重试 #348

@equationl
Copy link

同样的问题,但是经过测试,当 compileSdkVersion 和 targetSdkVersion 为29时才会出现这个问题,如果小于29就没有问题。

@zyallday
Copy link

我也遇到了同样的问题 在 targetSdkVersion = 29时(我测试了 compileSdkVersion 29 不会有问题),
下载链接是:http://videostream.iqiyi.com/playback/v/1f252523498440959e0795c29ce7788chttp://videostream.iqiyi.com/playback/v/e1d8cd9c247541be87b1b42bb484e572

如果把targetSdkVersion设置成28 就不会报错了,用master的build 和 1.0.8-SNAPSHOT 依然没有解决

@HolenZhou
Copy link

我也遇到了,app刚适配过Android10, 想引入这个下载库,就遇到这个问题了,而且是必现的,目前fork了来使用

@zhouzhuyuan
Copy link

更具体原因是因为MultiPointOutputStream中的flushProcess中的size和outputStreamMap的size没有对应,导致下标越界了,你把IOException改为Exception可已捕获这个异常,同时由于是在独立的线程池中进行的,所以异常没有继续向外抛。 @rantianhua 大佬麻烦给看看,1.0.6版本,Android 10 分段下载必现

@zhouzhuyuan
Copy link

问题解决了,Android 10 修改了SparseArray,在Android 9 和之前的版本,传入的下标越界不做处理,现在会抛异常了!!!!!

@Carlos2927
Copy link
Author

@rantianhua 几个月了没看到任何提交了 大佬这个库现在没人维护了吗

@HolenZhou
Copy link

是啊,好久没有维护了

@HolenZhou
Copy link

问题解决了,Android 10 修改了SparseArray,在Android 9 和之前的版本,传入的下标越界不做处理,现在会抛异常了!!!!!

请问是如何解决的呢,可以贴下代码吗

@HolenZhou
Copy link

image
应该确实是这里的问题,查看Android29源码的SparseArray在越界时会抛出异常,而28源码的SparseArray在越界时会直接返回0。

在outputStreamMap进行remove时也同时对noSyncLengthMap进行remove,就不会再出现改错误了:
image

@Zhuangyongbing
Copy link

image
应该确实是这里的问题,查看Android29源码的SparseArray在越界时会抛出异常,而28源码的SparseArray在越界时会直接返回0。

在outputStreamMap进行remove时也同时对noSyncLengthMap进行remove,就不会再出现改错误了:
image
我的也是Android9.0然后出现这个数据越界,版本是1.0.7的 请问你们解决问题了?

@liushenming1994
Copy link

1.0.7 Android10下载必现

@mradzinski
Copy link

This is still happening on 1.0.7. The current offset on block-info isn't update correct, 932763 != 4998011 on 0

@vuhomobytelab
Copy link

Confirmed with @mradzinski that still happening on 1.0.7 :(

@buivanlan
Copy link

buivanlan commented Oct 18, 2020

Confirmed with @mradzinski that still happening on 1.0.7 :(

Same me.
I have used :setConnectionCount(1). Current not see message before.

liu-pan pushed a commit to liu-pan/okdownload that referenced this issue Jan 27, 2021
liu-pan pushed a commit to liu-pan/okdownload that referenced this issue Jan 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests