Hello Waldemar,
Waldemar Brodkorb <wbx(a)openadk.org> schrieb am Freitag, 8. März 2024 um 18:32:
Hi Kevin,
Kevin Ingwersen wrote,
> Hello there!
>
> After successfuly building my OpenADK image and
launching into an mksh shell, I noticed that some programs behaved very, very weirdly.
Especially in terms of time.
>
> For instance, take this `ps` (coreutils) output:
>
> # ps -ef
> UID PID PPID C STIME TTY TIME CMD
> root 1 0 99 Mar02 pts/0 1158050441-07:00:15 /bin/mksh -il
> root 40 1 99 Mar02 pts/0 1158050441-07:00:15 ps -ef
>
> It never changes, ever. However, `date` reports
the time correctly:
>
> root@d6571a5cd187:/ # date "+%s"
> 1709916714
>
> But Git and even GCC all hang and behave weirdly.
Git can't even fetch a basic repo, because it believes the time in the index to be
totally wrong.
>
> Do you have an idea what this is caused by?
>
> And yes, I did change my timezone with the TZ
environment variable, too:
>
> root@d6571a5cd187:/ # export
TZ="Europe/Berlin"
> root@d6571a5cd187:/ # date "+%s"
> 1709916972
> root@d6571a5cd187:/ # ps -ef
> UID PID PPID C STIME TTY TIME CMD
> root 1 0 99 Mar02 pts/0 1158050441-07:00:15 /bin/mksh -il
> root 42 1 99 Mar02 pts/0 1158050441-07:00:15 ps -ef
>
The container
runs with --previleged, so I thought to just change the time:
What container technology do you use? Is your base
system still a
Debian system?
I use Podman/crun as I couldn't get the normal docker/containerd to run. As far as I
am aware, this effectively spawns but a namespace and configures cgroups to run the
processes in. That said, I am not too familiar with the full internals of neither Podman
nor Docker.
> > root@d6571a5cd187:/ # ntpclient -h ptbtime1.ptb.de -s
> > 45357 61036.066 22575.0 24.0 -16383.9 15.3 4056424
> > root@d6571a5cd187:/ # ps -ef
> > UID PID PPID C STIME TTY TIME CMD
> > root 1 0 99 Mar02 pts/0 1158050441-07:00:15 /bin/mksh -il
> > root 44 1 99 Mar02 pts/0 1158050441-07:00:15 ps -ef
>
> > My only lead is that part of the time is wrong...
>
> > I attached my OpenADK and Kernel config, and even extracted the generated
uClibc-ng config from the build too (well, from the toolchain build).
>
> > Also, I did try to just mount the /etc files into the container as well, but
that did not help apparently.
>
> > Any idea what's going wrong here or how I could debug this? Thanks!
You could install strace and see what might be wrong.
We recently added time64 support for 32Bit architectures, but this
should not influence any 64 Bit architecture like riscv64.
Ah yes, strace! Thanks for the reminder, I will add that and see what happens.
> I try to reproduce it in Qemu.
best regards
Waldemar
Looking forward to it! The chip I use, JH7110, has these extensions enabled:
# /nvme/opt/cpu_features/out/list_cpu_features
arch : risc-v
vendor : sifive
microarchitecture : u74-mc
flags : A,C,D,F,M,RV64I,Zicsr,Zifencei
(via Google's cpu_features)
This might aid in setting up the Qemu box.
Kind regards and thanks for looking into this,
Kevin Ingwersen