Package: watchdog
Version: 5.15-2
Severity: important
Tags: upstream

Dear Maintainer,

I'm using watchdog daemon on multiple type of hardware and it seems there is a
bug on arm64.
Command "getconf PAGESIZE" returns 4096 si I sized allocatable-memory options
using this value.
However the system immediately rebooted because "cannot allocate 6637223936
bytes (errno = 12 = 'Cannot allocate memory')".

Well, the problem is with 4096 bytes pages, this value in bytes is absolutely
wrong. Log entry when starting the service actually shows that the used
pagesize is 65536: "memory: minimum pages = 0 free, 101276 allocatable (65536
byte pages)".

So I tried to understand why such thing occurred:
The log entry with incorrect pagesize is here:
https://sourceforge.net/p/watchdog/code/ci/master/tree/src/watchdog.c#l253
And the variable containing the pagesize here:
https://sourceforge.net/p/watchdog/code/ci/master/tree/src/watchdog.c#l26

My understanding is that this is incorrect. While it seems to work on amd64 it
does not on arm64, because I suspect arm64 build machine has different settings
that my Jetsons systems.
I'm pretty sure this is not correct, pagesize should be detected at runtime,
not at buildtime.

And I actually found a proof for that:
https://reviews.llvm.org/file/data/czbtafe5ozyi25sxhbeq/PHID-FILE-
qpahm22gtfydywupbps5/file

It seems indeed that using EXEC_PAGESIZE is marked as unreliable on non x86
architectures and uses instead a call to sysconf, which is equivalent to the
getconf command I used to check the actual pagesize on my Jetson boards.

Thanks in advance,

Regards, Adam.



-- System Information:
Debian Release: 10.6
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.19.0-12-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages watchdog depends on:
ii  debconf [debconf-2.0]  1.5.71
ii  init-system-helpers    1.56+nmu1
ii  libc6                  2.28-10
ii  lsb-base               10.2019051400
ii  udev                   241-7~deb10u4

watchdog recommends no packages.

watchdog suggests no packages.

Reply via email to