-
-
Notifications
You must be signed in to change notification settings - Fork 723
Revise sequential access in resampling operations #4643
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
base: master
Are you sure you want to change the base?
Conversation
f570895 to
3037cb3
Compare
|
The fuzzer bug reported https://github.com/libvips/libvips/actions/runs/17152025286/job/48660246466 is quite interesting. It seems that the removal of the seq hint in libvips/libvips/iofuncs/buffer.c Lines 484 to 494 in 9cc54a0
At first, I thought this would be an easy fix (see commit baf91e4), but it turned out to confuse FFTW's SIMD alignment checks, which I worked around in commit f570895. Unfortunately, crashes still occur in certain cases, for example: $ vips black crash1.pgm 1 70
$ ./build/fuzz/thumbnail_fuzzer -rss_limit_mb=2560 -timeout=25 -runs=100 ./crash1.pgm < /dev/nulli.e. we can't guarantee that I dropped the previous mentioned commits in favor of commit 3037cb3, but still need to verify whether that is safe on all targets. |
|
Note to self: the Details--- a/libvips/iofuncs/object.c
+++ b/libvips/iofuncs/object.c
@@ -1883,11 +1883,7 @@ vips_object_set_argument_from_string(VipsObject *object,
if (VIPS_IS_OPERATION(object))
flags = vips_operation_get_flags(VIPS_OPERATION(object));
- if (flags &
- (VIPS_OPERATION_SEQUENTIAL_UNBUFFERED | VIPS_OPERATION_SEQUENTIAL))
- access = VIPS_ACCESS_SEQUENTIAL;
- else
- access = VIPS_ACCESS_RANDOM;
+ access = VIPS_ACCESS_SEQUENTIAL;
if (!value) {
vips_object_no_value(object, name);
@@ -1962,11 +1958,7 @@ vips_object_set_argument_from_string(VipsObject *object,
flags = vips_operation_get_flags(
VIPS_OPERATION(object));
- if (flags &
- (VIPS_OPERATION_SEQUENTIAL_UNBUFFERED | VIPS_OPERATION_SEQUENTIAL))
- access = VIPS_ACCESS_SEQUENTIAL;
- else
- access = VIPS_ACCESS_RANDOM;
+ access = VIPS_ACCESS_SEQUENTIAL;
if (!(array_image =
vips_array_image_new_from_string(value, access)))Still causes out-of-order read on the CLI: $ vips black x.jpg 10000 10000
$ VIPS_STALL=1 vips reducev x.jpg x.v 2 --vips-concurrency 6
vips_worker_work_unit: stall done, releasing y = 0 ...
(vips:15934): VIPS-WARNING **: 11:46:24.438: error in tile 0 x 248
(vips:15934): VIPS-WARNING **: 11:46:24.438: error in tile 0 x 256
(vips:15934): VIPS-WARNING **: 11:46:24.438: error in tile 0 x 264
(vips:15934): VIPS-WARNING **: 11:46:24.438: error in tile 0 x 272
(vips:15934): VIPS-WARNING **: 11:46:24.438: error in tile 0 x 280
(vips:15934): VIPS-WARNING **: 11:46:24.438: error in tile 0 x 288
vips_worker_work_unit: stall done, releasing y = 0 ...
VipsJpeg: out of order read at line 776 |
3037cb3 to
c7d4360
Compare
More testing is needed, so opened as a draft.
Resolves: #2757.