All of these tests execute mysqlslap, which deadlocks. Below is simplified code from mysqlslap which also deadlocks on PPC64:
#include <pthread.h>
|
|
pthread_mutex_t mutex;
|
pthread_cond_t cond;
|
int master_wakeup;
|
|
static void *thread_start(void *arg)
|
{
|
pthread_mutex_lock(&mutex);
|
while (master_wakeup)
|
pthread_cond_wait(&cond, &mutex);
|
pthread_mutex_unlock(&mutex);
|
|
return 0;
|
}
|
|
int main(void)
|
{
|
int i, t;
|
pthread_t thread_id[5];
|
|
pthread_mutex_init(&mutex, 0);
|
pthread_cond_init(&cond, 0);
|
|
for (i= 0; i < 1000; i++)
|
{
|
master_wakeup= 1;
|
|
for (t= 0; t < 5; t++)
|
if (pthread_create(&thread_id[t], 0, thread_start, 0))
|
return 1;
|
|
pthread_mutex_lock(&mutex);
|
master_wakeup= 0;
|
pthread_mutex_unlock(&mutex);
|
pthread_cond_broadcast(&cond);
|
|
for (t= 0; t < 5; t++)
|
pthread_join(thread_id[t], 0);
|
}
|
|
pthread_mutex_destroy(&mutex);
|
pthread_cond_destroy(&cond);
|
|
return 0;
|
}
|
If we move broadcast call up one line so that it is protected by the mutex, the program won't deadlock. I believe there should be no difference when we call broadcase, because the manual says:
These functions atomically release mutex and cause the calling thread to block
|
on the condition variable cond; atomically here means "atomically with respect
|
to access by another thread to the mutex and then the condition variable".
|
That is, if another thread is able to acquire the mutex after the
|
about-to-block thread has released it, then a subsequent call to
|
pthread_cond_broadcast() or pthread_cond_signal() in that thread shall behave
|
as if it were issued after the about-to-block thread has blocked.
|
- is part of
-
MDEV-6478
MariaDB on Power8
-
-
Closed
- links to
-
-
{"report":{"fcp":884.2000000476837,"ttfb":199.60000014305115,"pageVisibility":"visible","entityId":41404,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"4ba3a1db-edbe-4de3-a87a-7811cad13113","navigationType":0,"readyForUser":966.2999999523163,"redirectCount":0,"resourceLoadedEnd":772.6000001430511,"resourceLoadedStart":207,"resourceTiming":[{"duration":92,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":207,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":207,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":299,"responseStart":0,"secureConnectionStart":0},{"duration":92.59999990463257,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":207.20000004768372,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":207.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":299.7999999523163,"responseStart":0,"secureConnectionStart":0},{"duration":292.7999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":207.20000004768372,"connectEnd":302.2999999523163,"connectStart":302.2999999523163,"domainLookupEnd":302.2999999523163,"domainLookupStart":302.2999999523163,"fetchStart":207.20000004768372,"redirectEnd":0,"redirectStart":0,"requestStart":303.7999999523163,"responseEnd":500,"responseStart":323.40000009536743,"secureConnectionStart":302.2999999523163},{"duration":422.60000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":207.29999995231628,"connectEnd":207.29999995231628,"connectStart":207.29999995231628,"domainLookupEnd":207.29999995231628,"domainLookupStart":207.29999995231628,"fetchStart":207.29999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":305.60000014305115,"responseEnd":629.9000000953674,"responseStart":327.5,"secureConnectionStart":207.29999995231628},{"duration":113.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":207.40000009536743,"connectEnd":207.40000009536743,"connectStart":207.40000009536743,"domainLookupEnd":207.40000009536743,"domainLookupStart":207.40000009536743,"fetchStart":207.40000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":305.7000000476837,"responseEnd":321,"responseStart":319.5,"secureConnectionStart":207.40000009536743},{"duration":117.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":207.60000014305115,"connectEnd":207.60000014305115,"connectStart":207.60000014305115,"domainLookupEnd":207.60000014305115,"domainLookupStart":207.60000014305115,"fetchStart":207.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":306,"responseEnd":324.7000000476837,"responseStart":321.60000014305115,"secureConnectionStart":207.60000014305115},{"duration":118,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":207.60000014305115,"connectEnd":207.60000014305115,"connectStart":207.60000014305115,"domainLookupEnd":207.60000014305115,"domainLookupStart":207.60000014305115,"fetchStart":207.60000014305115,"redirectEnd":0,"redirectStart":0,"requestStart":305.90000009536743,"responseEnd":325.60000014305115,"responseStart":322.10000014305115,"secureConnectionStart":207.60000014305115},{"duration":97.60000014305115,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":207.79999995231628,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":207.79999995231628,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":305.40000009536743,"responseStart":0,"secureConnectionStart":0},{"duration":98.79999995231628,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":207.90000009536743,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":207.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":306.7000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":128.59999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":207.90000009536743,"connectEnd":207.90000009536743,"connectStart":207.90000009536743,"domainLookupEnd":207.90000009536743,"domainLookupStart":207.90000009536743,"fetchStart":207.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":309.90000009536743,"responseEnd":336.5,"responseStart":334.60000014305115,"secureConnectionStart":207.90000009536743},{"duration":140.70000004768372,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":208,"connectEnd":208,"connectStart":208,"domainLookupEnd":208,"domainLookupStart":208,"fetchStart":208,"redirectEnd":0,"redirectStart":0,"requestStart":310.2000000476837,"responseEnd":348.7000000476837,"responseStart":335.10000014305115,"secureConnectionStart":208},{"duration":405.60000014305115,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":221,"connectEnd":221,"connectStart":221,"domainLookupEnd":221,"domainLookupStart":221,"fetchStart":221,"redirectEnd":0,"redirectStart":0,"requestStart":391.2999999523163,"responseEnd":626.6000001430511,"responseStart":625.1000001430511,"secureConnectionStart":221},{"duration":548.7000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":223.90000009536743,"connectEnd":223.90000009536743,"connectStart":223.90000009536743,"domainLookupEnd":223.90000009536743,"domainLookupStart":223.90000009536743,"fetchStart":223.90000009536743,"redirectEnd":0,"redirectStart":0,"requestStart":758.4000000953674,"responseEnd":772.6000001430511,"responseStart":771.4000000953674,"secureConnectionStart":223.90000009536743},{"duration":233.60000014305115,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":626.7999999523163,"connectEnd":626.7999999523163,"connectStart":626.7999999523163,"domainLookupEnd":626.7999999523163,"domainLookupStart":626.7999999523163,"fetchStart":626.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":820.9000000953674,"responseEnd":860.4000000953674,"responseStart":858,"secureConnectionStart":626.7999999523163},{"duration":220.39999985694885,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":876.6000001430511,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":876.6000001430511,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1097,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":29,"domainLookupEnd":37,"connectStart":37,"connectEnd":57,"secureConnectionStart":46,"requestStart":58,"responseStart":199,"responseEnd":223,"domLoading":202,"domInteractive":1078,"domContentLoadedEventStart":1078,"domContentLoadedEventEnd":1128,"domComplete":1652,"loadEventStart":1652,"loadEventEnd":1653,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1057},{"name":"bigPipe.sidebar-id.end","time":1057.7999999523163},{"name":"bigPipe.activity-panel-pipe-id.start","time":1058},{"name":"bigPipe.activity-panel-pipe-id.end","time":1059.5},{"name":"activityTabFullyLoaded","time":1147.5}],"measures":[],"correlationId":"93a5640e4f8ad7","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":68,"dbReadsTimeInMs":10,"dbConnsTimeInMs":16,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Sergei, please review fix for this bug.
A patch has been pushed to 10.0.13:
revno: 4306
revision-id: svoj@mariadb.org-20140725130247-cl64fv8g6g2ydbq7
parent: jplindst@mariadb.org-20140725073016-8y0e2u8zxd0x4z7t
committer: Sergey Vojtovich <svoj@mariadb.org>
branch nick: 10.0
timestamp: Fri 2014-07-25 17:02:47 +0400
message:
MDEV-6489 - rpl.rpl_insert, rpl.rpl_insert_delayed and
main.mysqlslap fail on PPC64
There seem to be a bug on Power8 which doesn't guarantee
a signal to be delivered to waiting thread if broadcast
is called outside of mutex.
For now workaround it by calling broadcast while mutex is
still held.