Fixed
Created: Jan 19, 2018
Updated: Dec 3, 2018
Resolved Date: Jan 28, 2018
Found In Version: unknown
Fix Version: 9.0.0.14
Severity: Standard
Applicable for: Wind River Linux 9
Component/s: Userspace
When running apache in the foreground with a limited configuration and using this command line:
/usr/sbin/httpd -f $PWD/httpd.conf -D FOREGROUND
it crashes with this backtrace when given SIGINT via ^C:
^C*** Error in `/usr/sbin/httpd': free(): invalid pointer: 0x0fece65c ***
======= Backtrace: =========
/lib/libc.so.6(+0x76288)[0xfdc4288]
/lib/libc.so.6(+0x83e20)[0xfdd1e20]
/lib/libc.so.6(+0x84bb0)[0xfdd2bb0]
/usr/lib/libapr-1.so.0(apr_pool_destroy+0x1e8)[0xff42498]
/usr/lib/apache2/modules/mod_mpm_prefork.so(+0x2858)[0xfa2d858]
/usr/lib/apache2/modules/mod_mpm_prefork.so(+0x289c)[0xfa2d89c]
linux-vdso32.so.1(__kernel_sigtramp32+0x0)[0x100394]
/lib/libnsl.so.1(+0x12530)[0xfb34530]
/lib/ld.so.1(+0x103f0)[0x77ba63f0]
/lib/libc.so.6(+0x3e3ec)[0xfd8c3ec]
/lib/libc.so.6(on_exit+0x0)[0xfd8c428]
/usr/lib/apache2/modules/mod_mpm_prefork.so(+0x2874)[0xfa2d874]
/usr/lib/apache2/modules/mod_mpm_prefork.so(+0x2c4c)[0xfa2dc4c]
/usr/lib/apache2/modules/mod_mpm_prefork.so(+0x2fe0)[0xfa2dfe0]
/usr/lib/apache2/modules/mod_mpm_prefork.so(+0x3074)[0xfa2e074]
/usr/lib/apache2/modules/mod_mpm_prefork.so(+0x3fc8)[0xfa2efc8]
/usr/sbin/httpd(ap_run_mpm+0x8c)[0x1001a1c0]
/usr/sbin/httpd(main+0x998)[0x10012780]
/lib/libc.so.6(+0x216ac)[0xfd6f6ac]
/lib/libc.so.6(__libc_start_main+0xc8)[0xfd6f864]
======= Memory map: ========
00100000-00103000 r-xp 00000000 00:00 0 [vdso]
0fa2b000-0fa31000 r-xp 00000000 08:01 6681 /usr/lib/apache2/modules/mod_mpm_prefork.so
0fa31000-0fa40000 ---p 00006000 08:01 6681 /usr/lib/apache2/modules/mod_mpm_prefork.so
0fa40000-0fa42000 rw-p 00005000 08:01 6681 /usr/lib/apache2/modules/mod_mpm_prefork.so
0fa52000-0fa55000 r-xp 00000000 08:01 6703 /usr/lib/apache2/modules/mod_alias.so
0fa55000-0fa64000 ---p 00003000 08:01 6703 /usr/lib/apache2/modules/mod_alias.so
0fa64000-0fa65000 rw-p 00002000 08:01 6703 /usr/lib/apache2/modules/mod_alias.so
0fa75000-0fa77000 r-xp 00000000 08:01 6710 /usr/lib/apache2/modules/mod_access_compat.so
0fa77000-0fa86000 ---p 00002000 08:01 6710 /usr/lib/apache2/modules/mod_access_compat.so
0fa86000-0fa87000 rw-p 00001000 08:01 6710 /usr/lib/apache2/modules/mod_access_compat.so
0fa97000-0fa9a000 r-xp 00000000 08:01 6691 /usr/lib/apache2/modules/mod_unixd.so
0fa9a000-0faa9000 ---p 00003000 08:01 6691 /usr/lib/apache2/modules/mod_unixd.so
(...)
They found a similar issue on the web and there was a patch released to fix this but it is not in our product
Issue: https://bugzilla.redhat.com/show_bug.cgi?id=958934
Patch: http://svn.apache.org/viewvc?view=revision&revision=1618555
1) Create a project
/wr/installs/lx8/wrlinux-8/wrlinux/configure --enable-board=qemuppc --enable-rootfs=glibc-small --with-package=apache2 --enable-reconfig --with-rcpl-version=0024
2) Create the file «$projDir/layers/local/recipes-httpd/apache2/apache2_2.4.16.bbappend» to give apache2 the module of prefork with the content below:
EXTRA_OECONF += "--with-mpm=prefork"
3) build the project and then run the qemu
make && make start-target
4) inside the target, create a user and switch to it
groupadd admin
useradd -g admin admin
su admin
5) Create required folders and files
mkdir logs
mkdir -p var/run
6) Create the file httpd.conf with the content below:
ServerRoot .
LoadModule unixd_module /usr/lib/apache2/modules/mod_unixd.so
LoadModule access_compat_module /usr/lib/apache2/modules/mod_access_compat.so
LoadModule alias_module /usr/lib/apache2/modules/mod_alias.so
LoadModule mpm_prefork_module /usr/lib/apache2/modules/mod_mpm_prefork.so
PidFile var/run/httpd.pid
Listen 127.0.0.1:8001
HostnameLookups off
ServerName localhost
User admin
Group admin
7) Run the web server in the foreground
/usr/sbin/httpd -f $PWD/httpd.conf -D FOREGROUND
8) Press Ctrl^C, you will get the error