[cvsnt-dev] Build of cvsnt under HPUX: Crash in server mode

Jan Giesen jan.giesen at web.de
Sun Nov 13 23:45:27 UTC 2005

Dear Tony,

since the number of HPUX versions of cvsnt under
http://www.cvsnt.org/archive is rather limited,
I have started to build the recent cvsnt version under HPUX
11.11 myself.
Since I have no admin rights, I could not build cvsnt for the default
location "/usr/local" but for
a location "/project/stream"

I have managed it to get it build, nevertheless severals issues must be
solved before the build

1. cvstn can only be build for HPUX 11.11, since HPUX 11.00 and elder
version don't have
    the "getaddrinfo" routine, which is used several times in cvsnt.
2. I have used a gcc 3.4.4 version for the compile, which was itself
compiled with the "--enable-shared"
    option. A gcc compiled with the "--disable-shared" option under HPUX
have by default "libgcc.a" and
    "libstdc++.a" libraries, which don't comprise object files with position
independent code (PIC), which
     breaks later the link process of the  cvsnt shared libraries, e.g.
     Note: I have not managed to compile cvsnt with gcc 4.0.1 or gcc 4.0.2;
in addition the gcc binaries
     for HPUX from hpux.connect.org.uk are generated with
3. As external libraries I have used openssl-0.9.7d and
4. I have invoked configure with the options
"--prefix=/project/stream --enable-fork --enable-rcs
5. The compile of mdnsclient/mdnsclient.c stops with an error, since the
struct type "mreq" is not declared.
    This is most likely caused by a problem in the HPUX include file
/usr/include/netinet/in.h, in which
    mreq is normally declared, but not when the parameter
    defined as CPPFLAG. Repeating the declaration of mreq in mdnsclient.c
fixes the problem.
6. The compile of the new 2141 file cvsapi/unix/DnsApi.cpp stops with the
errors, that
     "res_query", "dn_expand" and "ntohs" are not declared. The problem with
"ntohs" is caused by the same
     reason like the "mreq" problem. "res_query", "dn_expand" should
normally be declared in "resolv.h",
     but these declarations are missing in HPUX 11.11, despite the fact that
these functions are listed
     in the HPUX "man" pages. Quick+dirty fix: declaration of these
functions in DnsApi.cpp.
     Note: Under HPUX "res_query" etc. are not in "libresolv", but in
"libc", therefore you must remove
     "lresolv" from the link command in the Makefile for cvsapi.
7.  cvsapi/mdns_mini.cpp : gethostname not declared. Fix: add "unistd.h" as
include file.
8.  lockservice/server.cpp: gethostname not declared. Fix: add "unistd.h" as
include file.
9.  rcs/common.cpp: Problem with "va_list". Fix: add "stdarg.h" before
10. The "expat" module has his own configure script. Unfortunately,
"libexpat.a" is not generated with PIC code,
      which breaks the build of the "cvsapi" shared library. Fix: add
"-fPIC -DPIC" to the CFLAGS in the
11. Openssl:  HPUX 11.11 don't have by default the devices "/dev/random" or
"/dev/urandom". Therefore
      the openssl PRNG (pseudo random noise generator) is not seeded. This
breaks the ":sserver:" protocol.
      Fix: Install HPUX KRNG11 package or add a line like
      before "SSL_library_init();". "/project/stream/.rnd" is a random
number, which is generated, when
      Openssl is installed.

By fixing all this issues it is possible to build cvsnt under HPUX11.11.
Note: There are similiar issues with cvst version (more
issues), (less issues),

The generated cvsnt executables and shared libaries works fine as client.
Tested protocols: pserver, local, fork, sserver.

Nevertheless this cvnst executable crashes with a "memory fault" (SIGSEV)
when used as server. E.g.
the command:  "cvsnt -d :local:/project/stream/db/storm version" crashes. I
can reproduce this crash
also with cvsnt,, Even with cvsnt a crash happens
in server mode.
>From a trace with "cvsnt -ttt" I assume, that the crash is related to the
unloading of the "trigger" shared libraries.

The crash also happens with your cvsnt version for HPUX under
www.cvsnt.org/archives !

The crash does not happen, when I use the same sources to build a RedHat
LINUX version.

Do you have an idea, what could be the reason for this crash?  Libtool? HPUX

Best regards
                           Jan Giesen

More information about the cvsnt-dev mailing list