You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When tile extraction is performed with a high thread count, segmentation faults are common. Traceback highlights the fault as originating in slide/__init__.py, line 729:
region = region.resize(float(self.size_px) / self.extract_px)
Tracing the call through a debugger identifies vips/voperation.py, line 290 as the culprit:
#1 0x00007fc9b55e3859 in __GI_abort () at abort.c:79
#2 0x00007fc9b564e3ee in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7fc9b5778285 "%s\n") at ../sysdeps/posix/libc_fatal.c:155
#3 0x00007fc9b565647c in malloc_printerr (str=str@entry=0x7fc9b577a670 "double free or corruption (out)") at malloc.c:5347
#4 0x00007fc9b5658120 in _int_free (av=0x7fc9b57a9b80 <main_arena>, p=0x7fc85c057fb0, have_lock=<optimized out>) at malloc.c:4314
#5 0x00007fc87cf056c5 in vips_cache_trim () at cache.c:775
#6 0x00007fc87cf05f44 in vips_cache_operation_add (operation=<optimized out>) at cache.c:879
#7 0x00007fc87cf06080 in vips_cache_operation_buildp (operation=0x7fc8f2ffb460) at cache.c:921
#8 vips_cache_operation_buildp (operation=operation@entry=0x7fc8f2ffb460) at cache.c:894
#9 0x00007fc87cf0c44d in vips_call_required_optional (operation=operation@entry=0x7fc8f2ffb460, required=required@entry=0x7fc8f2ffb490, optional=optional@entry=0x7fc8f2ffb570)
at operation.c:880
#10 0x00007fc87cf0cb77 in vips_call_by_name
(operation_name=<optimized out>, option_string=option_string@entry=0x0, required=required@entry=0x7fc8f2ffb490, optional=optional@entry=0x7fc8f2ffb570) at operation.c:920
#11 0x00007fc87cf0cfe0 in vips_call_split (operation_name=operation_name@entry=0x7fc87cf41e0c "shrinkh", optional=optional@entry=0x7fc8f2ffb570) at operation.c:1024
#12 0x00007fc87cdddbcb in vips_shrinkh (in=in@entry=0x7fc84c3f54d0, out=out@entry=0x7fc84c3f3898, hshrink=hshrink@entry=2) at shrinkh.c:367
#13 0x00007fc87cddaa2a in vips_resize_build (object=0x7fc79828e2d0) at resize.c:195
#14 0x00007fc87cef9c8d in vips_object_build (object=0x7fc79828e2d0) at object.c:367
#15 0x00007fc87cf06070 in vips_cache_operation_buildp (operation=0x7fc8f2ffb718) at cache.c:918
#16 vips_cache_operation_buildp (operation=0x7fc8f2ffb718) at cache.c:894
#17 0x00007fc87cf060c0 in vips_cache_operation_build (operation=<optimized out>) at cache.c:948
#18 0x00007fc882952dec in ffi_call_unix64 () at /home/shawarma/venv/lib/python3.8/site-packages/cffi.libs/libffi-806b1a9d.so.6.0.4
#19 0x00007fc882951f55 in ffi_call () at /home/shawarma/venv/lib/python3.8/site-packages/cffi.libs/libffi-806b1a9d.so.6.0.4
#20 0x00007fc882b74a96 in cdata_call (cd=0x7fc95722e330, args=<optimized out>, kwds=<optimized out>) at c/_cffi_backend.c:3153
The issue appears to be that the vips resize() method is somehow thread unsafe. I think the libvips operation cache may be the core issue.
I have confirmed that disabling the resize() call in line 729 of slide/__init__.py prevents the segmentation faults.
Setting pyvips.cache_set_max(0) does not fix the issue.
Using thumbnail instead of resize does seem to fix the segmentation faults. Will need to test to assure quality between resize() and thumbnail() is appropriately comparable before resolving the issue and pulling into master.
When tile extraction is performed with a high thread count, segmentation faults are common. Traceback highlights the fault as originating in
slide/__init__.py
, line 729:region = region.resize(float(self.size_px) / self.extract_px)
Tracing the call through a debugger identifies
vips/voperation.py
, line 290 as the culprit:vop = vips_lib.vips_cache_operation_build(op.pointer)
Which gives the following backtrace:
The issue appears to be that the vips resize() method is somehow thread unsafe. I think the libvips operation cache may be the core issue.
I have confirmed that disabling the
resize()
call in line 729 ofslide/__init__.py
prevents the segmentation faults.Things to try include:
pyvips.cache_set_max(0)
(per Segmentation fault (core dumped) from pyvips libvips/pyvips#41)thumbnail
instead ofresize
The text was updated successfully, but these errors were encountered: