Project

General

Profile

Feature #10541

[musl libc, Alpine Linux] darktable seg faults when importing a folder or images

Added by Scrumpy Jack about 4 years ago. Updated over 2 years ago.

Status:
Fixed
Priority:
High
Assignee:
Category:
-
Target version:
Start date:
06/18/2015
Due date:
% Done:

100%

Affected Version:
git master branch
System:
other GNU/Linux
bitness:
64-bit
hardware architecture:
amd64/x86

Description

============== build options ===============

./build.sh  \
--buildtype RelWithDebInfo \
--prefix /usr \
--disable-flickr \
--disable-gnome-keyring \
--disable-kwallet \
--disable-unity

============== backtrace =================

Program received signal SIGSEGV, Segmentation fault.
[Switching to LWP 10353]
0x00006fea87a1ffda in ?? ()
(gdb) bt
#0 0x00006fea87a1ffda in ?? ()
#1 0x0000000000000000 in ?? ()

============= core dump ==================

http://st.ilet.to/dt.core

Can provide more information if needed of course.

Associated revisions

Revision f572a27b
Added by Roman Lebedev almost 3 years ago

Merge remote-tracking branch 'upstream/pr/1276'

Dont be so stack greedy.

Reduces stack pressure.
Right now this only fixes unbound stack usage.

