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,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 2039 invoked from network); 27 Oct 2021 23:43:36 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 27 Oct 2021 23:43:36 -0000 Received: (qmail 1202 invoked by uid 550); 27 Oct 2021 23:43:33 -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 1170 invoked from network); 27 Oct 2021 23:43:33 -0000 X-Virus-Scanned: Debian amavisd-new at disroot.org Mime-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1635378200; bh=vLVQ9GkCJz78sXtR7zFiSNrFIkowvisz9LjBTqfEWsc=; h=Subject:From:To:Date:In-Reply-To; b=EgURTdIU1HFi/3acbnFgFS0k2nUlGHldfsX8oY+K09S43NXk81qlKEo57PVAe97T7 +5YuzxRWears1x1Fuhem2EMkW/2+AzA1aT8q8e9LdzADQ4+KE4UbM1qhn5/8oizB18 oiJ4sJLtA9wkf21YA4mKf0TtGUWjgIEY7nOWwyjW+oJIxSJlUJzHQ6wyYXnDlJa/Nt sprf9vF//SaAo+22WVEuAS5o5Vdlb4YkWZcrTrcQQNr6s1aLUZUwWTNuPg1Oi22VQy tHf+aMTZqsK5L2bHkP8rF0qJ6xqIathFt7wF2Oah8MJxACbGFtIdF4cHDuVSOAnFfW tdHqITziM8gWA== Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 From: =?utf-8?q?=C3=89rico_Nogueira?= To: Date: Wed, 27 Oct 2021 20:24:37 -0300 Message-Id: In-Reply-To: Subject: Re: [musl] freeswitch and musl 1.2.x (time64 most likely) On Wed Oct 27, 2021 at 7:16 PM -03, Sebastian Kemper wrote: > Hi all, > > I put OpenWrt with musl 1.2.x on my router. freeswitch was updated a bit > in preparation for time64 libc. This snippet was added: > > #if __USE_TIME_BITS64 > #define TIME_T_FMT SWITCH_INT64_T_FMT > #else > #define TIME_T_FMT "ld" > #endif > > And the few places where during compilation there were new warnings > (time_t related) I replaced some '%ld' with TIME_T_FMT and they > disappeared. What they should be doing is always defining TIME_T_FMT to "lld" and casting the values to be formatted to (long long). Hardcoding platform details like that is broken and just generally a terrible idea. I started working on a patch, you can find it here [1]. [1] https://github.com/signalwire/freeswitch/pull/1409 However, the code does seem to be correct, so there's probably something wrong in a place where they aren't using TIME_T_FMT. > > But now I try to start freeswitch on the router and it doesn't work. It > either just exits somehow or it segfaults. The logs on the router show > that freeswitch puts the wrong time stamps. So there must still be some > time64 problem hidden somewhere. > > Wed Oct 27 23:44:35 2021 daemon.info freeswitch[10181]: 1970-01-01 > 00:24:12.-055227 0.00% [NOTICE] switch_loadable_module.c:223 Adding > Codec SPEEX 99 Speex 8000hz 20ms 1ch 24600bps > Wed Oct 27 23:44:35 2021 daemon.info freeswitch[10181]: 1970-01-01 > 00:24:12.-066240 0.00% [CONSOLE] switch_loadable_module.c:2191 open of > pre_load_modules.conf failed > Wed Oct 27 23:44:35 2021 daemon.info freeswitch[10181]: 1970-01-01 > 00:24:12.-066240 0.00% [INFO] switch_core_sqldb.c:3593 Opening DB > Wed Oct 27 23:44:35 2021 daemon.info freeswitch[10181]: 1970-01-01 > 00:24:12.-054973 0.00% [INFO] switch_core_sqldb.c:1842 CORE Starting SQL > thread. > Wed Oct 27 23:44:35 2021 daemon.info freeswitch[10181]: 1970-01-01 > 00:24:12.-062042 0.00% [CONSOLE] switch_loadable_module.c:1768 > Successfully Loaded [mod_logfile] > > This is the end of the log. And then freeswitch just disappeared. > > I'm not a programmer, so looking at the code is a bit of a hurdle :D I > think that the time basics are set up in src/switch_time.c ([1]) and > src/include/switch_apr.h ([2]). I'm wondering if anybody could maybe > give these files a look and check if you see something obvious? * > (pretty please) * Or maybe give me a hint how to narrow it down? I guess > I should do a backtrace? Please do obtain a backtrace. A line number to look at helps plenty! > > Kind regards, > Sebastian > > [1] > https://github.com/signalwire/freeswitch/blob/master/src/switch_time.c > [2] > https://github.com/signalwire/freeswitch/blob/master/src/include/switch_a= pr.h