jzebedee / deltaq

Fast and portable delta encoding for .NET in 100% safe, managed code.
Other
40 stars 13 forks source link

(Seemingly) infinite loop on some files #5

Closed Unit2Ed closed 1 year ago

Unit2Ed commented 6 years ago

We're finding that occasionally the delta generator gets stuck on particular files - most complex deltas finish within a few minutes, but in this case I've left it running overnight without result.

It spends hours at a time inside the "for (var scsc = scan += len; scan < newData.Length; scan++)" loop. It seems like the algorithm does progress (as occasionally that loop finishes, and then goes round the while loop again).

The problematic files are both 32MB in size and feature sporadic differences where individual bytes have been changed. I can provide a sample if it'd be useful, but I'm mostly wondering if this is something you've seen before?

kamronbatman commented 3 years ago

Having the same issues with a file that is 136MB and ~200MB. I think this algorithm may not be suitable for the kind of data I have. Or there is an implementation issue.

jzebedee commented 3 years ago

@Unit2Ed @kamronbatman Can you share a sample file to repro?

jzebedee commented 1 year ago

I'd be happy to reopen this if you can find some inputs that trigger the issue. DQ2 fixed several corner cases that were identified from fuzzing in the original bsdiff implementation, so it's possible that it was resolved through that.