No more unbound stack-based VLA's - mostly via -Wstack-usage
After previous step, i looked at the -Wvla output, and almost none of
them should actually be VLA, so i enabled -Wvla too and fixed the code.
This is a preparatory work to support running on Musl libc. (pr #1086,
refs #10541)
It has default Thread stack size of 80k.

There will be next steps.

  • upstream/pr/1276: (72 commits)
    CMake: make -Wvla warning a error.
    dt-chart: thinplate_match(): ignore VLA for now
    Png format: read_header(): no need for VLA. use #define
    Colormapping iop: kmeans(): ignore VLA for now
    Colortransfer iop: kmeans(): ignore VLA for now
    Clahe iop: process(): no need for VLA. use #define
    Denoiseprofile iop: process_wavelets(): no need for VLA. use #define
    Metadata view lib: _metadata_view_update_values(): no need for VLA.
    Recentcollect lib: _lib_recentcollection_updated(): no need for VLA.
    Focus: dt_focus_draw_clusters(): use malloc(), not VLA
    Cups_print: dt_get_papers(): no need for VLA.
    Imageio png: read_header(): no need for VLA. use #define
    CMake: let's also enable -Wvla
    CMake: make stack/object size warning a error.
    dt-view: don't do unbound stack-based VLA's
    dt-chart: thinplate: thinplate_match(): don't do unbound stack-based VLA's
    dt-chart: thinplate: solve(): don't do unbound stack-based VLA's
    dt-chart: parse_cht(): don't do unbound stack-based VLA's
    dt-chart: process_data(): don't do unbound stack-based VLA's
    dt-g-c: don't do unbound stack-based VLA's
    ...

Revision df9ccff5
Added by Roman Lebedev almost 3 years ago

Increase stack / thread size to pre-defined limit. Refs #10541

Loosely based on PR #1086.

Revision 62bf1ecd
Added by Roman Lebedev almost 3 years ago

Merge pull request #1293 from LebedevRI/specify-stacksize

Increase stack / thread size to pre-defined limit. Fixes #10541

History

#1 Updated by Roman Lebedev about 4 years ago

  • Status changed from New to Incomplete
  • % Done changed from 0 to 20

A backtrace would be much more useful

#2 Updated by Scrumpy Jack about 4 years ago

I'm attempting to build against musl libc and for Alpine Linux

#3 Updated by Roman Lebedev about 4 years ago

  • Subject changed from darktable seg faults when importing a folder or images to [musl libc, Alpine Linux] darktable seg faults when importing a folder or images

#4 Updated by Scrumpy Jack about 4 years ago

=============== extend bt ================

Reading symbols from /usr/bin/darktable...done.
[New LWP 23029]
[New LWP 23030]
[New LWP 23034]
[New LWP 23032]
[New LWP 23031]
[New LWP 23048]
[New LWP 23045]
[New LWP 23028]

warning: Can't read pathname for load map: No error information.
Core was generated by `darktable'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00006e09ae0b8fda in dt_imageio_export_with_flags (imgid=imgid@entry=1, filename=filename@entry=0x6e09ae24cbd9 "unused",
format=format@entry=0x6e09ae781bf0, format_params=format_params@entry=0x6e09ae781b50, ignore_exif=ignore_exif@entry=1,
display_byteorder=display_byteorder@entry=1, high_quality=high_quality@entry=0, thumbnail_export=thumbnail_export@entry=1,
filter=filter@entry=0x0, copy_metadata=copy_metadata@entry=0, storage=storage@entry=0x0, storage_params=storage_params@entry=0x0)
at /home/scrumpyjack/builds/darktable/src/darktable-1.6.7/src/common/imageio.c:625
625 /home/scrumpyjack/builds/darktable/src/darktable-1.6.7/src/common/imageio.c: No such file or directory.
(gdb) bt
#0 0x00006e09ae0b8fda in dt_imageio_export_with_flags (imgid=imgid@entry=1, filename=filename@entry=0x6e09ae24cbd9 "unused",
format=format@entry=0x6e09ae781bf0, format_params=format_params@entry=0x6e09ae781b50, ignore_exif=ignore_exif@entry=1,
display_byteorder=display_byteorder@entry=1, high_quality=high_quality@entry=0, thumbnail_export=thumbnail_export@entry=1,
filter=filter@entry=0x0, copy_metadata=copy_metadata@entry=0, storage=storage@entry=0x0, storage_params=storage_params@entry=0x0)
at /home/scrumpyjack/builds/darktable/src/darktable-1.6.7/src/common/imageio.c:625
#1 0x00006e09ae0c558d in _init_8 (buf=0x6e09913ef400 "", width=<optimized out>, height=0x6e09913ef3e4, imgid=imgid@entry=1, size=DT_MIPMAP_1)
at /home/scrumpyjack/builds/darktable/src/darktable-1.6.7/src/common/mipmap_cache.c:1279
#2 0x00006e09ae0c7881 in dt_mipmap_cache_read_get (cache=0x601c198f540, buf=buf@entry=0x6e09ae784790, imgid=1, mip=DT_MIPMAP_1,
flags=flags@entry=DT_MIPMAP_BLOCKING) at /home/scrumpyjack/builds/darktable/src/darktable-1.6.7/src/common/mipmap_cache.c:952
#3 0x00006e09ae0e6f51 in dt_image_load_job_run (job=<optimized out>)
at /home/scrumpyjack/builds/darktable/src/darktable-1.6.7/src/control/jobs/image_jobs.c:36
#4 0x00006e09ae0e189e in dt_control_run_job (control=0x601c197c7a0)
at /home/scrumpyjack/builds/darktable/src/darktable-1.6.7/src/control/jobs.c:274
#5 dt_control_work (ptr=<optimized out>) at /home/scrumpyjack/builds/darktable/src/darktable-1.6.7/src/control/jobs.c:472
#6 0x00006e09ae555b9f in start (p=0x6e09ae784ab0) at src/thread/pthread_create.c:145
#7 0x00006e09ae5549b0 in __clone () at src/thread/x86_64/clone.s:21
#8 0x0000000000000004 in ?? ()
#9 0x00006e09ae784aa8 in ?? ()
#10 0x00006e09ae784a88 in ?? ()
#11 0x00006e09ae784a18 in ?? ()
#12 0x00006e09ae784898 in ?? ()
#13 0x0000000000000000 in ?? ()

=========================================================

http://st.ilet.to/dt.core has been updated

#5 Updated by Scrumpy Jack about 4 years ago

output from thread apply all bt full

http://st.ilet.to/dt.bt.full

#6 Updated by Scrumpy Jack about 4 years ago

The same behaviour occurs in the Void Linux build, which is also a musl based distro

#7 Updated by Scrumpy Jack over 3 years ago

Please could someone please tell me what's missing to get this report progressed from status incomplete to new?

#8 Updated by Roman Lebedev over 3 years ago

I think this needs someone who knows his/her/it's way around DT code and is using affected library (= musl libc)

#9 Updated by Erik Duisters over 3 years ago

  • Status changed from Incomplete to Patch attached
  • % Done changed from 20 to 70

Fixed by pull-request #1086

#10 Updated by Roman Lebedev almost 3 years ago

  • Affected Version changed from 1.6.7 to git master branch
  • Tracker changed from Bug to Feature
  • Category deleted (Buildsystem)
  • Status changed from Patch attached to Fixed
  • Assignee set to Roman Lebedev
  • Priority changed from Low to High
  • % Done changed from 70 to 100

I'm going to go ahead and declare this as fixed for all intents and purposes as of current git master.
There are probably edge cases, do report them.

#11 Updated by Roman Lebedev over 2 years ago

  • Target version set to 2.2.0

Also available in: Atom PDF