From patchwork Fri Jul 14 15:14:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Szabolcs Nagy X-Patchwork-Id: 788584 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3x8GSd11nmz9s76 for ; Sat, 15 Jul 2017 01:14:40 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="hm69nF0m"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type; q=dns; s=default; b= p4Sw5dPdFPbhUWVd/5xzYWU2CSaBMGKSXcUk9yUVAwvpu4tXPG7kjwspOvrOtLPt KDUvITFCH7vREwPBrOT3I9NH3CQ4bZeyEGaCsPkAGbBVNiUhHYcf8vu8YnOzdJOu TKn31i2dRUSoA2CFtnClCQIsH9FP/UCPEVixibDqZ3w= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type; s=default; bh=JjGq bJZOswpssqNF+9wsiHciDxY=; b=hm69nF0mSjpCsx48SMi1XHVx2o8LusF0quu6 uAhbo3nAyolFQsJwACfvMDVSDdD7mwdugCBZt45ldy7XXuDzbrxd5UlCH23hyvsH jecG1hgAuFTKalsv0w6fxEIRxMzEBmOOJXNzo7hVDrtvATAJ5KpHk+2J/Ysh2X1v VqCZNr8= Received: (qmail 21695 invoked by alias); 14 Jul 2017 15:14:33 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 21677 invoked by uid 89); 14 Jul 2017 15:14:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: EUR01-VE1-obe.outbound.protection.outlook.com Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; Message-ID: <5968DFCD.3000007@arm.com> Date: Fri, 14 Jul 2017 16:14:21 +0100 From: Szabolcs Nagy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: Carlos O'Donell , GNU C Library , Florian Weimer CC: nd@arm.com Subject: [PATCH committed] Disable single thread optimization for open_memstream References: <5968C08E.60008@arm.com> In-Reply-To: X-ClientProxiedBy: VI1PR0101CA0077.eurprd01.prod.exchangelabs.com (2603:10a6:800:1f::45) To HE1PR0802MB2491.eurprd08.prod.outlook.com (2603:10a6:3:d9::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fd3a57b2-1072-4bcc-b578-08d4cacb03fc X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(48565401081)(49563074)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:HE1PR0802MB2491; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0802MB2491; 3:bZ0YJZ5WD0YKP+Ia0bMQHvPhlkRlEpQbM3ZvDFV+9ni2Mug5ju86784cvte0W+RJYbKXuAqPmINVL5WhTRwKc77u+4URYEOINV0+WAsCeCwQC4jaae1kNpl0At4zijOAzY03W4i5zWWmw4IxQbhomsGlk5m6wqK4AAG3sCAMrO3CRXs9QpPX3sRtoHQs+riFN65Isjz2xq/qOpw1k6qV1VVbmjUkA85ovcbgpciFoYmPi6xUF+E7ySGgkHXopQIlYYAAhre42+0hahoJYilbZ3kYIeU2I56hSi1yshU7/rSO4cfUrgSCJNXiTs4whxLjukBK85bSqpbU2hPmjWR3NSwfempfyu1VWBS74idQBNUOxhvbu0swK17Fhrl0hXmT2i1hfZEArFNrE5dQ3dxc+CJjv3ZE1dkVotLCKmjU0d46sjS9lvBk4JiynCwucDPaAsN18IoOWi6n6N7cuotCZfCH+5eGAz4+7YKEDtvny+zhyNhcbSbO5VHXC8MbdRJzY1t9u/jg87i9EkIgwh+Z/9wghi9lkyLn+66gTPKfqDzuGVpkhN4maPnD4HZLaAapeIKDKTad8i046uhYp0SAsqXGm0EWQ1HiGAIOE11wNzYiNzTlBcLMYB2Z/xtei0CtmP9Pv97uHYoQJePlBZey7C7DOAsI8TxDZr6PvCEpotHEMEGTprA41HpmmGQHkPCmCFYh68QzDNAi87UaM3ADPGZmU7giS/FjaP8XoUUjoiRJH+fAo4GJn99sCWLUwAkBuU770+e1vLkBosKfZPM7h77t7V26Yqkf+EOK3PtclQ0= X-MS-TrafficTypeDiagnostic: HE1PR0802MB2491: X-Microsoft-Exchange-Diagnostics: 1; HE1PR0802MB2491; 25:gEAdc5aaO17JcTaScrabAZZyUVEqPXH+eCOQacGLAHG5hd33XycmkFeiEzs813ibqLjvNW5HPcaQygjyLktUdhwfAAndsHpBGEQMrNk70Iz8qaIE0O+fgYtjfjhplqKMaO96nrsVJGzD/6ScMS203NUf7OiiEhJ5nTl/lKTi0sc7bzpYmFTFPZJ+S7g9vb0ie7wHrZbQ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3GakHm6pvUxLyTy75MSANmlIIH2ao+nukkFeW73X8XoZjQJalQZ7xrabIPdb9rRmUUJkKwKV+VQkZ2CpXuDhu9G7L2w1q+mFsk/7JhA39lH3GHk015OzsAp7Ix5uU4gZX5uOvM4HekHEhnZqMMtCUvqMuwe8b3hp9ylKQy6qZWQLpGQaf6Ijd4Jg+cx/QZu+KY2PyJxnKzQOnR5H+y3ecsomWGlAcWiM927tJ/KbAzdP47v1nBNbD2NgIlCMv9WXCuTQ8GkGCX6VVMiG3NU4/Cja1rn1+ypfYL6TAyagUqGaThmeewAng/gzLjlqB+5cV5zkHuHhdplYx1fxQyqpMiJtvxPPdqrfFEtqgGiGdfq0OxzQkUO87vNbYl8pJkkZWQ5O7VzV3BL9ybYJ8jPhPVxx95/8DGO8ncZcUMk9TH+slrZufbthqcNv2K9w==; 20:klAuvsavuF3EzDdyxwlp119wcgfAh4+8xw3ZwT6lDUb3Pd4TiUT1jTB0pAdOTBaMa1SUxjRoSDVBpZx0CPH0FWDatmdLTol064AdHgXksYW+Fhc+BxSQqwYaFyzOm1BctI2/o8vo0VBlAlB7n2ceHyVEPIW93dK61RT1gICkavQ= NoDisclaimer: True X-Exchange-Antispam-Report-Test: UriScan:(180628864354917)(236129657087228); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(102415395)(6040450)(601004)(2401047)(2017060910075)(5005006)(8121501046)(3002001)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(6055026)(6041248)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123558100)(20161123560025)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR0802MB2491; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR0802MB2491; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0802MB2491; 4:2t1mhCOELuvigpqTQ186/0czvwLjRQOM1TiTJWl/?= =?us-ascii?Q?pnh/7TB9Dnou1BtCCSH1ASZ78/LXKBvlTCpthyj1bwVACiEEYFLlsQkqE+T0?= =?us-ascii?Q?y3E8IErPXA5j8WvlKkdkDFC8reogstQKU5Z8m2GGG3ypkpDeeoH2wkzjV7qo?= =?us-ascii?Q?YUCbfuUN+Xanci8W7DMXifRcDeSoVR79c7iAMBzxDliN/QdlzSlh/vVz2oTu?= =?us-ascii?Q?/NvgEDUjTLVCQ59QKOokQz3EKKWn4DIZQifKrw1CF9LZI8YBiGP15izgn9SC?= =?us-ascii?Q?dBrgEJrwu7twPsL4ABrQOI/rzqZTjTThtek1o00RyB3VI52J+6oK+KI1yjo5?= =?us-ascii?Q?wBpuxf8FYCgCiArIfvv+DYpT0COmZxSgJWPVSc2ZamdTS9rafa5NAVdRlFyg?= =?us-ascii?Q?bdwjtxDCWahKyryMsw3NBjj7QEeccTl3orrZrS9ooU5M1pBpIXzKHHU+7LHa?= =?us-ascii?Q?vbwYRZTeNa+5fHppcnsuarDAzLMJpwjIds2xLhiDqAOmpD2RelxB50SAOGxY?= =?us-ascii?Q?yw88z1yHrppwbFC6HQY3x8dRj+vyPDbv6ghNCsJmktMzp3iBoeHZtwHsYgE/?= =?us-ascii?Q?EKDA+dxUaypa0ACv/1J5k20vfG5P8+jBscbk8n/j19hgqoj6ECChr7o4MBlt?= =?us-ascii?Q?wX+X8k+wb6aHEI4Hf+arH8cBhY6hxjcc17I7YpfwkPXthdsfvuxVf4wm6VoC?= =?us-ascii?Q?1du1ridfgiDXCySklSgwNpbQ7soufpNeT3pdx3UoIBas83/9/za/eA9XVTM4?= =?us-ascii?Q?FTKw6/xZPwL4ON1jC7qJzCOvFEf57E5lM+18oiexg6C2JkcE5nBDYPZWRk+O?= =?us-ascii?Q?+WPGxjycpQ85aCQPEMV1E4uiyZI0rJ3WFgrAeiTMG/OLARNwheNvdY8RqedH?= =?us-ascii?Q?eRPQ2+ZQlP3APCUuB/jd+99NX021d4F6F0fsV78b5dW9JOWG2y8Kul/Pn21G?= =?us-ascii?Q?34eUVLsI2U/8eiD+xI+jo+EzSqDWWJ30+SjNUEf/6/gFOYAlMI847cuXggoB?= =?us-ascii?Q?LLO2C2rWZhA4JGXUg5aN0e4B07mfutzDgj1FGC1HqE+YlRFtAUc0W4Z13/fp?= =?us-ascii?Q?31EMSuvRaQ7Ubu/oSsm075oX0iQKMuCWQKmEBOFCUqz3HoJWTdElgt6+jXNL?= =?us-ascii?Q?VWzX4I9CDaCGgYSAf/RiOWkxvYXnYd0BTlT/9KTGRWMhawKmm1PKWnQ2UHup?= =?us-ascii?Q?L8Ek69eqMo2kXbMBi6ctxHrRznMVJeD9wbtTmJcS+lw1gBNPeI5/LbUTNoVP?= =?us-ascii?Q?gz7XQJbusEvYSw1UGzSxc9f5wc9eGzvOI9GMD2qjXBXQ8IRCyZsgoTqQtv+i?= =?us-ascii?Q?fA=3D=3D?= X-Forefront-PRVS: 0368E78B5B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(7370300001)(6049001)(6009001)(39860400002)(39410400002)(39400400002)(39450400003)(39840400002)(39850400002)(377424004)(377454003)(24454002)(80316001)(5660300001)(36756003)(7736002)(72206003)(5890100001)(478600001)(305945005)(84326002)(86362001)(4326008)(53546010)(8676002)(50986999)(87266999)(25786009)(64126003)(4001350100001)(54356999)(76176999)(2906002)(4610100001)(65816999)(21490400002)(81166006)(33656002)(2476003)(5000100001)(568964002)(7350300001)(3846002)(270700001)(6116002)(189998001)(6486002)(53936002)(38730400002)(42186005)(83506001)(2950100002)(6666003)(77096006)(66066001); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0802MB2491; H:[10.2.206.69]; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0802MB2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a?= =?us-ascii?Q?gjtDuYQhk02legqj9ehhMrjLZpmA+quW6LLQ82rgpiFcG8euqOwME7WHpgCD?= =?us-ascii?Q?BKpvhs2He2T0pqyABvViWq5Gt2SoLm09MI2xmGrPTSfY+3SE9gCIZK6vPRyC?= =?us-ascii?Q?YztWda03yAo2Fa2z8CUZgEuiGVyEnUcd+09bmqnj7FiDf5o5gGcKAl9N8YWn?= =?us-ascii?Q?IZ3M6x668CPqNpwrecP5WdyKSI2iFHDcpOzA3g4tJvKFOqClm+j/SZiGoFIX?= =?us-ascii?Q?XJBEXPFZtWVPippshCiI0qaRtXea8lluIP5iWo78DXhTjQ6zI09eboe3bb/E?= =?us-ascii?Q?/SBiMevK24GVL9GcqsC89ZE7Np+cJ8loE0G4Xem4piOzmz71tHU3lSjBEX5h?= =?us-ascii?Q?9hQlHv6rehbTbL9zeqNjTEWsHjRltKdPowzd8l5eNDE5VEGPckEvkcizWSSG?= =?us-ascii?Q?4uSWoFC7QTcfl1sAAZsozeJRZuARSE4AIehDGmG31jdHMl0pKgYqLedEMnKO?= =?us-ascii?Q?nMgSm2MljENbFI+64+5jVU70IkXdJQeWzwJd4s73OUklq1e/PicdBstNcBVk?= =?us-ascii?Q?naqlEEATrQQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0802MB2491; 6:iuEhucd/QzNnHtGq5iauk8Q1ILuBrkxStbd8iKD1?= =?us-ascii?Q?djkTtdVc5uJyQThzGoNDpTE3a8ieOc1CXCA8UjDr6S9VGOJKtXz32XEB1mr6?= =?us-ascii?Q?Ar8RcazpY5ds+Qofrfwfk6Qy5PoJDQPJp97vB7VisFEtYuumxFqxRxOq8YAP?= =?us-ascii?Q?24dUGl55wp8CxFI8RX5T3FkKlZqVjcQtmCIoR+zCfT+rqqFyTQOzuYKJwpY2?= =?us-ascii?Q?U2JuoyTEc7HEP11Wn+m6DXCVOwZrZskGk9cdf+aAmfE69/sIfY2ox+F2u5zl?= =?us-ascii?Q?kquLe4kBekbI9Yhk+ex3owf/wCjpNlNzzMuml6uvuohk5Q2LGy3KRWY+M5oQ?= =?us-ascii?Q?zblzokcRbPBSW+79XJ+bQKTBsZpWX/VcCrp5kPN2BjNYRrbJkCo1/uMu8DXE?= =?us-ascii?Q?wBDyz9KtsBBRME4GDr2SBWVSnLU3dk91//2apd6hWgBQS+0aJEH+1v7syx+p?= =?us-ascii?Q?c1F7yQMkGZjcZBlUnxlwgwGH2IJKHqjzZYoctXcfAwpWK9rOI83lyZnklPIP?= =?us-ascii?Q?VoIRws4HxHAhU7cSU1chL3UHlYmRkBlezooyuF9CtQjN9fctC/gxCe4CC2E+?= =?us-ascii?Q?DnYHzvzetKv+fbsaU1femTNTfPRop9v6RYCKxSdBc87t12nrTWqvHefA/rmp?= =?us-ascii?Q?Xd29grR5EsdjE2vT5MKlGrGAww31qt7SMNnS34DEM4BySPIuW9TLouPJhv2R?= =?us-ascii?Q?9Bku4sqsN+sajpToCTQCMNWEz8mtBuP1B+Q98E95hnbfv9hp6hWXFCBLHRfr?= =?us-ascii?Q?Gte00NbxhuYoijHqd4xsD9m4tmox6RoRDgRjsET0nFQ9/A9uJrBF8x34h6aJ?= =?us-ascii?Q?D73/uzbgiFi6d16Fn8PSt/PcJAt63xEmxTrsYFvlWFeXUm0NTFYhnjYBE9vJ?= =?us-ascii?Q?cWhMr+wrBZfpXf3KitXNDm+uDlRBjkUzj6BOCf4qRHdqXcsFAi58tgxSZlGX?= =?us-ascii?Q?f/3os+YNEB4tL+SXhg/yZkOFbm/X7RlKGQQxYVHd8yARS5ddkklHI11HR2WU?= =?us-ascii?Q?udF+CejCV4JvywUqwJ/orZsk?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR0802MB2491; 5:cOEWpB3e2LAn4a00kLDo/tfryBFRkH187vBjcCuaGMEz+bQXIzzr5RNG742gNSWOhNYf3RXbpX4Y00Gzga/F3LkAaKbaNKh1SuZ7tq/ZsTKBYbWomrlWddkcQC+I8rNillfWsPK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PrU4Xbi7j46mbZHyOwyzv9D3/ykRVByTjdnAPSaQ69oCnHarZYtC3RXI00GxticzrOtH6W9pzdUCLcmfkJY+3xCtiR7QY7W5WUHsMBUgiwf7fumTLwt4lMKBdAZK05+tfFMPxqlwaBx13J1JWVbFvgs8VEMimH5hk/RbtB9GFbCT4XlaA/B3rmuSdBoI89ZZhHRjCrxDttu4iEc9O2UySWyHN9tKCNEz4H6Kf37rZTRbG310mvmZA9v2DZ521zL6+r/QJryTkiW/EYsdWTv3EOfXqc4qMvcABGvk8Vy40XxBsI3mk= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jul 2017 15:14:25.5303 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0802MB2491 On 14/07/17 15:06, Carlos O'Donell wrote: > On 07/14/2017 09:01 AM, Szabolcs Nagy wrote: >> Single thread optimization is valid if at thread creation time the >> optimization can be disabled. This is in principle true for all >> stream objects that user code can access (and thus needs locking), >> using the same internal list as fflush(0) uses. However in glibc >> open_memstream is not on that list (BZ 21735) so the optimization >> has to be disabled. >> >> OK with the test? >> >> 2017-07-14 Szabolcs Nagy >> Florian Weimer >> >> * libio/memstream.c (__open_memstream): Set _IO_FLAGS2_NEED_LOCK. >> * libio/wmemstream.c (open_wmemstream): Likewise. >> * nptl/tst-memstream.c: New. >> > > OK to checkin if you add a pargraph comment to tst-memstream.c > explaining the test invariants, expectations, and exactly what > is being tested and why. > committed. diff --git a/ChangeLog b/ChangeLog index e2605cb9c3..96c76f72ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2017-07-14 Szabolcs Nagy + Florian Weimer + + * libio/memstream.c (__open_memstream): Set _IO_FLAGS2_NEED_LOCK. + * libio/wmemstream.c (open_wmemstream): Likewise. + * nptl/tst-memstream.c: New. + 2017-07-12 Jiong Wang * sysdeps/arm/dl-machine.h (elf_machine_load_address): Also strip bit 0 diff --git a/libio/memstream.c b/libio/memstream.c index f83d4a5213..e391efd48a 100644 --- a/libio/memstream.c +++ b/libio/memstream.c @@ -96,6 +96,9 @@ __open_memstream (char **bufloc, _IO_size_t *sizeloc) new_f->fp.bufloc = bufloc; new_f->fp.sizeloc = sizeloc; + /* Disable single thread optimization. BZ 21735. */ + new_f->fp._sf._sbf._f._flags2 |= _IO_FLAGS2_NEED_LOCK; + return (_IO_FILE *) &new_f->fp._sf._sbf; } libc_hidden_def (__open_memstream) diff --git a/libio/wmemstream.c b/libio/wmemstream.c index 5bc77f52ee..103a760bf5 100644 --- a/libio/wmemstream.c +++ b/libio/wmemstream.c @@ -98,6 +98,9 @@ open_wmemstream (wchar_t **bufloc, _IO_size_t *sizeloc) new_f->fp.bufloc = bufloc; new_f->fp.sizeloc = sizeloc; + /* Disable single thread optimization. BZ 21735. */ + new_f->fp._sf._sbf._f._flags2 |= _IO_FLAGS2_NEED_LOCK; + return (_IO_FILE *) &new_f->fp._sf._sbf; } diff --git a/nptl/Makefile b/nptl/Makefile index 853da72e74..dd01994d3e 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -302,7 +302,7 @@ tests = tst-attr1 tst-attr2 tst-attr3 tst-default-attr \ c89 gnu89 c99 gnu99 c11 gnu11) \ tst-bad-schedattr \ tst-thread_local1 tst-mutex-errorcheck tst-robust10 \ - tst-robust-fork tst-create-detached + tst-robust-fork tst-create-detached tst-memstream tests-internal := tst-typesizes tst-rwlock19 tst-sem11 tst-sem12 tst-sem13 \ tst-barrier5 tst-signal7 tst-mutex8 tst-mutex8-static \ diff --git a/nptl/tst-memstream.c b/nptl/tst-memstream.c new file mode 100644 index 0000000000..c88f708a50 --- /dev/null +++ b/nptl/tst-memstream.c @@ -0,0 +1,101 @@ +/* Test for open_memstream locking. + Copyright (C) 2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* This test checks if concurrent writes to a FILE created with + open_memstream are correctly interleaved without loss or corruption + of data. Large number of concurrent fputc operations are used + and in the end the bytes written to the memstream buffer are + counted to see if they all got recorded. + + This is a regression test to see if the single threaded stdio + optimization broke multi-threaded open_memstream usage. */ + +#include +#include +#include +#include + +enum +{ + thread_count = 2, + byte_count = 1000000, +}; + +struct closure +{ + FILE *fp; + char b; +}; + +static void * +thread_func (void *closure) +{ + struct closure *args = closure; + + for (int i = 0; i < byte_count; ++i) + fputc (args->b, args->fp); + + return NULL; +} + +int +do_test (void) +{ + char *buffer = NULL; + size_t buffer_length = 0; + FILE *fp = open_memstream (&buffer, &buffer_length); + if (fp == NULL) + FAIL_RET ("open_memstream: %m"); + + pthread_t threads[thread_count]; + struct closure args[thread_count]; + + for (int i = 0; i < thread_count; ++i) + { + args[i].fp = fp; + args[i].b = 'A' + i; + threads[i] = xpthread_create (NULL, thread_func, args + i); + } + + for (int i = 0; i < thread_count; ++i) + xpthread_join (threads[i]); + + fclose (fp); + + if (buffer_length != thread_count * byte_count) + FAIL_RET ("unexpected number of written bytes: %zu (should be %d)", + buffer_length, thread_count * byte_count); + + /* Verify that each thread written its unique character byte_count times. */ + size_t counts[thread_count] = { 0, }; + for (size_t i = 0; i < buffer_length; ++i) + { + if (buffer[i] < 'A' || buffer[i] >= 'A' + thread_count) + FAIL_RET ("written byte at %zu out of range: %d", i, buffer[i] & 0xFF); + ++counts[buffer[i] - 'A']; + } + for (int i = 0; i < thread_count; ++i) + if (counts[i] != byte_count) + FAIL_RET ("incorrect write count for thread %d: %zu (should be %d)", i, + counts[i], byte_count); + + return 0; +} + +#define TIMEOUT 100 +#include