[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1120447: Zoneminder in trixie not functional in armhf architecture



Package: zoneminder
Version: 1.36.35+dfsg1-1
Severity: important
X-Debbugs-Cc: debian-arm@lists.debian.org, burban@fdn.fr
User: debian-arm@lists.debian.org
Usertags: armhf

Hi!

I have used zoneminder successfully up to bookworm on armhf (a Cubox
for the record) with one USB camera and one IP camera.

After upgrading to trixie, process zmc crashes quickly:

(below from /var/log/zm/zmdc.log)
11/06/25 12:04:35.703746 zmdc[24875].INF [ZMServer:411] [Starting pending process, zmc -d /dev/video4]
11/06/25 12:04:35.777008 zmdc[24875].INF [ZMServer:411] ['zmc -d /dev/video4' starting at 25/11/06 12:04:35, pid = 25125]
11/06/25 12:04:35.777041 zmdc[25125].INF [ZMServer:411] ['zmc -d /dev/video4' started at 25/11/06 12:04:35]
11/06/25 12:04:36.126975 zmdc[24875].INF [ZMServer:716] ['zmc -d /dev/video4' crashed, signal 10]

The other processes of zoneminder are running ok, the apache web
server is functional; but no a single camera picture to visualize.

I have also run zoneminder with the sames cameras on a classic amd64
PC, and everything worked flawlessly. So an architecture related
problem is likely.

I recompiled zoneminder package with debugging info, both on amd64 and
armhf. There were a couple of C++ compilation warnings on amd64 of the
pedantic nature, but far more for armhf, and potentially serious,
mostly related to time_t, below an excerpt:

~/sources/zoneminder/zoneminder-1.36.35+dfsg1/src/zm_event.cpp:96:11: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 9 has type ‘__time64_t’ {aka ‘long l
ong int’} [-Wformat=]
~/sources/zoneminder/zoneminder-1.36.35+dfsg1/src/zm_event.cpp:96:11: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 10 has type ‘__suseconds64_t’ {aka ‘
long long int’} [-Wformat=]

If I run gdb (only my USB camera was plugged in for this test):

root@cubox:~# su - www-data -s /bin/sh -c "gdb /tmp/zmc"
GNU gdb (Debian 16.3-1) 16.3
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /tmp/zmc...
(gdb) run -d /dev/video0
Starting program: /tmp/zmc -d /dev/video0
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
[New Thread 0xaf346ca0 (LWP 29768)]

Thread 1 "zmc" received signal SIGSEGV, Segmentation fault.
__GI_strlen () at ../sysdeps/arm/armv6t2/strlen.S:126
warning: 126	../sysdeps/arm/armv6t2/strlen.S: No such file or directory
(gdb) bt
#0  __GI_strlen () at ../sysdeps/arm/armv6t2/strlen.S:126
#1  0xb44b3c4c in __printf_buffer (buf=buf@entry=0xbeffe4e0, format=<optimized out>, ap=..., mode_flags=mode_flags@entry=2) at vfprintf-process-arg.c:435
#2  0xb44c940c in __vsnprintf_internal
    (string=string@entry=0x0, maxlen=maxlen@entry=0, format=format@entry=0x11149c8 "INSERT INTO `Logs` ( `TimeKey`, `Component`, `ServerId`, `Pid`, `Level`, `Code`, `Message`, `File`, `Line` ) VALUES ( %ld.%06ld, '%s', %d, %d, %d, '%s', '%s', '%s', %d )", args=..., args@entry=..., mode_flags=mode_flags@entry=2) at vsnprintf.c:96
#3  0xb452e578 in ___snprintf_chk
    (s=s@entry=0x0, maxlen=maxlen@entry=0, flag=flag@entry=1, slen=slen@entry=4294967295, format=0x11149c8 "INSERT INTO `Logs` ( `TimeKey`, `Component`, `ServerId`, `Pid`, `Level`, `Code`, `Message`, `File`, `Line` ) VALUES ( %ld.%06ld, '%s', %d, %d, %d, '%s', '%s', '%s', %d )") at snprintf_chk.c:38
#4  0x00414b2e in snprintf (__s=0x0, __n=0, __fmt=<optimized out>) at /usr/include/arm-linux-gnueabihf/bits/stdio2.h:68
#5  stringtf<long long, long long, char const*, unsigned int, int, int, char const*, char const*, char const*, int>
    (format="INSERT INTO `Logs` ( `TimeKey`, `Component`, `ServerId`, `Pid`, `Level`, `Code`, `Message`, `File`, `Line` ) VALUES ( %ld.%06ld, '%s', %d, %d, %d, '%s', '%s', '%s', %d )")
    at ./src/zm_utils.h:53
#6  Logger::logPrint (this=0x10e8338, hex=hex@entry=false, filepath=<optimized out>, line=line@entry=446, level=<optimized out>, level@entry=0, fstring=<optimized out>)
    at ./src/zm_logger.cpp:539
#7  0x00470858 in LocalCamera::LocalCamera
    (this=this@entry=0x10fa608, monitor=monitor@entry=0x1112b20, p_device="/dev/video0", p_channel=<optimized out>, p_standard=<optimized out>, p_v4l_multi_buffer=<optimized out>, p_v4l_captures_per_frame=<optimized out>, p_method=<optimized out>, p_width=<optimized out>, p_height=<optimized out>, p_colours=<optimized out>, p_palette=<optimized out>, p_brightness=<optimized out>, p_contrast=<optimized out>, p_hue=<optimized out>, p_colour=<optimized out>, p_capture=<optimized out>, 
    p_capture@entry=true, p_record_audio=<optimized out>, p_extras=<optimized out>) at ./src/zm_local_camera.cpp:446
#8  0x00421a42 in ZM::make_unique<LocalCamera, Monitor*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, int&, int&, bool&, unsigned int&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned int&, unsigned int&, int&, int&, int&, int&, int&, int&, bool, bool&, int&> () at ./src/zm_utils.h:79
#9  Monitor::LoadCamera (this=this@entry=0x1112b20) at ./src/zm_monitor.cpp:707
#10 0x004288bc in Monitor::LoadCamera (this=0x1112b20) at ./src/zm_monitor.cpp:571
#11 Monitor::Load (this=this@entry=0x1112b20, dbrow=dbrow@entry=0x1110b38, load_zones=load_zones@entry=true, p=p@entry=Monitor::CAPTURE) at ./src/zm_monitor.cpp:675
#12 0x0042d7da in Monitor::LoadMonitors (where="`Function` != 'None' AND `Type` = 'Local' AND `Device`='/dev/video0'", purpose=purpose@entry=Monitor::CAPTURE)
    at /usr/include/c++/14/bits/shared_ptr_base.h:1666
#13 0x0042dd36 in Monitor::LoadLocalMonitors (device=device@entry=0xbeffff13 "/dev/video0", purpose=purpose@entry=Monitor::CAPTURE) at ./src/zm_monitor.cpp:2344
#14 0x0040a578 in main (argc=<optimized out>, argv=<optimized out>) at ./src/zmc.cpp:197
(gdb) quit

It is easy to drop the call to Logger::logPrint by suppressing logging to database, which then gives:

root@cubox:~# su - www-data -s /bin/sh -c "gdb /tmp/zmc"
GNU gdb (Debian 16.3-1) 16.3
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "arm-linux-gnueabihf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /tmp/zmc...
(gdb) run -d /dev/video0
Starting program: /tmp/zmc -d /dev/video0
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
[New Thread 0xaf346ca0 (LWP 30014)]
11/09/25 23:23:02.000000 zmc_dvideo0[30012].ERR-zm_local_camera.cpp/970 [Failed to set video standard 45056: 25 Inappropriate ioctl for device]

[New Thread 0xae159ca0 (LWP 30015)]
[New Thread 0xad958ca0 (LWP 30016)]

Thread 4 "zmc" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xad958ca0 (LWP 30016)]
__GI_strlen () at ../sysdeps/arm/armv6t2/strlen.S:69
warning: 69	../sysdeps/arm/armv6t2/strlen.S: No such file or directory
(gdb) bt
#0  __GI_strlen () at ../sysdeps/arm/armv6t2/strlen.S:69
#1  0xb44b3c4c in __printf_buffer (buf=buf@entry=0xad9581b0, format=<optimized out>, ap=..., mode_flags=mode_flags@entry=2) at vfprintf-process-arg.c:435
#2  0xb44c940c in __vsnprintf_internal
    (string=string@entry=0x0, maxlen=maxlen@entry=0, format=format@entry=0xacc00b38 "INSERT INTO `Events` ( `MonitorId`, `StorageId`, `Name`, `StartDateTime`, `Width`, `Height`, `Cause`, `Notes`, `StateId`, `Orientation`, `Videoed`, `DefaultVideo`, `SaveJPEGs`, `Scheme` ) VALUES ( %d,"..., args=..., args@entry=..., mode_flags=mode_flags@entry=2) at vsnprintf.c:96
