From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 11412 invoked from network); 29 Oct 2021 22:44:22 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 29 Oct 2021 22:44:22 -0000 Received: (qmail 1801 invoked by uid 550); 29 Oct 2021 22:44:20 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 1769 invoked from network); 29 Oct 2021 22:44:19 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1635547447; bh=qEKimzNVR3IC7cf1yPWL2ZSfDodKpPajNKtiRO278qs=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=UBEv0aVt6yFPoSBPQ9ZHbGkuPEiQBxY8AsPlp1wGKpp1XIaUA79LLisey35J/xGK0 lXiNuLt6CcHfeVNcaXPK9+N1Q3He0fTKnqI2C6bE8zkL7CIGk+PcvjiLAjaUFzwsY7 smEkq2MD/++12InjhJ5YQtr6L6FSdG5RB3Ja/jrc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Date: Sat, 30 Oct 2021 00:44:05 +0200 From: Sebastian Kemper To: musl@lists.openwall.com, Szabolcs Nagy Cc: =?iso-8859-1?Q?=C9rico?= Nogueira Message-ID: Mail-Followup-To: musl@lists.openwall.com, Szabolcs Nagy , =?iso-8859-1?Q?=C9rico?= Nogueira References: <20211029210445.GT37904@port70.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211029210445.GT37904@port70.net> X-Provags-ID: V03:K1:Mgv77eXynSywED/4J1oh+BgA5CQjEgO1FafxdZglXl+g++juAX5 EUazxWs13wA2Tk3VG8QYb6ypeoT7ERaVmvV26WuGAmQr+bGJ0uF8eJAtd+vpIXkTMIEqQg9 nFks+y7YPPv/Va0nYz5UOvrb6AshkVvBuws8gcr93DJnOG+yGqG0TW4fiiXQ9/+0/Fspvuh 3/GOpMtuAx48U6S1iGG9w== X-UI-Out-Filterresults: notjunk:1;V03:K0:ZJRcXSGf87M=:ziDyFCMpPu/WKmD2uAl465 gj7qCdt50SgX3fxcEG05vJyF5Lb/y6gry1RJk7edywS0+kHElZxzZfN3d8aMmWJTNeTEgm3i/ oMvuCMstTq078AyOtikN804tN0oHgADtTvcbfN1Nw6/mVcEFhzsdY6mcZsT9NDBuWjMFq/lfa IMB5GmJejxRgJlYw1VCKA2f8RDGUU6K9CIIa0Kv1LoMkouxpNJ+yZbN/sSNcmMUG+V3SL9y1Z 3wZzS9Only07yvfsS/DotHr248J3LdSfEVBhSAWTHNUbj1E3rNzG1iaoy4yqKRcnOORc1slXq czpTRa1JghdfYwq8+3W4i1tGyM1IDuekbj9mgghKnc6BszeiZDTEisTaV71TmwoKLwiQN5EHy QxCnLQgt6CAk2FVR0yV7dIKFx/Xp8NSdBAhtjw8E2zStZOA4V4Ws6EvRL1JOMXLy/EILSgZe6 Lo8Te2dzD8MOhndhqAOZ9Xb6VW/xHvK2zfPGNNBYeCxn9IOvpWyTP2sDinx64PwxdQscYGvJv iTXgQZXxHt/L42X3j2QJU6EbajBBB4Ky3Of49r+/Qint7c9p+56zgo99YOqzGNK2RDXS6+PzS 0ohx8ZUQ6aHqJQypKVZEub08T9yW9Bag/HCyb9vgwSNp5U8z4PuGKqekFQouJE8zm5DisFjsU tXSBlXIYvz7yadMOaPTEZrKs15BJYnkyCIYTXiUBKzxgmoka6danxgSin/Sz6uuqQ5FWrAbN9 /OLWpaWPapXKwysCy9tH4U1qscYE2P2Xnm1ekuqV6+7ekNFAvwAQtvu+5CxGu48ykFlT1/EQV b81BwQTxJNA8PAXm6qIDz6hpISGlULl7EWb4GHKxmAxJUqLM1OnJnfzPsJgNNnkB1ADgllsaV ZUAeUUORLueXyC39J5/1u6OueK2F7jmxLBxW6K5UptJ9Q8j9LSQa+uXnEDeP/qPr+kpJFQZXa MUv6JluE7bRH+cMKvLox5d1UWt7uuhGFAF6sWHI3EYQqZVHs7uhDQ2O0FyBI+G8DQxL14pALy DQn5NwJHBonR7Xn59+kLrC+AGrVcTCCUK36Povki7VXKzixcn2MANb/z+8mpMmAeDXmhH7PKO PmPeq2LBl5bW9g= Content-Transfer-Encoding: quoted-printable Subject: Re: [musl] Re: freeswitch and musl 1.2.x (time64 most likely) Am Fri, Oct 29, 2021 at 11:04:45PM +0200 schrieb Szabolcs Nagy: > * Sebastian Kemper [2021-10-29 16:40:02 +0200]: > > (gdb) p current > > $1 =3D 193277741781 > > (gdb) p ¤t > > $2 =3D (apr_time_t *) 0x7fffac90 > > (gdb) p os_now > > $3 =3D 19521141760827868 > > (gdb) p &os_now > > $4 =3D (time_t *) 0x7fffac88 > > (gdb) p timediff > > $5 =3D 19521141756395521 > > these values are completely wrong (may be not set up yet, > you cannot rely on line numbers in optimized code) > > time on your system now should be around > > 1635500000 > > current / 1000000 is > > 193277 > > which is 1970-01-03 05:41:17 > > os_now is far in the future. > Hello Szabolcs, I changed the test program a little bit: =2D-- a/test/testtime.c +++ b/test/testtime.c @@ -21,6 +21,7 @@ #include "testutil.h" #include "apr_strings.h" #include +#include #define STR_SIZE 45 @@ -57,6 +58,7 @@ static void test_now(abts_case *tc, void apr_time_t timediff; apr_time_t current; time_t os_now; + struct tm * timeinfo; current =3D apr_time_now(); time(&os_now); @@ -66,6 +68,10 @@ static void test_now(abts_case *tc, void * that the time will be slightly off, so accept anything between -1 = and * 1 second. */ + timeinfo =3D localtime ( &os_now ); + printf ( "Current local time and date: %s - %lld seconds since epoch\= n", asctime (timeinfo), os_now); + timeinfo =3D localtime ( ¤t ); + printf ( "Current APR time and date: %s - %lld seconds since epoch\n"= , asctime (timeinfo), current); ABTS_ASSERT(tc, "apr_time and OS time do not agree", (timediff > -2) && (timediff < 2)); } The output is: Current local time and date: Sat Oct 30 00:25:11 2021 - 702461791684265854= 9 seconds since epoch Current APR time and date: Mon Jan 5 10:46:45 1970 - 1635546302107561 sec= onds since epoch |Line 76: apr_time and OS time do not agree (gdb) b time Breakpoint 1 at 0x77fd0b08: file compat/time32/time32.c, line 7. (gdb) b gettimeofday Breakpoint 2 at 0x77fcff6c: file compat/time32/gettimeofday_time32.c, line= 7. (gdb) b apr_time_now Function "apr_time_now" not defined. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 3 (apr_time_now) pending. (gdb) c Continuing. Breakpoint 1, time (p=3D0x7fffac90) at compat/time32/time32.c:7 7 { (gdb) next 8 time_t t =3D time(0); (gdb) 9 if (t < INT32_MIN || t > INT32_MAX) { (gdb) 13 if (p) *p =3D t; (gdb) 14 return t; (gdb) test_now (tc=3D0x7fffacd0, data=3D0x0) at testtime.c:66 66 timediff =3D os_now - (current / APR_USEC_PER_SEC); (gdb) p os_now $1 =3D 7024617916842658549 (gdb) p current $2 =3D 1635546302107561 (gdb) p APR_USEC_PER_SEC $3 =3D 1000000 (gdb) c Continuing. [Inferior 1 (process 15506) exited with code 01] So OS time is correct. Something not working right with apr. > > (gdb) p &timediff > > $6 =3D (apr_time_t *) 0x7fffac98 > > (gdb) p time > > $7 =3D {time32_t (time32_t *)} 0x77fd0b08