<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>46654</bug_id>
          
          <creation_ts>2002-08-19 16:03:00 +0000</creation_ts>
          <short_desc>Don&apos;t fork a shell for pipe filter if not necessary</short_desc>
          <delta_ts>2007-09-14 12:17:01 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>Unmaintained</classification>
          <product>kmail</product>
          <component>general</component>
          <version>1.4.3</version>
          <rep_platform>openSUSE</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>41514</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>wishlist</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Malte S . Stretz">msquadrat.nospamplease</reporter>
          <assigned_to name="kdepim bugs">pim-bugs-null</assigned_to>
          
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>72274</commentid>
    <comment_count>0</comment_count>
    <who name="Malte S . Stretz">msquadrat.nospamplease</who>
    <bug_when>2002-08-19 15:54:34 +0000</bug_when>
    <thetext>(*** This bug was imported into bugs.kde.org ***)

Package:           kmail
Version:           1.4.3 (using KDE 3.0.3 )
Severity:          wishlist
Installed from:    SuSE
Compiler:          gcc version 2.95.3 20010315 (SuSE)
OS:                Linux (i686) release 2.4.18
OS/Compiler notes: 

This one bugs me since I&apos;m using KMail in combination with SpamAssassin: While a message is received the whole app freezes and you can&apos;t do anything. Sometimes the network checks are slow and receiving 100 messages takes more tahn 30 minutes for me and sometimes freezes my whole machine (including kicker panels etc.). (According to SA&apos;s timelogs doesn&apos;t it really take so long to process the message. Seems like there&apos;s some overhead somewhere else.) But that&apos;s because the filters aren&apos;t run async and I&apos;m pretty shure there&apos;s already a bug/wish complaining about this.

What I wanted to suggest is the following: Currently for each pipe process a bash is forked. Why don&apos;t you do it like Perl&apos;s exec() routine [1]; &quot;[...] the argument is checked for shell metacharacters and if there are any the entire argument is passed to the system&apos;s command shell for parsing [...]. If there are no shell metacharacters in the argument it is split into words and passed directly to execvp which is more efficient.&quot;

Sounds like a good idea doesn&apos;t it? :)
Malte

[1]http://www.perldoc.com/perl5.6/pod/func/exec.html

(Submitted via bugs.kde.org)
(Called from KBugReport dialog)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72273</commentid>
    <comment_count>1</comment_count>
    <who name="Marc Mutz">mutz</who>
    <bug_when>2002-08-19 21:16:18 +0000</bug_when>
    <thetext>-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 19 August 2002 17:54 Malte S.Stretz wrote:
&lt;snip&gt;
&gt; What I wanted to suggest is the following: Currently for each pipe
&gt; process a bash is forked. Why don&apos;t you do it like Perl&apos;s exec()
&gt; routine [1]; &quot;[...] the argument is checked for shell metacharacters
&gt; and if there are any the entire argument is passed to the system&apos;s
&gt; command shell for parsing [...]. If there are no shell metacharacters
&gt; in the argument it is split into words and passed directly to
&gt; execvp which is more efficient.&quot;
&gt; 
&gt; Sounds like a good idea doesn&apos;t it? :)
&lt;snip&gt;

I don&apos;t think that this makes such a difference really. Async filters 
are a nice idea maybe for KDE3.2...

Marc

- -- 
If free-software authors lose the right to disclaim all warranties and
find themselves getting sued over the performance of the programs
they&apos;ve written they&apos;ll stop contributing free software to the world.
 -- Bruce Perens: Open Sources: Voices from the Open Source Revolution
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9YWAj3oWD+L2/6DgRAsf5AJ46x+Psd5H9cBDKPXdhBDFku/jmJQCgmQsR
DB5t1BP/Cf0wUVG+m9DAab8=
=KK37
-----END PGP SIGNATURE-----</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72272</commentid>
    <comment_count>2</comment_count>
    <who name="Malte S . Stretz">msquadrat.nospamplease</who>
    <bug_when>2002-08-19 22:23:36 +0000</bug_when>
    <thetext>On Monday 19 August 2002 23:16 CET Marc Mutz wrote:
&gt; On Monday 19 August 2002 17:54 Malte S.Stretz wrote:
&gt; &lt;snip&gt;
&gt; &gt; What I wanted to suggest is the following: Currently for each pipe
&gt; &gt; process a bash is forked. Why don&apos;t you do it like Perl&apos;s exec()
&gt; &gt; routine [1]; &quot;[...] the argument is checked for shell metacharacters
&gt; &gt; and if there are any the entire argument is passed to the system&apos;s
&gt; &gt; command shell for parsing [...]. If there are no shell metacharacters
&gt; &gt; in the argument it is split into words and passed directly to
&gt; &gt; execvp which is more efficient.&quot;
&gt; &gt;
&gt; &gt; Sounds like a good idea doesn&apos;t it? :)
&gt; &lt;snip&gt;
&gt;
&gt; I don&apos;t think that this makes such a difference really.

I can&apos;t prove it but I think calling bash makes each call take the double 
time spamc needs alone. (You can configure it to log the time it needed to 
process a message.) (And the double memory. spamc is ~21kB big; it&apos;s made 
to be lightweight and fast.) That&apos;s probably not much but it adds up for 
many messages. Havy you ever tried to use SA with KMail? Try it. It&apos;s fun.

Additionally there&apos;s the point that KMail sometimes freezes my whole KDE 
when it&apos;s piping. I already tried calling `nice -5 spamc` which didn&apos;t 
help. It might be worth a try at least (I&apos;d provide a patch it if I spoke 
C++ good enough). Maybe for KDE3.2... :)

&gt; Async filters are a nice idea maybe for KDE3.2...

Definitely.

Malte</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>159961</commentid>
    <comment_count>3</comment_count>
    <who name="Malte S. Stretz">mss</who>
    <bug_when>2003-09-20 23:25:47 +0000</bug_when>
    <thetext>Bah, I did some testing and not starting a shell to execute commands isn&apos;t 
really worth it -- the rest is a dup of bug 41514. 

*** This bug has been marked as a duplicate of 41514 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>