#3  0xb452e578 in ___snprintf_chk
    (s=s@entry=0x0, maxlen=maxlen@entry=0, flag=flag@entry=1, slen=slen@entry=4294967295, format=0xacc00b38 "INSERT INTO `Events` ( `MonitorId`, `StorageId`, `Name`, `StartDateTime`, `Width`, `Height`, `Cause`, `Notes`, `StateId`, `Orientation`, `Videoed`, `DefaultVideo`, `SaveJPEGs`, `Scheme` ) VALUES ( %d,"...) at snprintf_chk.c:38
#4  0x00463856 in snprintf (__s=0x0, __n=0, __fmt=<optimized out>) at /usr/include/arm-linux-gnueabihf/bits/stdio2.h:68
#5  stringtf<unsigned int, unsigned int, long long, unsigned int, unsigned int, char const*, char const*, unsigned int, Monitor::Orientation, int, char const*, int, char const*>
    (format="INSERT INTO `Events` ( `MonitorId`, `StorageId`, `Name`, `StartDateTime`, `Width`, `Height`, `Cause`, `Notes`, `StateId`, `Orientation`, `Videoed`, `DefaultVideo`, `SaveJPEGs`, `Scheme` ) VALUES ( %d,"...) at ./src/zm_utils.h:53
#6  Event::Event
    (this=this@entry=0xacc00738, p_monitor=p_monitor@entry=0x1112b20, p_packetqueue_it=p_packetqueue_it@entry=0xacc00718, p_start_time=..., p_cause=<optimized out>, p_noteSetMap=<optimized out>) at ./src/zm_event.cpp:133
