Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-17200

pthread_detach called for already detached threads

Details

    Description

      In several places, pthread_detach is called for threads that have been created as detached according to the attributes initialized in function init_thread_environment. According to POSIX, the behavior of such a call is undefined. These calls cause the server to crash with the latest version of musl libc.

      Attachments

        Issue Links

          Activity

            kunkku, Looks like all MariaDB versions are affected. However I'm yet uncertain if we should fix this in old version like 5.5. In which versions are you interested to have this fixed?

            svoj Sergey Vojtovich added a comment - kunkku , Looks like all MariaDB versions are affected. However I'm yet uncertain if we should fix this in old version like 5.5. In which versions are you interested to have this fixed?

            OTOH it may happen so that it got broken by https://github.com/MariaDB/server/commit/0f01bf267680244ec488adaf65a42838756ed48e
            in 10.1 and up.

            svoj Sergey Vojtovich added a comment - OTOH it may happen so that it got broken by https://github.com/MariaDB/server/commit/0f01bf267680244ec488adaf65a42838756ed48e in 10.1 and up.

            Personally, I am interested in 10.3 and 10.4.

            kunkku Kaarle Ritvanen added a comment - Personally, I am interested in 10.3 and 10.4.

            kunkku, it may take a while before fix gets into release. Meanwhile feel free to try my patch at https://github.com/MariaDB/server/commit/c45b4a774b6d1404a080a1c1759f780fa78f223b

            svoj Sergey Vojtovich added a comment - kunkku , it may take a while before fix gets into release. Meanwhile feel free to try my patch at https://github.com/MariaDB/server/commit/c45b4a774b6d1404a080a1c1759f780fa78f223b

            serg, please review fix for this bug. Do you think it still makes sense to keep this half-broken pthread_detach_this_thread()?

            svoj Sergey Vojtovich added a comment - serg , please review fix for this bug. Do you think it still makes sense to keep this half-broken pthread_detach_this_thread()?
            serg Sergei Golubchik added a comment - - edited

            You mean, under #if defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT) ?

            I don't think we have this in buildbot, so it's practically a dead code. If it's old an not in buildbot, I'd say it doesn't make much sense to keep it.

            serg Sergei Golubchik added a comment - - edited You mean, under #if defined(HAVE_PTHREAD_ATTR_CREATE) && !defined(HAVE_SIGWAIT) ? I don't think we have this in buildbot, so it's practically a dead code. If it's old an not in buildbot, I'd say it doesn't make much sense to keep it.

            People

              svoj Sergey Vojtovich
              kunkku Kaarle Ritvanen
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.