mailing list of musl libc
 help / color / mirror / code / Atom feed
From: "Érico Nogueira" <ericonr@disroot.org>
To: <musl@lists.openwall.com>
Subject: Re: [musl] freeswitch and musl 1.2.x (time64 most likely)
Date: Wed, 27 Oct 2021 20:24:37 -0300	[thread overview]
Message-ID: <CFAKSI0AEFZ8.39SR8Z2VS0G87@mussels> (raw)
In-Reply-To: <YXnP2OyicBdPLRKM@darth.lan>

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_apr.h


  reply	other threads:[~2021-10-27 23:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-27 22:16 Sebastian Kemper
2021-10-27 23:24 ` Érico Nogueira [this message]
2021-10-28 20:21 ` [musl] " Sebastian Kemper
2021-10-28 21:34   ` Sebastian Kemper
2021-10-29  3:10     ` Érico Nogueira
2021-10-29 14:40       ` Sebastian Kemper
2021-10-29 21:04         ` Szabolcs Nagy
2021-10-29 22:44           ` Sebastian Kemper
2021-10-30  1:00             ` Rich Felker
2021-10-30 10:57               ` Sebastian Kemper
2021-10-30 17:56                 ` Rich Felker
2021-10-30 19:07                   ` Sebastian Kemper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CFAKSI0AEFZ8.39SR8Z2VS0G87@mussels \
    --to=ericonr@disroot.org \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).