Skip to content

potential race condition breaking causes crash in color harmony bottons #20529

@dtorop

Description

@dtorop

See this report from #20489.

Imported some images and opened 1 in darkroom. Histogram was in waveform with no buttons displayed. When I hovered the two areas "highlighted" for adjusting exposure and black point. I tried clicking around in case the buttons were there but just not visible with no success. However when I exited darkroom I got a segfault Here's the log from the run:

dump.txt

and here's the backtrace file

darktable_bt_Y74ZL3.txt

Let me know what you'd like me to try...

Originally posted by @wpferguson in #20489

More notes here:

RE the crash, relevant from backtrace:

#4  _color_harmony_state_changed (widget=0x62a69b14e5c0, flags=<optimized out>, self=0x62a69d811808) at /home/bill/src/darktable/development/20489_scopes_buttons/src/libs/scopes/vectorscope.c:1061
        d = 0x0
        new_flags = GTK_STATE_FLAG_DIR_LTR
        prior = <optimized out>

This is happening in the d->harmony_prelight reference:

static void _color_harmony_state_changed(GtkWidget *widget,
GtkStateFlags flags,
dt_scopes_mode_t *const self)
{
dt_print_ext("_color_harmony_state_changed widget %p self %p self->data %p", widget, self, self->data);
dt_scopes_vec_t *const d = self->data;
GtkStateFlags new_flags = gtk_widget_get_state_flags(widget);
const dt_color_harmony_type_t prior = d->harmony_prelight;

I'm confused why d is NULL. This callback should only be called once histogram's gui_init is called at startup, which calls _vec_gui_init which sets self->data then sets up the callback. Even if you start dt by loading an image and going straight to darkroom mode, that should be the sequence. We shouldn't be freeing self->data until histogram's gui_cleanup is called at shutdown, which calls _vec_gui_cleanup.

See further notes in #20489. It's not clear if this is fixed via #20524 or if this has to do with a race condition while changing views.

Making this issue, so there is a note to follow up...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions