Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 338400 - www-misc/zoneminder-1.24.2 need patch for amd64 for rtsp support
Summary: www-misc/zoneminder-1.24.2 need patch for amd64 for rtsp support
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Andreas K. Hüttel
URL:
Whiteboard: [dilfridge overlay]
Keywords:
Depends on: 359605
Blocks:
  Show dependency tree
 
Reported: 2010-09-23 01:35 UTC by Ron
Modified: 2011-09-17 22:11 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ron 2010-09-23 01:35:31 UTC
rtsp is broken on amd64 machines
Needs patch added to ebuild for amd64:

http://www.zoneminder.com/forums/viewtopic.php?t=16060 (see this link for full description of the issue)

diff -ur ZoneMinder-1.24.2.old/src/zm.h ZoneMinder-1.24.2/src/zm.h 
--- ZoneMinder-1.24.2.old/src/zm.h   2009-03-20 05:07:00.000000000 -0700 
+++ ZoneMinder-1.24.2/src/zm.h   2010-06-29 10:45:24.000000000 -0700 
@@ -17,6 +17,8 @@ 
 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. 
 // 
  
+#include "stdint.h" 
+ 
 #ifndef ZM_H 
 #define ZM_H 
  
@@ -34,14 +36,14 @@ 
 #endif 
 } 
  
-typedef unsigned char       U8; 
-typedef unsigned short      U16; 
-typedef unsigned long       U32; 
-typedef unsigned long long  U64; 
- 
-typedef signed char         S8; 
-typedef signed short        S16; 
-typedef signed long         S32; 
-typedef signed long long    S64; 
+typedef uint8_t             U8; 
+typedef uint16_t            U16; 
+typedef uint32_t            U32; 
+typedef uint64_t            U64; 
+ 
+typedef int8_t              S8; 
+typedef int16_t             S16; 
+typedef int32_t             S32; 
+typedef int64_t             S64; 
  
 #endif // ZM_H

Tested patch, and it corrects the problem


Reproducible: Always

Steps to Reproduce:
1.emerge -v zoneminder-1.24.2
2.configure zoneminder to work with a rtsp camera
3.fails to display video. 





Actual Results:  
zm_debug.log reports numerous errors


