Comment 33 for bug 1008385

Revision history for this message
In , Josh (josh-redhat-bugs) wrote :

This isn't a kernel bug.

A process can call prctl(PR_SET_NAME) to set it's task name (task->comm) in the kernel, as long as the name is under 16 characters. If you have mod_perl included in httpd, it calls prctl and sets the name to '/usr/sbin/httpd'.

Why it does this, I have absolutely no clue. But it does.

[jwboyer@hansolo ~]$ sudo gdb /usr/sbin/httpd
GNU gdb (GDB) Fedora (7.3.50.20110722-10.fc16)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/sbin/httpd...Reading symbols from /usr/lib/debug/usr/sbin/httpd.debug...done.
done.
(gdb) set args -k start
(gdb) break prctl
Breakpoint 1 at 0x162f0
(gdb) r
Starting program: /usr/sbin/httpd -k start
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Breakpoint 1, prctl () at ../sysdeps/unix/syscall-template.S:82
82 T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)
Missing separate debuginfos, use: debuginfo-install avahi-libs-0.6.30-4.fc16.x86_64 cyrus-sasl-lib-2.1.23-27.fc16.x86_64 dbus-libs-1.4.10-3.fc16.x86_64 keyutils-libs-1.5.2-1.fc16.x86_64 krb5-libs-1.9.2-6.fc16.x86_64 libcom_err-1.41.14-2.fc15.x86_64 libselinux-2.1.6-6.fc16.x86_64 libuuid-2.20.1-2.2.fc16.x86_64 mod_dnssd-0.6-4.fc15.x86_64 mod_perl-2.0.5-7.fc16.x86_64 mod_python-3.3.1-16.fc16.x86_64 mod_wsgi-3.3-1.fc16.x86_64 nspr-4.8.9-2.fc16.x86_64 nss-3.13.1-11.fc16.x86_64 nss-util-3.13.1-3.fc16.x86_64 openldap-2.4.26-6.fc16.x86_64 openssl-1.0.0g-1.fc16.x86_64 python-libs-2.7.2-5.2.fc16.x86_64
(gdb) bt
#0 prctl () at ../sysdeps/unix/syscall-template.S:82
#1 0x00007fffed120abc in Perl_magic_set (my_perl=0x55555594c1d0,
    sv=<optimized out>, mg=<optimized out>) at mg.c:2979
#2 0x00007fffed11c942 in Perl_mg_set (my_perl=0x55555594c1d0,
    sv=0x55555596c9e0) at mg.c:302
#3 0x00007fffed412079 in modperl_startup ()
   from /etc/httpd/modules/mod_perl.so
#4 0x00007fffed411fa0 in modperl_startup ()
   from /etc/httpd/modules/mod_perl.so
#5 0x00007fffed4123f5 in modperl_init () from /etc/httpd/modules/mod_perl.so
#6 0x00007fffed41254b in modperl_hook_init ()
   from /etc/httpd/modules/mod_perl.so
#7 0x0000555555580511 in ap_run_open_logs (pconf=0x5555557b4138,
    plog=0x5555557e62c8, ptemp=0x5555557e82d8, s=0x5555557de3d0)
    at /usr/src/debug/httpd-2.2.22/server/config.c:151
#8 0x000055555556b5cc in main (argc=3, argv=0x7fffffffe618)
    at /usr/src/debug/httpd-2.2.22/server/main.c:680
(gdb) up
#1 0x00007fffed120abc in Perl_magic_set (my_perl=0x55555594c1d0,
    sv=<optimized out>, mg=<optimized out>) at mg.c:2979
2979 if (prctl(PR_SET_NAME, (unsigned long)s, 0, 0, 0) != 0) {
(gdb) list
2974 PL_origargv[0][PL_origalen-1] = 0;
2975 for (i = 1; i < PL_origargc; i++)
2976 PL_origargv[i] = 0;
2977 #ifdef HAS_PRCTL_SET_NAME
2978 /* Set the legacy process name in addition to the POSIX name on Linux */
2979 if (prctl(PR_SET_NAME, (unsigned long)s, 0, 0, 0) != 0) {
2980 /* diag_listed_as: SKIPME */
2981 Perl_croak(aTHX_ "Can't set $0 with prctl(): %s", Strerror(errno));
2982 }
2983 #endif
(gdb) print s
$1 = 0x555555971070 "/usr/sbin/httpd"
(gdb) q
A debugging session is active.

 Inferior 1 [process 22814] will be killed.

Quit anyway? (y or n) y
[jwboyer@hansolo ~]$

I disabled mod_perl in my local httpd.d/perl.conf and it doesn't do this anymore.