From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 8CB3D393D035 for ; Wed, 12 Jan 2022 14:13:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8CB3D393D035 Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20CDr7hX002822; Wed, 12 Jan 2022 14:13:17 GMT Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 3dhug00th5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Jan 2022 14:13:17 +0000 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 20CECGrd028776; Wed, 12 Jan 2022 14:13:15 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma03fra.de.ibm.com with ESMTP id 3df289jtby-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Jan 2022 14:13:15 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 20CEDBS445482492 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Jan 2022 14:13:11 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7CFEFA4064; Wed, 12 Jan 2022 14:13:11 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 56039A4062; Wed, 12 Jan 2022 14:13:11 +0000 (GMT) Received: from [9.145.18.11] (unknown [9.145.18.11]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 12 Jan 2022 14:13:11 +0000 (GMT) Message-ID: Date: Wed, 12 Jan 2022 15:13:11 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH v2] Use LFS and 64 bit time for installed programs (BZ #15333) Content-Language: en-US To: libc-alpha@sourceware.org References: From: Stefan Liebler In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: dwHuwEpVIV5Gmee1U6TA5zy8XfoLnl_k X-Proofpoint-ORIG-GUID: dwHuwEpVIV5Gmee1U6TA5zy8XfoLnl_k X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-12_04,2022-01-11_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 malwarescore=0 suspectscore=0 priorityscore=1501 mlxscore=0 mlxlogscore=971 phishscore=0 impostorscore=0 clxscore=1015 lowpriorityscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201120093 X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_BLACK autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jan 2022 14:13:21 -0000 On 14/12/2021 20:35, DJ Delorie via Libc-alpha wrote: ... > > LGTM > Reviewed-by: DJ Delorie > Starting with this commit a6d2f948b71adcb5ea395cb04833bc645eab45e6, I get a test fail on s390: FAIL: resolv/tst-p_secstodate Test 0: 0 -> 19700101000000 Test 1: 12345 -> 19700101000000 test 1 failedTest 2: 999999999 -> 19700101000000 test 2 failedTest 3: 2147483647 -> 19700101000000 test 3 failedTest 4: 2147483648 -> Test 5: 4294967295 -> It turns out that there is a type-mismatch of time_t on caller and callee side. in libresolv.so: resolv/res_debug.c: __p_secstodate(u_long secs) time_t clock = secs; struct tm *time = __gmtime_r(&clock, &timebuf); (gdb) p &clock $1 = (time_t *) 0x7ffff1c8 (gdb) ptype time_t type = long long (gdb) p sizeof(time_t) $2 = 8 (gdb) x/2xw 0x7ffff1c8 0x7ffff1c8: 0x00000000 0x7fffffff The secs are stored as 8byte long long on stack and the pointer is passed to __gmtime_r in libc.so: time/gmtime.c: /* Provide a 32-bit variant if needed. */ #if __TIMESIZE != 64 struct tm * __gmtime_r (const time_t *t, struct tm *tp) { __time64_t t64 = *t; return __gmtime64_r (&t64, tp); } #endif (gdb) ptype time_t type = long (gdb) p sizeof(time_t) $3 = 4 (gdb) p *t $4 = 0 (gdb) ptype __time64_t type = long long On libc.so side, time_t is defined as 4byte long, thus the value of t is read as 0x0 instead of 0x7fffffff. resolv/res_debug.c is built with -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 and time/gmtime.c is built without those defines. @Adhemerval: Can you please have a look? Thanks Stefan