#7  0x00425118 in Monitor::openEvent
    (this=this@entry=0x1112b20, snap=std::shared_ptr<ZMPacket> (use count 3, weak count 0) = {...}, cause="Motion", noteSetMap=std::map with 1 element = {...})
    at ./src/zm_monitor.cpp:2696
#8  0x0042c704 in Monitor::Analyse (this=<optimized out>) at ./src/zm_monitor.cpp:1986
#9  0x00459016 in AnalysisThread::Run (this=0x1110b28) at ./src/zm_analysis_thread.cpp:27
#10 0xb4704622 in ??? () at /lib/arm-linux-gnueabihf/libstdc++.so.6
#11 0xb44d116a in start_thread (arg=0xad958ca0) at pthread_create.c:448
#12 0xb45250e8 in ??? () at ../sysdeps/unix/sysv/linux/arm/clone3.S:71
(gdb) quit
A debugging session is active.

	Inferior 1 [process 30012] will be killed.

Quit anyway? (y or n) y
root@cubox:~#

Here we can avoid the call to Monitor::Analyse by unchecking "Analysis
Enabled" in my camera configuration "Modect"; then the zmc process
isn't killed anymore, and I can view the camera video on the web
server! But you don't use zoneminder if you don't need motion
detection, so this isn't a solution.

I believe this is solely a Debian packaging issue (due to the early
commitment of the project to 64 bits time_t), but it may become an
upstream issue.

For the record considering upstream, there was recently a close bug
for a Raspberry PI 2B, which I believe is also armhf:
https://forums.zoneminder.com/viewtopic.php?t=34151

-- System Information:
Debian Release: 13.1
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: armhf (armv7l)

