Skip to content
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

Use dt_atomic for control->running #17978

Merged

Conversation

jenshannoschwalm
Copy link
Collaborator

@jenshannoschwalm jenshannoschwalm commented Dec 10, 2024

As only late glibc has g_atomic_int_exchange() we use the dt_atomic_() variants instead.

In pthread_joining work we do more precise logs as the crash reports might be misleading in location due to inlining and macro expansion.

Fixes #17977

As only late glibc has g_atomic_int_exchange() we use the dt_atomic_() variants instead.

In pthread_joining work we do more precise logs as the crash reports might be misleading in location
due to inlining and macro expansion.
@jenshannoschwalm
Copy link
Collaborator Author

Please note there is some more difficult work to be done for 5.0 !

We now have a safe way to pass "dt control has pending work for closing" ... but

It is pretty clear the "job dispatcher" is not ok for now.

Simple reproducers:

  1. In lighttable mode enforce something involving more work like a) select 10 images and b) select the rotate-by-90° button
  2. Select many images and discard history

If you close darktable - close button or ctrl-q - you will likely see things like

  1. double_free
  2.  13,3127 [dt_control_shutdown] joined kicker
     13,3127 [dt_control_shutdown] joined num_threads 0
     13,3127 [dt_control_shutdown] joined num_threads 1
     13,3127 [dt_control_shutdown] joined num_threads 2
     [Inferior 1 (process 42670) detached]
     13,3127 [dt_control_shutdown] joined num_threads 3
     13,3128 [dt_control_shutdown] joined num_threads 4
     13,3128 [dt_control_shutdown] joined num_threads 5
     13,3128 [dt_control_shutdown] joined worker_reserved 0
     13,3128 [dt_control_shutdown] joined worker_reserved 1
     13,3128 [dt_control_shutdown] joined worker_reserved 2
    

or others.

@jenshannoschwalm jenshannoschwalm added this to the 5.0 milestone Dec 10, 2024
@jenshannoschwalm jenshannoschwalm added bugfix pull request fixing a bug priority: high core features are broken and not usable at all, software crashes labels Dec 10, 2024
Copy link
Member

@TurboGit TurboGit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@TurboGit TurboGit merged commit 77bed88 into darktable-org:master Dec 10, 2024
6 checks passed
@jenshannoschwalm jenshannoschwalm deleted the more_pthreads_cleanup branch December 10, 2024 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix pull request fixing a bug priority: high core features are broken and not usable at all, software crashes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't build on Ubuntu 22.04 after #17961
2 participants