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 25049 invoked from network); 29 Oct 2021 14:40:19 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 29 Oct 2021 14:40:19 -0000 Received: (qmail 29776 invoked by uid 550); 29 Oct 2021 14:40:16 -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 29744 invoked from network); 29 Oct 2021 14:40:15 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1635518404; bh=xHd6ngs31+izcNoAvVhh/Nk5pQHshaqfQs7P8HoPV6c=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=JpyYlCA3ShfPB71gj5lvm+3Odfj+rbjIcnYnwoudyNQ5d9+77x4WAd7KZY9sSneno z3JV9M5VOr6s5221T8EFJ68qkZmagSzP76ypjjeVU5LVFvQ4hzJQlDpvdW6cE6wKiQ oe3I0bTGXJwtXZh8M3Zdo54P2z/cuSxSW+81AEQ0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Date: Fri, 29 Oct 2021 16:40:02 +0200 From: Sebastian Kemper To: musl@lists.openwall.com Cc: =?iso-8859-1?Q?=C9rico?= Nogueira Message-ID: Mail-Followup-To: musl@lists.openwall.com, =?iso-8859-1?Q?=C9rico?= Nogueira References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: X-Provags-ID: V03:K1:9q66MgG1mYgDHBolYsVQSV5vODGlhvjAyN9RYlWGpNKwWZZyzPy vfx8hPuxjOJtl5Q7jCDwlcm0wTEI+dFELdv/gkbO2yKaypNOEZiwEmTVIy+bV8EB60zA06b WQzYE2eqH13eC0bMyVnyEC1vcSw+JYTGBfOUIWeMoms5258v/GzZKDdtc14BghtBPzAuXeX YGp4O9ZmSAXnxclQty0Rw== X-UI-Out-Filterresults: notjunk:1;V03:K0:qzj63zzrHRQ=:71eCEfUnUOjn3ECs8bltrs kXOuKQXOaEY1EUF/n+ZVrIKvUHXJc4ocynzM5hvVp76v3t/YDtGWOc5Gd0Dy44XFC2K7qjcox J1vuOFC3+tCCGmP3cgIg6JvcinBKr0gg+nreVxPIdwWTzhKJH22W+ZnLMV9iuu+vAnBMwB6Kv S1JucA1s7CGfzwN+TvC3JQHcistiuVBhsoAXNlFrrML4nYs1i5gR+yfWfkC1DV2nS0B7XcfO/ B52yj9UofykxKAKaZkxTddHwTaF/s/uNtG2SJBWq0RZBwt2KX72adUXN9PoqvehkMlnf8lPu5 +hKr5OVDgWBVExiDwdorH6pkQQdzOf+jKwWFcYKL7wUKveWU+aQ3Escs4V+BwuiucVAfzwDZt OowBWCTC6yof8/kG1hoI+vcT4iwyiX3/lTgUiVgn7/leZrAm+gw/QcpCQJAHIidzodyEcmWhI jvtj6iU516EW7Jc8krUBebV/yiy39W5jmrUK8zbPWY311oLBUJ9IyMpPrF6pv3QZxJHrNgnlF FNYj00czCD/sbD7jHn1YXaMgg82hc1u+inpzgdidO8ow7i6B9guwIZn/dcxbTVJFDOGAuBB3G 8a6M2aWVZZIsED+zOkuAs+JClTRtJ+Tdz7hv97jyrpxtVLa4xAeop619uobRHFYeyIbnLMf/d mlzYqlQJnuaTZO9aIsR26DNrQP9ebvlI0MaBkeeF/nsirph0nsjjFuI2xP9yT6xb5pUYBP1VH D3Pes/GZzUKSDJk7yZHGFxBLcM/iEJY9o15/uu7WTb1Ccu8tCRDi/PCjt4ksMJbluQPmcLYRK 0bM5fkuc0RGfRHcCg3UmVlUHNpVtYjC3bSsVZrJrfEeuHjLWM/5FS6aKxCzhGvwbFKyN9oWhb FZqeF+i2+piSWMbnIzaixESDlfemwL7Kxg/IrGUNCbw15f8wUh9rrNk4pfjmba3SvXb+xAqIT KMkoWpHbOvPv455QhFwyTC2opY5gMKlbKcXNSQavAycFG17lwJWe//mBOYz4qy+wN4jTg1Myx p3dA60k/Q/e3BtehqMVslhTJbank4iAqEuEsRX3zkxCdRQeYm2FRwPV1igPtf2zHgZZtL9Q0k 2g9i1eJEs3TkAI= Subject: Re: [musl] Re: freeswitch and musl 1.2.x (time64 most likely) Am Fri, Oct 29, 2021 at 12:10:05AM -0300 schrieb =C9rico Nogueira: > > Line 3554 is: > > sql =3D switch_mprintf("delete from registrations where expires > 0 an= d expires <=3D %ld and hostname=3D'%q'", now, switch_core_get_switchname()= ); > > It's using '%ld' for 'now', which is time_t. Will add a commit to fix it > in my PR. Replace with '%lld' if you want to do a quick fix to see if > you catch any other errors. > Thanks! The segfault now doesn't happen anymore. Now freeswitch seems to loop around (unusable). The log is plastered with these messages: 1970-01-01 00:36:58.-797115 23.33% [CRIT] switch_time.c:1203 Virtual Migra= tion Detected! Syncing Clock 1970-01-01 00:36:58.-797115 23.33% [INFO] switch_time.c:626 Clock synchron= ized to system time. 1970-01-01 00:36:58.-797115 23.33% [CRIT] switch_time.c:1203 Virtual Migra= tion Detected! Syncing Clock 1970-01-01 00:36:58.-797115 23.33% [INFO] switch_time.c:626 Clock synchron= ized to system time. I have a hunch that that is an issue with libapr, which freeswitch has bundled. Incidentally, a few days ago I was playing around with mod php and apache (which I'm sure you know uses apr). I put up a small php website which shows the date and time. And whenever I hit F5 in the browser it would give me a different wrong time and date, but always around 1970. I found that apr bundles a test suite. This also includes a test called "testtime". It finds that the apr time is way different compared to OS time. Code snippet: static void test_now(abts_case *tc, void *data) { apr_time_t timediff; apr_time_t current; time_t os_now; current =3D apr_time_now(); time(&os_now); timediff =3D os_now - (current / APR_USEC_PER_SEC); /* Even though these are called so close together, there is the chance * that the time will be slightly off, so accept anything between -1 a= nd * 1 second. */ ABTS_ASSERT(tc, "apr_time and OS time do not agree", (timediff > -2) && (timediff < 2)); } This happens when I run it (the other two "Line" warnings are from different tests!): testtime : |Line 69: apr_time and OS time do not agree |Line 110: Mismatch in tm_sec |Line 204: expected , but saw FAILED 3 of 13 Failed Tests Total Fail Failed % =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D testtime 13 3 23.08% (gdb) b test/testtime.c:57 Breakpoint 1 at 0x405837: file testtime.c, line 61. (gdb) c Continuing. Breakpoint 1, test_now (tc=3D0x7fffacd0, data=3D0x0) at testtime.c:61 61 current =3D apr_time_now(); (gdb) bt #0 test_now (tc=3D0x7fffacd0, data=3D0x0) at testtime.c:61 #1 0x00404b43 in abts_run_test (ts=3D0x77f0bde0, f=3D0x40581d ,= value=3D0x0) at abts.c:171 #2 0x00406733 in testtime (suite=3D0x77f0bde0) at testtime.c:300 #3 0x004055d9 in main (argc=3D3, argv=3D0x7fffadb4) at abts.c:429 (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 (gdb) p &timediff $6 =3D (apr_time_t *) 0x7fffac98 (gdb) p time $7 =3D {time32_t (time32_t *)} 0x77fd0b08