Kernel: Linux 6.12.48+deb13-armmp (SMP w/4 CPU threads)
Kernel taint flags: TAINT_CRAP
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages zoneminder depends on:
ii  default-mysql-client                    1.1.1
ii  fonts-glyphicons-halflings              1.009~3.4.1+dfsg-6
ii  javascript-common                       12+nmu1
ii  libapache2-mod-php8.4 [php-json]        8.4.11-1
ii  libarchive-zip-perl                     1.68-1
ii  libavcodec61                            7:7.1.2-0+deb13u1
ii  libavformat61                           7:7.1.2-0+deb13u1
ii  libavutil59                             7:7.1.2-0+deb13u1
ii  libc6                                   2.41-12
ii  libclass-std-fast-perl                  0.0.8-4
ii  libcrypt-eksblowfish-perl               0.009-3+b4
ii  libdata-dump-perl                       1.25-1
ii  libdata-entropy-perl                    0.008-1
ii  libdata-uuid-perl                       1.227-1+b1
ii  libdate-manip-perl                      6.98-1
ii  libdbd-mysql-perl                       4.053-1
ii  libdevice-serialport-perl               1.04-4+b5
pn  libdigest-sha-perl                      <none>
ii  libgcc-s1                               14.2.0-19
ii  libgcrypt20                             1.11.0-7
ii  libgnutls30t64                          3.8.9-3
ii  libimage-info-perl                      1.45-1
ii  libio-socket-multicast-perl             1.12-3+b5
ii  libjpeg62-turbo                         1:2.1.5-4
ii  libjson-maybexs-perl                    1.004008-1
ii  libjwt-gnutls2                          1.17.2-1
ii  libmariadb3                             1:11.8.3-0+deb13u1
ii  libmime-lite-perl                       3.033-2
ii  libmime-tools-perl                      5.515-1
ii  libnet-sftp-foreign-perl                1.93+dfsg-1
ii  libnumber-bytes-human-perl              0.11-4
ii  libpcre2-8-0                            10.46-1~deb13u1
ii  libphp-serialization-perl               0.34-4
ii  libsoap-wsdl-perl                       3.004-2
ii  libstdc++6                              14.2.0-19
ii  libswresample5                          7:7.1.2-0+deb13u1
ii  libswscale8                             7:7.1.2-0+deb13u1
ii  libsys-cpu-perl                         0.61-3+b4
ii  libsys-meminfo-perl                     0.99-2+b4
ii  libsys-mmap-perl                        0.20-2+b4
ii  liburi-encode-perl                      1.1.1-3
ii  libwww-perl                             6.78-1
ii  mariadb-client [virtual-mysql-client]   1:11.8.3-0+deb13u1
ii  perl [libmodule-load-conditional-perl]  5.40.1-6
ii  php-apcu                                5.1.24-1
ii  php-gd                                  2:8.4+96
ii  php-intl                                2:8.4+96
ii  php-mysql                               2:8.4+96
ii  php8.4-apcu [php-apcu]                  5.1.24-1
ii  php8.4-cli [php-json]                   8.4.11-1
ii  php8.4-gd [php-gd]                      8.4.11-1
ii  php8.4-intl [php-intl]                  8.4.11-1
ii  sysvinit-utils                          3.14-4
ii  zip                                     3.0-15
ii  zlib1g                                  1:1.3.dfsg+really1.3.1-1+b1

Versions of packages zoneminder recommends:
ii  apache2 [httpd]                             2.4.65-2
ii  default-mysql-server                        1.1.1
ii  ffmpeg                                      7:7.1.2-0+deb13u1
ii  libapache2-mod-php                          2:8.4+96
ii  libapache2-mod-php8.4 [libapache2-mod-php]  8.4.11-1
ii  mariadb-server [virtual-mysql-server]       1:11.8.3-0+deb13u1
pn  zoneminder-doc                              <none>

Versions of packages zoneminder suggests:
pn  fcgiwrap   <none>
ii  logrotate  3.22.0-1
pn  net-tools  <none>
pn  pkexec     <none>

-- no debconf information

Reply to: