Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 90679

Summary: tcprules halts with >99% cpu usage while attempting to read specific file.
Product: Gentoo Linux Reporter: Faux <krazywest>
Component: [OLD] ServerAssignee: Qmail Team (OBSOLETE) <qmail-bugs+disabled>
Status: VERIFIED TEST-REQUEST    
Severity: normal CC: kg6kvq, kurtg, ragnarokbmx
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Patch for tcprules.c

Description Faux 2005-04-27 21:34:33 UTC
When attempting to use the command: tcprules /etc/tcprules.d/tcp.qmail-smtp.cdb /etc/tcprules.d/.tcp.qmail-smtp.tmp </etc/tcprules.d/tcp.qmail-smtp

Where the file tcp.qmail-smtp is something like:

1.2.3.4:allow,RELAYCLIENT="",RBLSMTPD=""
127.0.0.1:allow,RELAYCLIENT="",RBLSMTPD=""
 
:allow

causes tcprules to cease responding, with >99% CPU usage. NB. There is a space on the third line (the empty line) of that file. Without the space (or the line), it works fine.
Removing the new line after the space also causes it to run correctly (ie.:

1.2.3.4:allow,RELAYCLIENT="",RBLSMTPD=""
127.0.0.1:allow,RELAYCLIENT="",RBLSMTPD=""
{SPACE}:allow

), as does removing the line entirely.

I'd believe this was a syntax error if it didn't use cpu.

This has apparently happened on other systems, with other plausible explinations: http://bugs.gentoo.org/show_bug.cgi?id=89442

Reproducible: Always
Steps to Reproduce:
1. Get the system in a ready state by emerging qmail, and any dependencies for tcprules.

2. Make the contents of /etc/tcprules.d/tcp.qmail-smtp
1.2.3.4:allow,RELAYCLIENT="",RBLSMTPD=""
127.0.0.1:allow,RELAYCLIENT="",RBLSMTPD=""
  <--- NB: There's a space there.
:allow

3. Run the command 'tcprules /etc/tcprules.d/tcp.qmail-smtp.cdb /etc/tcprules.d/.tcp.qmail-smtp.tmp </etc/tcprules.d/tcp.qmail-smtp'.

4. Examine top.

Actual Results:  
'top' reported that tcprules was using all of the cpu, and tcprules stopped 
accepting input.

Expected Results:  
Run as it would have without the space present.

> emerge info
Portage 2.0.51.19 (default-linux/x86/2005.0, gcc-3.3.2, glibc-2.3.2-r9, 2.6.9-
bytemark-uml-20041208-1-bytemark-uml-20041207-1 i686)
=================================================================
System uname: 2.6.9-bytemark-uml-20041208-1-bytemark-uml-20041207-1 i686 UML
Gentoo Base System version 1.4.10
Python:              dev-lang/python-2.3.3-r1 [2.3.3 (#1, Jun  2 2004, 12:19:50
)]
distcc 2.16 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
dev-lang/python:     2.3.3-r1
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.4
sys-devel/binutils:  2.14.90.0.8-r1
sys-devel/libtool:   1.4.3-r4, 1.5.10-r4
virtual/os-headers:  2.4.21-r1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -march=pentium4 -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/
config /var/bind /var/qmail/alias /var/qmail/control /var/vpopmail/domains /var/
vpopmail/etc"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=pentium4 -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distcc distlocks sandbox sfperms"
GENTOO_MIRRORS="http://mirror.bytemark.co.uk/gentoo-distfiles"
MAKEOPTS=" -j8"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://mirror.bytemark.co.uk/gentoo"
USE="x86 alsa apm arts authdaemond avi berkdb bitmap-fonts crypt cups emboss 
encode foomaticdb fortran gdbm gif gpm gtk2 imlib ipv6 jpeg libg++ libwww mad 
maildir mikmod motif mp3 mpeg mysql ncurses nls oggvorbis pam pdflib perl png 
python quicktime readline ruby slang spell ssl svga tcpd tiff truetype truetype-
fonts type1-fonts valias vhosts xml2 xmms xv zlib"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, PORTDIR_OVERLAY
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2005-07-02 18:04:59 UTC
*** Bug 97772 has been marked as a duplicate of this bug. ***
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2005-07-02 18:06:30 UTC
patches to fix tcprules welcome
Comment 3 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2005-09-11 16:00:45 UTC
*** Bug 89442 has been marked as a duplicate of this bug. ***
Comment 4 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2005-09-11 16:01:52 UTC
Created attachment 68205 [details, diff]
Patch for tcprules.c

I've attached a small patch for tcprules.c. Can you please test this patch
before we add it to portage?
Comment 5 Alex V. Koval 2005-09-16 01:42:51 UTC
thank you, this patch helped me on AMD64 - no more freezing, program worked
to make tcprules.smtp.cdb
Comment 6 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2005-09-17 11:39:39 UTC
I'll add the patch to the ebuild in the next days. Thanks for testing.
Comment 7 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2005-10-15 14:59:26 UTC
Sorry for the delay, ucspi-tcp-0.88-r13 is now in CVS. Can you test it, please?
Comment 8 Michael Hanselmann (hansmi) (RETIRED) gentoo-dev 2006-03-12 10:40:25 UTC
No response, closing.