Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 499630 - mail-filter/amavisd-new-2.7.2 with dev-lang/perl-5.16 has truncated incorrect process name
Summary: mail-filter/amavisd-new-2.7.2 with dev-lang/perl-5.16 has truncated incorrect...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Antivirus Team
URL: https://bugs.debian.org/cgi-bin/bugre...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-28 21:38 UTC by Tony Vroon (RETIRED)
Modified: 2019-07-08 10:49 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tony Vroon (RETIRED) gentoo-dev 2014-01-28 21:38:18 UTC
Ever since the upgrade to perl 5.16 on our systems, the process name (which used to be amavisd) is now truncated to /usr/sbin/amavi. As we use an SNMP-based monitoring system, we rely on process names remaining the same.

Information follows:
[ebuild   R    ] dev-lang/perl-5.16.3:0/5.16  USE="berkdb gdbm -debug -doc -ithreads" 0 kB
[ebuild   R    ] mail-filter/amavisd-new-2.7.2  USE="dkim razor snmp spamassassin -courier -ldap -mysql -postgres -qmail" 0 kB

Portage 2.2.7 (hardened/linux/amd64/no-multilib, gcc-4.6.3, glibc-2.17, 3.10.1-hardened-r1 x86_64)
=================================================================
System uname: Linux-3.10.1-hardened-r1-x86_64-AMD_Opteron-TM-_Processor_6238-with-gentoo-2.2
KiB Mem:   131923652 total, 122005196 free
KiB Swap:          0 total,         0 free
Timestamp of tree: Tue, 28 Jan 2014 12:30:01 +0000
ld GNU ld (GNU Binutils) 2.23.2
app-shells/bash:          4.2_p45
dev-lang/python:          2.7.5-r3
dev-util/cmake:           2.8.11.2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.69
sys-devel/automake:       1.11.6, 1.12.6, 1.13.4
sys-devel/binutils:       2.23.2
sys-devel/gcc:            4.6.3, 4.7.3-r1
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.9 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles getbinpkg lmirror merge-sync mirror news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles-cache.linx.net:8080/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j24"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://portage-rsync.linx.net/gentoo-portage"
USE="amd64 animgif apache2 avahi bash-completion berkdb bzip2 calendar cgi clamdtop cli cracklib crypt cups cxx diskio dkim dri elf expat fastcgi gd gdbm geoip gif hardened hpn httpd hwdb iconv idn intl ipv6 jpeg jpeg2k json justify keymap kmod libssh2 lm_sensors lzma lzo minizip mmx modules mpm-prefork mysql mysqli ncurses network network-cron no-old-linux nptl openmp pam pax_kernel pcre pdo perl perlsuid png python razor readline rss samba sasl schroedinger session snmp sockets spamassassin spell sqlite sse sse2 ssl stream syslog theora tiff truetype unicode urandom v4l2 vhosts vim-syntax vorbis vpx x264 xml xvid zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" APACHE2_MPMS="prefork" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7" RUBY_TARGETS="ruby19 ruby18" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

Problem:
gold ~ # cat /proc/9213/stat
9213 (/usr/sbin/amavi) S 1 9213 9213 0 -1 4218944 10442 0 4 0 137 9 0 0 20 0 1 0 421888394 218836992 21291 18446744073709551615 1 1 0 0 0 0 0 4224 3227655 0 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Expected (simulated):
gold ~ # cat /proc/9213/stat
9213 (amavisd) S 1 9213 9213 0 -1 4218944 10442 0 4 0 137 9 0 0 20 0 1 0 421888394 218836992 21291 18446744073709551615 1 1 0 0 0 0 0 4224 3227655 0 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Comment 1 Tony Vroon (RETIRED) gentoo-dev 2014-02-24 13:27:44 UTC
The behaviour change happened in Perl 5.14, according to Ben Hutchings:
http://us.generation-nt.com/answer/bug-652026-amavisd-new-init-script-not-working-stop-restart-help-205752131.html#205777231

Workaround for now is:
$myprogram_name = 'amavisd';
Comment 2 Tony Vroon (RETIRED) gentoo-dev 2014-02-24 14:11:40 UTC
No, that is still insufficient, as unwanted garbage is inserted:
30984 (amavisd (master) S 1 30984 30984 0 -1 4218944 10487 0 4 0 139 9 0 0 20 0 1 0 652271351 218861568 21304 18446744073709551615 1 1 0 0 0 0 0 4224 3227655 0 0 0 17 8 0 0 0 0 0 0 0 0 0 0 0 0 0

A box on which the perl update hasn't been applied clearly shows:
3707 (amavisd) S 7015 7015 7015 0 -1 4202560 55397 42402 20 0 2523 74 154 60 20 0 1 0 6513125065 80019456 13395 4294967295 1 1 0 0 0 0 0 4224 16391 0 0 0 17 1 0 0 0 0 0
Comment 3 Michael Orlitzky gentoo-dev 2018-11-17 17:00:14 UTC
Reported upstream as

https://gitlab.com/amavis/amavis/issues/36
Comment 4 Michael Orlitzky gentoo-dev 2019-07-05 16:18:44 UTC
@chainsaw:

The "(master)" string is needed to tell the master daemon (that coordinates the children) apart from its children which do the scanning. For example,

  # cat /proc/5871/stat
  5871 (amavisd (ch1-av) S 13921 13921 13921 0 -1 ...

  # cat /proc/13921/stat
  13921 (amavisd (master) S 1 13921 13921 0 -1 ...

Are you unable to monitor the full string "amavisd (master)"? Digging into the amavisd source, it looks like the " (master)" suffix is appended unconditionally:

  $0 = c('myprogram_name') . ' (master)';
  sd_notify(0, "STATUS=Transferring control to Net::Server.");

The only other option we'd have is to try to undo the Perl change, by e.g. calling prctl AGAIN in amavisd, to revert the legacy process name to "amavisd" rather than "amavisd (master)". Of course, that's likely to piss off the people who like seeing "(master)" and "(child)" in their ps output.
Comment 5 Michael Orlitzky gentoo-dev 2019-07-07 00:45:40 UTC
You might also try,

  $myprogram_name = "amavisd\0"

but I think that will set both the POSIX and the legacy process names.

It's a clever workaround, but if you'll humour me, I'd like to hear that there's a real problem with "amavisd (master)" before we start documenting hacks like that =)
Comment 6 Tony Vroon (RETIRED) gentoo-dev 2019-07-08 07:49:38 UTC
This problem occurred 4 years and 1 monitoring system ago. Sorry, but this is no longer worth working on.
Comment 7 Michael Orlitzky gentoo-dev 2019-07-08 10:49:07 UTC
(In reply to Tony Vroon from comment #6)
> This problem occurred 4 years and 1 monitoring system ago. Sorry, but this
> is no longer worth working on.

No problem. We'll add some documentation about $myprogram_name to the amavisd.conf file and call it a day.