pkgsrc-Users archive

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

pkgsrc-current/www/apache22 segfaults on solaris 10 x86



hi all. pkgsrc newbie here. first the why's then the issues ...

i'm a relatively long-time sysadmin (15 years) having experience with
most prevalent *nix systems. during that time, i've provided services
- and rarely had folks logging into the systems. so there hasn't been
much need for debugging compiled code and such, and as a result i have
little experience doing so, and even less with C itself. shell and
python are my main tools.

the customer wants an AMP stack for concrete5, and wants it on their
solaris 10 x86 box. i had problems getting the bundled apache/apache2
running with mysql and php5 without recompiling everything, so i went
looking for alternatives. pkgsrc looked promising for this reason:
since it supported so many operating systems that i deal with, it
might be possible to run N commands via pkgsrc and get the job done on
whatever system (solaris or other) i end up on. basically the
portability sold me on pkgsrc.

i've been using freebsd/openbsd all over the place for years, but not
netbsd - and i am unfamiliar with pkgsrc. so i dug around and found
this ultra-simple recipe for getting the AMP stack running:
http://wiki.netbsd.se/How_to_install_a_LAMP_Server

i start with a "vanilla" solaris 10 zone created specifically for this
task. step one is www/apache22, which appears to build and install ok.
however, the resultant httpd segfaults every time. it gets far enough
to create a logfile, but never populates it. pstack produces a
traceback from the core, but it's unreadable to me. truss is more
readable, but still isn't enough to give *me* a clue. i'll include
output from both at the bottom, in case someone else can make heads or
tails of the output.

i then double-checked the docs and found this:

3.3. Platform-specific notes
3.3.7. Solaris
3.3.7.1. If you are using gcc
It makes life much simpler if you only use the same gcc consistently
for building all packages.
It is recommended that an external gcc be used only for bootstrapping,
then either build gcc from lang/gcc or install a binary gcc package,
then remove gcc used during bootstrapping.

... so i roll back to the "vanilla" zone prior to pkgsrc, and
bootstrap pkgsrc again. i then attempt to build gcc per the docs, so
it could be used to build the rest instead of using the gcc already on
the system:

