[cvsnt-dev] Build of cvsnt 2.05.03.2141 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 2.05.03.2141 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
works:

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.
cvsapi.sl.
     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
"--disable-shared".
3. As external libraries I have used openssl-0.9.7d and
libiconv-1.9.2-ss-11.11.
4. I have invoked configure with the options
"--prefix=/project/stream --enable-fork --enable-rcs
    --with-ssl=/project/stream/lib"
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
"_XOPEN_SOURCE_EXTENDED" is
    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
"string".
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
      expat/Makefile.
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
"RAND_load_file("/project/stream/.rnd",1024);"
      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 2.05.02.2099 (more
issues), 2.05.02.2115 (less issues), 2.05.03.2134

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 2.05.02.2099, 2.05.02.2115, 2.05.03.2134. Even with cvsnt
2.05.01.1976 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 2.05.02.2099 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
linker?

Best regards
                           Jan Giesen




More information about the cvsnt-dev mailing list