ZoneMinder under 64-bit
Posted: Thu Jun 26, 2008 6:52 pm
Hi folks,
I believe I have discovered a 64-bit porting problem. But first, a bit of background:
I've been jumping through hoops trying to get ZM 1.23.3 working across browsers and platforms, accessible from behind a proxy (i.e., no Cambozola) with remote Axis cameras on 1xRTT/EVDO connections (major headache, lots of DIVIDE-BY-ZERO segfaults almost everywhere an FPS is dynamically calculated). After most layout and streaming problems were solved under Firefox and IE (the basic solution was to use Flash/swf), I was still left with a major gripe: the DVR streaming would simply not work.
Long story short, my ZM is running on SliceHost, and SliceHost apparently only provides 64-bit OS's. After much debugging, I noticed that the DVR controls would (mostly) work on my 32-bit development machine, but not on the production site. The following change improved things greatly:
This is because on 64-bit systems, a "long" is 64 bits wide, while on a 32-bit one it is only 32 bits wide, and the recvfrom() that reads the socket message is reading sizeof() bytes, which varies from architecture to architecture. Hence, the mess. On the other hand, "int" works fine because it is 32 bits long on both architectures.
It's not all fine and dandy yet, will post more as my issues are resolved.
Adolfo R. Brandes
I believe I have discovered a 64-bit porting problem. But first, a bit of background:
I've been jumping through hoops trying to get ZM 1.23.3 working across browsers and platforms, accessible from behind a proxy (i.e., no Cambozola) with remote Axis cameras on 1xRTT/EVDO connections (major headache, lots of DIVIDE-BY-ZERO segfaults almost everywhere an FPS is dynamically calculated). After most layout and streaming problems were solved under Firefox and IE (the basic solution was to use Flash/swf), I was still left with a major gripe: the DVR streaming would simply not work.
Long story short, my ZM is running on SliceHost, and SliceHost apparently only provides 64-bit OS's. After much debugging, I noticed that the DVR controls would (mostly) work on my 32-bit development machine, but not on the production site. The following change improved things greatly:
Code: Select all
Index: zm_stream.h
===================================================================
--- zm_stream.h (revision 249)
+++ zm_stream.h (working copy)
@@ -47,12 +47,12 @@
protected:
typedef struct {
- long msg_type;
+ int msg_type;
char msg_data[16];
} CmdMsg;
typedef struct {
- long msg_type;
+ int msg_type;
char msg_data[256];
} DataMsg;
It's not all fine and dandy yet, will post more as my issues are resolved.
Adolfo R. Brandes