# cd /opt/pkgsrc/lang/gcc
# bmake install clean clean-depends
<snip>
gcc -c  -DIN_GCC   -O     -I. -I..
-I/opt/pkgsrc/lang/gcc/work/gcc-2.95.3/gcc/ch
-I/opt/pkgsrc/lang/gcc/work/gcc-2.95.3/gcc/ch/..
-I/opt/pkgsrc/lang/gcc/work/gcc-2.95.3/gcc/ch/../config
-I/opt/pkgsrc/lang/gcc/work/gcc-2.95.3/gcc/ch/../../include
/opt/pkgsrc/lang/gcc/work/gcc-2.95.3/gcc/ch/decl.c
/opt/pkgsrc/lang/gcc/work/gcc-2.95.3/gcc/ch/decl.c: In function `start_struct':
/opt/pkgsrc/lang/gcc/work/gcc-2.95.3/gcc/ch/decl.c:4451: error:
argument "code" doesn't match prototype
/opt/pkgsrc/lang/gcc/work/gcc-2.95.3/gcc/ch/ch-tree.h:736: error:
prototype declaration
gmake[2]: *** [decl.o] Error 1
gmake[2]: Leaving directory `/opt/pkgsrc/lang/gcc/work/objdir/gcc/ch'
gmake[1]: *** [cc1chill] Error 2
gmake[1]: Leaving directory `/opt/pkgsrc/lang/gcc/work/objdir/gcc'
gmake: *** [all-gcc] Error 2
*** Error code 2

i did notice that despite calling bmake i'm seeing gmake errors, but
don't know if that's pertinent. anyway, at this point i can't test
building apache22 from pkgsrc-based gcc because i can't even build
gcc. so i go back to the docs again and find the following blurbs:
Solaris 2.6 through 9 are supported on both x86 and sparc. Please note
that the use of GNU binutils on Solaris is not supported, as of June
2006.

solaris 10 is not mentioned at all; is it supported? and can anyone
tell me if i'm using gnu binutils in this scenario?


so here i am, and here is what i am wondering:
am i just totally screwing this, am i just running into a few simple
bugs, or is pkgsrc just useless for me on solaris 10 x86?

if you've actually made it this far, thanks very much for reading.
it'd be great if you could answer a few of the questions ... limited
debug info follows:

pkgsrc-current (latest tarfile snapshot - though latest via cvs yields
same results)

# uname -a
SunOS webtest2 5.10 Generic_142901-11 i86pc i386 i86pc

# isainfo -k
amd64

# pkg_info |grep apache
apache-2.2.15nb2    Apache HTTP (Web) server, version 2.2

# which httpd
/opt/pkg/sbin/httpd

# httpd -V
Server version: Apache/2.2.15 (Unix)
Server built:   Jun 19 2010 22:33:09
Server's Module Magic Number: 20051115:24
Server loaded:  APR 1.3.9, APR-Util 1.3.9
Compiled using: APR 1.3.9, APR-Util 1.3.9
Architecture:   32-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_FCNTL_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/opt/pkg"
 -D SUEXEC_BIN="/opt/pkg/bin/suexec"
 -D DEFAULT_PIDLOG="var/run/httpd.pid"
 -D DEFAULT_SCOREBOARD="var/run/apache_runtime_status"
 -D DEFAULT_LOCKFILE="var/run/accept.lock"
 -D DEFAULT_ERRORLOG="var/log/httpd/error.log"
 -D AP_TYPES_CONFIG_FILE="etc/httpd/mime.types"
 -D SERVER_CONFIG_FILE="etc/httpd/httpd.conf"

# ldd /opt/pkg/sbin/httpd
        libm.so.2 =>     /lib/libm.so.2
        libaprutil-1.so.0 =>     /opt/pkg/lib/libaprutil-1.so.0
        libexpat.so.1 =>         /opt/pkg/lib/libexpat.so.1
        libiconv.so.2 =>         /opt/pkg/lib/libiconv.so.2
        libapr-1.so.0 =>         /opt/pkg/lib/libapr-1.so.0
        libnsl.so.1 =>   /lib/libnsl.so.1
        libuuid.so.1 =>  /lib/libuuid.so.1
        libsendfile.so.1 =>      /lib/libsendfile.so.1
        librt.so.1 =>    /lib/librt.so.1
        libsocket.so.1 =>        /lib/libsocket.so.1
        libpthread.so.1 =>       /lib/libpthread.so.1
        libc.so.1 =>     /lib/libc.so.1
        libgcc_s.so.1 =>         /usr/sfw/lib/libgcc_s.so.1
        libmp.so.2 =>    /lib/libmp.so.2
        libmd.so.1 =>    /lib/libmd.so.1
        libscf.so.1 =>   /lib/libscf.so.1
        libaio.so.1 =>   /lib/libaio.so.1
        libdoor.so.1 =>  /lib/libdoor.so.1
        libuutil.so.1 =>         /lib/libuutil.so.1
        libgen.so.1 =>   /lib/libgen.so.1

# httpd
Segmentation Fault (core dumped)

# pstack core
core 'core' of 1938:    httpd
 fe2ffd55 _init    (fe6d0cf0, feffb28c, feffb818, fe67056c, feff0ad0,
fe2ffd40) + 15
 fefd4c11 call_init (fe670568, 1) + f5
 fefd5132 load_completion (fe6d0cf0) + de
 fefd92a3 dlmopen_intn (feffb28c, 8116b60, d02, fefc04b8, 0, 0) + 103
 fefd938a dlmopen_check (feffb28c, 8116b60, d02, fefc04b8, 8047544) + c6
 fefd945c dlopen   (8116b60, 102, 8047578, fedbc6ee, feb857ee, 8047a80) + 48
 fedbdfc7 apr_dso_load (80476cc, 8116b60, 80c96b0, 80679b4) + 22
 0809425d load_module (8047a40, 80478b8, 8116b38, 8116b48) + 227
 08081dc2 invoke_cmd (80a8b40, 8047a40, 80478b8, 81017c2) + 2cd
 080831ed execute_now (8116ad8, 81017a3, 8047a40, 80c96b0, 80f9770,
80478b8) + 8f
 080827d7 ap_build_config_sub (80c96b0, 80f9770, 8101798, 8047a40,
8047914, 8047910) + 175
 08082d0f ap_build_config (8047a40, 80c96b0, 80f9770, 80bdd94) + 81
 0808366f process_resource_config_nofnmatch (80cf0d0, 80fd260,
80bdd94, 80c96b0, 80f9770, 0) + 2d2
 08083768 ap_process_resource_config (80cf0d0, 80fd260, 80bdd94,
80c96b0, 80f9770, 80a080d) + 9d
 0808427f ap_read_config (80c7738, 80f9770, 80a080d, 80bdd94) + ec
 0806b321 main     (1, 8047cc4, 8047ccc) + 595
 0806a414 _start   (1, 8047d88, 0, 8047d8e, 8047da2, 8047dad) + 80

# find /opt/pkg/var/log/httpd/
/opt/pkg/var/log/httpd/

# truss -f httpd
1952:   execve("/opt/pkg/sbin/httpd", 0x08047CC8, 0x08047CD0)  argc = 1
1952:   mmap(0x00000000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFEFF0000
1952:   resolvepath("/usr/lib/ld.so.1", "/lib/ld.so.1", 1023) = 12
1952:   resolvepath("/opt/pkg/sbin/httpd", "/opt/pkg/sbin/httpd", 1023) = 19
1952:   sysconfig(_CONFIG_PAGESIZE)                     = 4096
1952:   stat64("/opt/pkg/sbin/httpd", 0x08047A60)       = 0
1952:   open("/var/ld/ld.config", O_RDONLY)             Err#2 ENOENT
1952:   stat64("/opt/pkg/lib/libm.so.2", 0x08047300)    Err#2 ENOENT
1952:   stat64("/usr/sfw/lib/libm.so.2", 0x08047300)    Err#2 ENOENT
1952:   stat64("/lib/libm.so.2", 0x08047300)            = 0
1952:   resolvepath("/lib/libm.so.2", "/lib/libm.so.2", 1023) = 14
1952:   open("/lib/libm.so.2", O_RDONLY)                = 3
<snip>
1952:   stat64("/lib/libmp.so.2", 0x08046B30)           = 0
1952:   resolvepath("/lib/libmp.so.2", "/lib/libmp.so.2", 1023) = 15
1952:   open("/lib/libmp.so.2", O_RDONLY)               = 4
1952:   mmap(0xFEF00000, 32768, PROT_READ|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED, 4, 0) = 0xFEF00000
1952:   mmap(0x00010000, 81920, PROT_NONE,
MAP_PRIVATE|MAP_NORESERVE|MAP_ANON|MAP_ALIGN, -1, 0) = 0xFE140000
1952:   mmap(0xFE140000, 9124, PROT_READ|PROT_EXEC,
MAP_PRIVATE|MAP_FIXED|MAP_TEXT, 4, 0) = 0xFE140000
1952:   mmap(0xFE153000, 497, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_INITDATA, 4, 12288) = 0xFE153000
1952:   munmap(0xFE143000, 65536)                       = 0
1952:   memcntl(0xFE140000, 1744, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
1952:   close(4)                                        = 0
1952:   munmap(0xFEF00000, 32768)                       = 0
1952:       Incurred fault #6, FLTBOUNDS  %pc = 0xFE2FFD55
1952:         siginfo: SIGSEGV SEGV_MAPERR addr=0x00000000
1952:       Received signal #11, SIGSEGV [default]
1952:         siginfo: SIGSEGV SEGV_MAPERR addr=0x00000000


Home | Main Index | Thread Index | Old Index