Menu

Problems Compiling on CentOS

2010-05-26
2013-05-23
  • Dave Forgac

    Dave Forgac - 2010-05-26

    I'm getting these warnings when compiling on a CentOS 5.5 system with the latest Apache (2.2.3-43.el5.centos) installed:

    [root@rs apache2]# apxs -cia mod_qos.c
    /usr/lib64/apr-1/build/libtool --silent --mode=compile gcc -prefer-pic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing  -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/httpd  -I/usr/include/apr-1   -I/usr/include/apr-1   -c -o mod_qos.lo mod_qos.c && touch mod_qos.slo
    mod_qos.c: In function 'qos_destroy_act':
    mod_qos.c:1165: warning: format '%d' expects type 'int', but argument 7 has type 'apr_size_t'
    mod_qos.c: In function 'qos_init_shm':
    mod_qos.c:1287: warning: format '%d' expects type 'int', but argument 10 has type 'apr_size_t'
    mod_qos.c:1293: warning: format '%d' expects type 'int', but argument 9 has type 'apr_size_t'
    mod_qos.c: In function 'qos_header_parser':
    mod_qos.c:4324: warning: 'uid' may be used uninitialized in this function
    mod_qos.c:4323: warning: 'msg' may be used uninitialized in this function
    mod_qos.c: In function 'qos_process_connection':
    mod_qos.c:4036: warning: 'current' may be used uninitialized in this function
    /usr/lib64/apr-1/build/libtool --silent --mode=link gcc -o mod_qos.la  -rpath /usr/lib64/httpd/modules -module -avoid-version    mod_qos.lo
    /usr/lib64/httpd/build/instdso.sh SH_LIBTOOL='/usr/lib64/apr-1/build/libtool' mod_qos.la /usr/lib64/httpd/modules
    /usr/lib64/apr-1/build/libtool --mode=install cp mod_qos.la /usr/lib64/httpd/modules/
    cp .libs/mod_qos.so /usr/lib64/httpd/modules/mod_qos.so
    cp .libs/mod_qos.lai /usr/lib64/httpd/modules/mod_qos.la
    cp .libs/mod_qos.a /usr/lib64/httpd/modules/mod_qos.a
    chmod 644 /usr/lib64/httpd/modules/mod_qos.a
    ranlib /usr/lib64/httpd/modules/mod_qos.a
    PATH="$PATH:/sbin" ldconfig -n /usr/lib64/httpd/modules
    ----------------------------------------------------------------------
    Libraries have been installed in:
       /usr/lib64/httpd/modules
    If you ever happen to want to link against installed libraries
    in a given directory, LIBDIR, you must either use libtool, and
    specify the full pathname of the library, or use the `-LLIBDIR'
    flag during linking and do at least one of the following:
       - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
         during execution
       - add LIBDIR to the `LD_RUN_PATH' environment variable
         during linking
       - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
       - have your system administrator add LIBDIR to `/etc/ld.so.conf'
    See any operating system documentation about shared libraries for
    more information, such as the ld(1) and ld.so(8) manual pages.
    ----------------------------------------------------------------------
    chmod 755 /usr/lib64/httpd/modules/mod_qos.so
    [activating module `qos' in /etc/httpd/conf/httpd.conf]
    

    Apache also sigfaults immediately now:

    [root@rs apache2]# /etc/init.d/httpd start
    Starting httpd: /bin/bash: line 1: 23902 Segmentation fault      /usr/sbin/httpd
                                                               [FAILED]
    

    Any suggestions?

     
  • Pascal Buchbinder

    I'm going to check the warning messages (probably a 64bit thing I haven't noticed yet).

    About the environment settings: You should not have to set any library path. The simple LoadModule directive (which has been added by the -a option of apxs) must be enough to load the module.

    A stacktrace of the core file written at startup would be helpful (at least if there are any symbol names). And: I could try to reproduce the error if you provide me the mod_qos configuration (directives) you have used.

     
  • Pascal Buchbinder

    I've checked the warning messages - they can't be the reason for the seg fault.

     
  • Dave Forgac

    Dave Forgac - 2010-05-27

    This is the first time I'm trying to use mod_qos on a 64-bit CentOS system. Other than base Apache the only things I've installed so far are http-devel, pcre-devel, openssl-devel, and libtool. I didn't manually change the library path so apxs must be doing that in my environment. The -a option of apxs does add the LoadModule w/ the full path anyway.

    Here is a backtrace from the latest core dump:

    Reading symbols from /lib64/libnss_files.so.2...(no debugging symbols found)...done.
    Loaded symbols for /lib64/libnss_files.so.2
    Core was generated by `/usr/sbin/httpd'.
    Program terminated with signal 11, Segmentation fault.
    #0  0x00007f87ec222f59 in qos_tmpnam (pool=0x7f87f7fbb868, s=0x0) at mod_qos.c:766
    766   qos_srv_config *sconf = (qos_srv_config*)ap_get_module_config(s->module_config, &qos_module);
    (gdb) bt
    #0  0x00007f87ec222f59 in qos_tmpnam (pool=0x7f87f7fbb868, s=0x0) at mod_qos.c:766
    #1  0x00007f87ec22ec4e in qos_post_config (pconf=0x7f87f7f486c8, plog=<value optimized out>, 
        ptemp=<value optimized out>, bs=0x7f87f7f7c868) at mod_qos.c:5348
    #2  0x00007f87f6ad087c in ap_run_post_config ()
    #3  0x00007f87f6abdcd3 in main ()
    

    Here is my current mod_qos configuration:

    <IfModule mod_qos.c>
        QS_SrvMaxConnPerIP  30      
        MaxClients          150    
        QS_SrvMaxConnClose  180
        QS_SrvMinDataRate   150 1200
    </IfModule>
    

    Let me know if there's any additional information that I can get you. This is on a testing box right now so I'm not afraid to poke around.

     
  • Pascal Buchbinder

    I've fixed this bug with release 9.19. The error happens if no virtual host has been defined.

    Many thanks for your help and sorry for the inconvenience.

     
  • newbie

    newbie - 2010-08-23

    Dear Sir:

    I got error with CentOS 5.5 & mod_qos 9.24 on an OpenVZ VPS,
    because it's my first apxs a apache mod_.c, I don't know if I did some thing wrong?

    # apxs -cia mod_qos.c

    /usr/lib/apr-1/build/libtool -silent -mode=compile gcc -prefer-pic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector -param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -fno-strict-aliasing  -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -pthread -I/usr/include/httpd  -I/usr/include/apr-1   -I/usr/include/apr-1   -c -o mod_qos.lo mod_qos.c && touch mod_qos.slo
    mod_qos.c:75:18: error: pcre.h: No such file or directory
    mod_qos.c:85:26: error: openssl/rand.h: No such file or directory
    mod_qos.c:86:25: error: openssl/evp.h: No such file or directory
    mod_qos.c:274: error: expected specifier-qualifier-list before 'pcre'
    mod_qos.c:288: error: expected specifier-qualifier-list before 'pcre'
    mod_qos.c:478: error: 'EVP_MAX_KEY_LENGTH' undeclared here (not in a function)
    mod_qos.c:606: error: expected specifier-qualifier-list before 'pcre'
    mod_qos.c: In function 'qos_load_headerfilter':
    mod_qos.c:743: error: 'qos_fhlt_r_t' has no member named 'pcre'
    mod_qos.c:743: warning: implicit declaration of function 'pcre_compile'
    mod_qos.c:743: error: 'PCRE_DOTALL' undeclared (first use in this function)
    mod_qos.c:743: error: (Each undeclared identifier is reported only once
    mod_qos.c:743: error: for each function it appears in.)
    mod_qos.c:744: error: 'qos_fhlt_r_t' has no member named 'action'
    mod_qos.c:745: error: 'qos_fhlt_r_t' has no member named 'size'
    mod_qos.c:746: error: 'qos_fhlt_r_t' has no member named 'pcre'
    mod_qos.c:753: error: 'qos_fhlt_r_t' has no member named 'pcre'
    mod_qos.c:753: error: 'pcre_free' undeclared (first use in this function)
    mod_qos.c: In function 'qos_encrypt':
    mod_qos.c:1009: error: 'EVP_CIPHER_CTX' undeclared (first use in this function)
    mod_qos.c:1009: error: expected ';' before 'cipher_ctx'
    mod_qos.c:1012: warning: implicit declaration of function 'EVP_CIPHER_block_size'
    mod_qos.c:1012: warning: implicit declaration of function 'EVP_des_ede3_cbc'
    mod_qos.c:1015: warning: implicit declaration of function 'EVP_CIPHER_CTX_init'
    mod_qos.c:1015: error: 'cipher_ctx' undeclared (first use in this function)
    mod_qos.c:1016: warning: implicit declaration of function 'EVP_EncryptInit'
    mod_qos.c:1017: warning: implicit declaration of function 'EVP_EncryptUpdate'
    mod_qos.c:1021: warning: implicit declaration of function 'EVP_EncryptFinal'
    mod_qos.c:1025: warning: implicit declaration of function 'EVP_CIPHER_CTX_cleanup'
    mod_qos.c: In function 'qos_decrypt':
    mod_qos.c:1041: error: 'EVP_CIPHER_CTX' undeclared (first use in this function)
    mod_qos.c:1041: error: expected ';' before 'cipher_ctx'
    mod_qos.c:1053: error: 'cipher_ctx' undeclared (first use in this function)
    mod_qos.c:1054: warning: implicit declaration of function 'EVP_DecryptInit'
    mod_qos.c:1055: warning: implicit declaration of function 'EVP_DecryptUpdate'
    mod_qos.c:1060: warning: implicit declaration of function 'EVP_DecryptFinal'
    mod_qos.c: In function 'qos_send_user_tracking_cookie':
    mod_qos.c:1079: warning: implicit declaration of function 'RAND_bytes'
    mod_qos.c: In function 'qos_per_dir_event_rules':
    mod_qos.c:1912: error: 'qos_rfilter_t' has no member named 'type'
    mod_qos.c:1914: error: 'qos_rfilter_t' has no member named 'text'
    mod_qos.c:1915: error: 'qos_rfilter_t' has no member named 'text'
    mod_qos.c:1919: error: 'qos_rfilter_t' has no member named 'text'
    mod_qos.c:1925: error: 'qos_rfilter_t' has no member named 'action'
    mod_qos.c:1929: error: 'qos_rfilter_t' has no member named 'type'
    mod_qos.c:1930: error: 'qos_rfilter_t' has no member named 'id'
    mod_qos.c:1931: error: 'qos_rfilter_t' has no member named 'text'
    mod_qos.c:1931: error: 'qos_rfilter_t' has no member named 'action'
    mod_qos.c:1934: error: 'qos_rfilter_t' has no member named 'action'
    mod_qos.c: In function 'qos_per_dir_rules':
    mod_qos.c:2075: error: 'qos_rfilter_t' has no member named 'type'
    mod_qos.c:2077: warning: implicit declaration of function 'pcre_exec'
    mod_qos.c:2077: error: 'qos_rfilter_t' has no member named 'pr'
    mod_qos.c:2078: error: 'qos_rfilter_t' has no member named 'type'
    mod_qos.c:2080: error: 'qos_rfilter_t' has no member named 'pr'
    mod_qos.c:2081: error: 'qos_rfilter_t' has no member named 'type'
    mod_qos.c:2083: error: 'qos_rfilter_t' has no member named 'pr'
    mod_qos.c:2084: error: 'qos_rfilter_t' has no member named 'type'
    mod_qos.c:2088: error: 'qos_rfilter_t' has no member named 'pr'
    mod_qos.c:2089: error: 'qos_rfilter_t' has no member named 'action'
    mod_qos.c:2095: error: 'qos_rfilter_t' has no member named 'action'
    mod_qos.c:2099: error: 'qos_rfilter_t' has no member named 'type'
    mod_qos.c:2100: error: 'qos_rfilter_t' has no member named 'id'
    mod_qos.c:2101: error: 'qos_rfilter_t' has no member named 'text'
    mod_qos.c:2101: error: 'qos_rfilter_t' has no member named 'action'
    mod_qos.c:2104: error: 'qos_rfilter_t' has no member named 'action'
    mod_qos.c: In function 'qos_header_filter':
    mod_qos.c:2140: error: 'qos_fhlt_r_t' has no member named 'pcre'
    mod_qos.c:2144: error: 'qos_fhlt_r_t' has no member named 'size'
    mod_qos.c:2149: error: 'qos_fhlt_r_t' has no member named 'size'
    mod_qos.c:2150: error: 'qos_fhlt_r_t' has no member named 'action'
    mod_qos.c: In function 'qos_setenvresheader':
    mod_qos.c:2372: error: 'pcre' undeclared (first use in this function)
    mod_qos.c:2372: error: 'pr' undeclared (first use in this function)
    mod_qos.c:2372: error: expected expression before ')' token
    mod_qos.c: In function 'qos_parp_hp_body':
    mod_qos.c:2471: error: 'qos_setenvifparpbody_t' has no member named 'preg'
    mod_qos.c:2473: error: 'qos_setenvifparpbody_t' has no member named 'name'
    mod_qos.c:2474: error: 'qos_setenvifparpbody_t' has no member named 'value'
    mod_qos.c:2486: error: 'qos_setenvifparpbody_t' has no member named 'pregx'
    mod_qos.c: In function 'qos_post_config':
    mod_qos.c:5661: error: 'qos_fhlt_r_t' has no member named 'action'
    mod_qos.c:5662: error: 'qos_fhlt_r_t' has no member named 'size'
    mod_qos.c:5669: error: 'qos_fhlt_r_t' has no member named 'action'
    mod_qos.c:5670: error: 'qos_fhlt_r_t' has no member named 'size'
    mod_qos.c: In function 'qos_srv_config_create':
    mod_qos.c:6113: warning: implicit declaration of function 'EVP_BytesToKey'
    mod_qos.c:6113: warning: implicit declaration of function 'EVP_sha1'
    mod_qos.c: In function 'qos_event_setenvresheadermatch_cmd':
    mod_qos.c:6644: error: 'pcre' undeclared (first use in this function)
    mod_qos.c:6644: error: 'pr' undeclared (first use in this function)
    mod_qos.c:6644: error: 'PCRE_DOTALL' undeclared (first use in this function)
    mod_qos.c:6644: error: 'PCRE_CASELESS' undeclared (first use in this function)
    mod_qos.c:6651: error: 'pcre_free' undeclared (first use in this function)
    mod_qos.c: In function 'qos_event_setenvifparpbody_cmd':
    mod_qos.c:6715: error: 'qos_setenvifparpbody_t' has no member named 'pregx'
    mod_qos.c:6719: error: 'qos_setenvifparpbody_t' has no member named 'preg'
    mod_qos.c:6719: error: 'PCRE_DOTALL' undeclared (first use in this function)
    mod_qos.c:6719: error: 'PCRE_CASELESS' undeclared (first use in this function)
    mod_qos.c:6720: error: 'qos_setenvifparpbody_t' has no member named 'preg'
    mod_qos.c:6726: error: 'qos_setenvifparpbody_t' has no member named 'preg'
    mod_qos.c:6726: error: 'pcre_free' undeclared (first use in this function)
    mod_qos.c:6727: error: 'qos_setenvifparpbody_t' has no member named 'pregx'
    mod_qos.c:6731: error: 'qos_setenvifparpbody_t' has no member named 'name'
    mod_qos.c:6732: error: 'qos_setenvifparpbody_t' has no member named 'name'
    mod_qos.c:6732: error: 'qos_setenvifparpbody_t' has no member named 'name'
    mod_qos.c:6732: error: 'qos_setenvifparpbody_t' has no member named 'name'
    mod_qos.c:6734: error: 'qos_setenvifparpbody_t' has no member named 'value'
    mod_qos.c:6738: error: 'qos_setenvifparpbody_t' has no member named 'value'
    mod_qos.c: In function 'qos_deny_cmd':
    mod_qos.c:7136: error: 'qos_rfilter_t' has no member named 'type'
    mod_qos.c:7141: error: 'qos_rfilter_t' has no member named 'id'
    mod_qos.c:7143: error: 'qos_rfilter_t' has no member named 'action'
    mod_qos.c:7145: error: 'qos_rfilter_t' has no member named 'action'
    mod_qos.c:7150: error: 'qos_rfilter_t' has no member named 'type'
    mod_qos.c:7151: error: 'qos_rfilter_t' has no member named 'pr'
    mod_qos.c:7151: error: 'PCRE_DOTALL' undeclared (first use in this function)
    mod_qos.c:7152: error: 'qos_rfilter_t' has no member named 'pr'
    mod_qos.c:7158: error: 'qos_rfilter_t' has no member named 'pr'
    mod_qos.c:7158: error: 'pcre_free' undeclared (first use in this function)
    mod_qos.c:7160: error: 'qos_rfilter_t' has no member named 'text'
    mod_qos.c: In function 'qos_deny_rql_cmd':
    mod_qos.c:7166: error: 'PCRE_CASELESS' undeclared (first use in this function)
    mod_qos.c: In function 'qos_deny_path_cmd':
    mod_qos.c:7170: error: 'PCRE_CASELESS' undeclared (first use in this function)
    mod_qos.c: In function 'qos_deny_query_cmd':
    mod_qos.c:7174: error: 'PCRE_CASELESS' undeclared (first use in this function)
    mod_qos.c: In function 'qos_headerfilter_rule_cmd':
    mod_qos.c:7383: error: 'qos_fhlt_r_t' has no member named 'size'
    mod_qos.c:7388: error: 'qos_fhlt_r_t' has no member named 'pcre'
    mod_qos.c:7388: error: 'PCRE_DOTALL' undeclared (first use in this function)
    mod_qos.c:7390: error: 'qos_fhlt_r_t' has no member named 'action'
    mod_qos.c:7392: error: 'qos_fhlt_r_t' has no member named 'action'
    mod_qos.c:7397: error: 'qos_fhlt_r_t' has no member named 'pcre'
    mod_qos.c:7404: error: 'qos_fhlt_r_t' has no member named 'size'
    mod_qos.c:7409: error: 'qos_fhlt_r_t' has no member named 'pcre'
    mod_qos.c:7409: error: 'pcre_free' undeclared (first use in this function)
    mod_qos.c: In function 'qos_resheaderfilter_rule_cmd':
    mod_qos.c:7426: error: 'qos_fhlt_r_t' has no member named 'size'
    mod_qos.c:7428: error: 'qos_fhlt_r_t' has no member named 'pcre'
    mod_qos.c:7428: error: 'PCRE_DOTALL' undeclared (first use in this function)
    mod_qos.c:7429: error: 'qos_fhlt_r_t' has no member named 'action'
    mod_qos.c:7430: error: 'qos_fhlt_r_t' has no member named 'pcre'
    mod_qos.c:7437: error: 'qos_fhlt_r_t' has no member named 'size'
    mod_qos.c:7442: error: 'qos_fhlt_r_t' has no member named 'pcre'
    mod_qos.c:7442: error: 'pcre_free' undeclared (first use in this function)
    apxs:Error: Command failed with rc=65536

    Thank you for your help.

     
  • newbie

    newbie - 2010-08-23

    sorry sir,

    Please ignore my above message.

    I saw the tyler's message and yum install pcre-devel openssl-devel libtool,
    then It's compiled success :)

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.