Manaully applied patch. recompiled and problem disappeared.
Note this problem only affects amd64 64-bit machines. Perhaps the patch can be applied in the ebuild for only 64-bit systems
Comment 1 Kevin Pyle 2010-10-17 05:14:14 UTC
(In reply to comment #0)
> Perhaps the patch can be applied in the ebuild for only 64-bit systems

The patch you pasted here looks like it should be a no-op on 32-bit machines, so unconditional application of the patch should be fine.
Comment 2 Ron 2010-10-17 21:40:44 UTC
(In reply to comment #1)
> The patch you pasted here looks like it should be a no-op on 32-bit machines,
> so unconditional application of the patch should be fine.

It doesn't appear to work on 32-bit machines, at least my 32-bit gentoo vm:
In file included from zmc.cpp:24:
zm.h:37: error: 'uint8_t' does not name a type
zm.h:38: error: 'uint16_t' does not name a type
zm.h:39: error: 'uint32_t' does not name a type
zm.h:40: error: 'uint64_t' does not name a type
make[2]: *** [zmc.o] Error 1
make[2]: Leaving directory `/var/tmp/portage/www-misc/zoneminder-1.24.2/work/ZoneMinder-1.24.2/src'
Comment 3 Kevin Pyle 2010-10-17 23:29:33 UTC
(In reply to comment #2)
> It doesn't appear to work on 32-bit machines, at least my 32-bit gentoo vm:

Weird.  I did not test it (and have never even looked at Zoneminder), but it ought to work.  Could you attach (or put in a pastebin) a post-processed copy of the failed file?  Generate it by invoking the compiler with the same options, but change -c to -E and drop any -o <file>.
Comment 4 Ron 2010-10-18 02:34:41 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > It doesn't appear to work on 32-bit machines, at least my 32-bit gentoo vm:
> Weird.  I did not test it (and have never even looked at Zoneminder), but it
> ought to work.  Could you attach (or put in a pastebin) a post-processed copy
> of the failed file?  Generate it by invoking the compiler with the same
> options, but change -c to -E and drop any -o <file>.

Not sure what you want me to do here. Zone minder uses a ./configure script to compile zoneminder. I believe its just that the datatypes such as "uint8_t" aren't available on 32-bit systems. The only other change I have that is non-standard is "CXXFLAGS=-D__STDC_CONSTANT_MACROS" to address the issue with ffmpeg-0.6 (see http://bugs.gentoo.org/show_bug.cgi?id=320081) The same patch on a x86_64 system compiles without any errors. Its has to be a include header issue, but I don't know where to apply the correct change. 

below is the configure script options:
Compiling source in /var/tmp/portage/www-misc/zoneminder-1.24.2/work/ZoneMinder-1.24.2 ...
./configure --prefix=/usr --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --with-libarch=lib --with-mysql=/usr --with-ffmpeg --with-webdir=/var/www/zoneminder/htdocs --with-cgidir=/var/www/zoneminder/cgi-bin --with-webuser=apache --with-webgroup=apache --enable-debug=no --enable-crashtrace=no

compile stalls right at the beginning:
make  all-recursive
make[1]: Entering directory `/var/tmp/portage/www-misc/zoneminder-1.24.2/work/ZoneMinder-1.24.2'
Making all in src
make[2]: Entering directory `/var/tmp/portage/www-misc/zoneminder-1.24.2/work/ZoneMinder-1.24.2/src'
i686-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I..  -I/usr/include -Iyes/include -Wall -Wno-sign-compare -fno-inline -Iyes/include  -frepo -D__STDC_CONSTANT_MACROS -MT zmc.o -MD -MP -MF .deps/zmc.Tpo -c -o zmc.o zmc.cpp
In file included from zmc.cpp:24:
zm.h:37: error: 'uint8_t' does not name a type
zm.h:38: error: 'uint16_t' does not name a type
zm.h:39: error: 'uint32_t' does not name a type
zm.h:40: error: 'uint64_t' does not name a type
make[2]: *** [zmc.o] Error 1
make[2]: Leaving directory `/var/tmp/portage/www-misc/zoneminder-1.24.2/work/ZoneMinder-1.24.2/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/www-misc/zoneminder-1.24.2/work/ZoneMinder-1.24.2'
make: *** [all] Error 2

FWIW: After messing around with zm for a while on a x86_64 system I ran into a another issue with shm. Under the x86_64 system it does properly set the ipc share permissions to the correct user. if I start zm under the user apache (default), ipcs -m reports the owner as root. I checked and all of the zm processes are running under apache. This breaks zm as when /usr/bin/zmc tries to connect to the shm, it gets access denied because the shm owner is root. On the 32-bit vm ipcs -m shows the owner as appache. I looked in zm_monitor.cpp to see if where it was setting the owner and there is no call other than shmget. I suspect the shmget is suppose to set the shm handle owner to same user as the calling process. I am not sure if this is a bug in x86_64 system or in zoneminder. Another words even if this apache is applied its still broken because of the ipc shm owner glitch. I would show the the error, but I recompiled zm on my x86_64 system using mmap. That seems to work better, but its not perfect. For now I am going with a 32-bit vm to get around this problem. I think it may be best to wait until the developer updates zm to work on 64-bit systems.

Thanks.
Comment 5 Tomáš Chvátal (RETIRED) gentoo-dev 2011-04-28 15:55:03 UTC
Removed from main tree.
Comment 6 Andreas K. Hüttel archtester gentoo-dev 2011-09-16 19:56:50 UTC
Reopened for tracking and hopefully zoneminder revival
Comment 7 Andreas K. Hüttel archtester gentoo-dev 2011-09-17 22:11:02 UTC
Looking at the code this should be fixed in 1.25.0