6.0.0-beta1
7/16/25

[#10776] cpu usage is high (~ 100%)
Summary cpu usage is high (~ 100%)
Queue IMP
Queue Version 5.0.14
Type Bug
State Resolved
Priority 1. Low
Owners slusarz (at) horde (dot) org
Requester pwong (at) chem (dot) utoronto (dot) ca
Created 11/17/2011 (4990 days ago)
Due
Updated 12/23/2011 (4954 days ago)
Assigned 11/30/2011 (4977 days ago)
Resolved 12/23/2011 (4954 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
12/23/2011 09:56:39 PM Michael Slusarz Comment #21
State ⇒ Resolved
Reply to this comment
Mark as resolved... at least one commit was tied to this ticket.
12/23/2011 09:56:01 PM Michael Slusarz State ⇒ Not A Bug
 
12/22/2011 01:24:13 PM samuel (dot) wolf (at) wolf-maschinenbau (dot) de Comment #20 Reply to this comment
My reaction is that your PHP appears badly broken.
The problem disappeared after a php and and imp update (unfortunately 
at the same time).
Problem is resolved for me, thank you.
12/12/2011 10:47:49 PM Michael Slusarz Comment #19 Reply to this comment
You need to provide IMAP debug logs, so we can see if we are able to
workaround the broken server.
This log makes no sense.  It is impossible given the current state of 
the code.
C: 1 STARTTLS
S: 1 OK Begin TLS negotiation now.
This is correct.
C: 2 STARTTLS
ERROR: IMAP read/timeout error.
There's no way the code could get here.  Either the original STARTTLS 
command failed and would throw an Exception (which would be logged), 
or else we move to login commands.  There simply is no way for 
consecutive STARTTLS commands to be sent.  It is an either/or - we 
attempt TLS negotiation exactly once.

My reaction is that your PHP appears badly broken.  Unless proven 
otherwise, this is the only conclusion (the IMAP server appears fine). 
  The only way I could even imagine this happening is if a single PHP 
process was somehow multi-threaded and two threads were trying to 
initiate the imap client at the same time (and if this is happening, 
your PHP is beyond badly broken).
12/12/2011 01:45:14 PM samuel (dot) wolf (at) wolf-maschinenbau (dot) de Comment #18 Reply to this comment
You need to provide IMAP debug logs, so we can see if we are able to
workaround the broken server.
2011-12-12T14:18:57+01:00 ERR: HORDE [imp] IMAP read error or IMAP 
connection timed out. [pid 12703 on line 340 of 
"/var/www/https/horde4/imp/lib/Imap.php"]
2011-12-12T14:18:57+01:00 NOTICE: HORDE [imp] PHP ERROR: fwrite(): 
send of 10 bytes failed with errno=104 Die Verbindung wurde vom 
Kommunikationspartner zurückgesetzt [pid 12703 on line 3747 of 
"/usr/share/php/Horde/Imap/Client/Socket.php"]
2011-12-12T14:18:57+01:00 NOTICE: HORDE [imp] PHP ERROR: fwrite(): 
send of 2 bytes failed with errno=32 Datenübergabe unterbrochen 
(broken pipe) [pid 12703 on line 3749 of 
"/usr/share/php/Horde/Imap/Client/Socket.php"]
2011-12-12T14:18:57+01:00 NOTICE: HORDE [imp] PHP ERROR: Uninitialized 
string offset: 0 [pid 12703 on line 3750 of 
"/usr/share/php/Horde/Imap/Client/Base.php"]
2011-12-12T14:18:57+01:00 NOTICE: HORDE [imp] PHP ERROR: Undefined 
offset: 1 [pid 12703 on line 3922 of 
"/usr/share/php/Horde/Imap/Client/Socket.php"]
2011-12-12T14:18:57+01:00 NOTICE: HORDE [imp] PHP ERROR: fwrite(): 
send of 10 bytes failed with errno=32 Datenübergabe unterbrochen 
(broken pipe) [pid 12703 on line 3747 of 
"/usr/share/php/Horde/Imap/Client/Socket.php"]
2011-12-12T14:18:57+01:00 NOTICE: HORDE [imp] PHP ERROR: fwrite(): 
send of 2 bytes failed with errno=32 Datenübergabe unterbrochen 
(broken pipe) [pid 12703 on line 3749 of 
"/usr/share/php/Horde/Imap/Client/Socket.php"]

S: * BYE Logging out
S: 7 OK Logout completed.
------------------------------
Timestamp: Mon, 12 Dec 2011 14:18:56 +0100
S: * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID 
ENABLE STARTTLS AUTH=PLAIN] Dovecot ready.
C: 1 STARTTLS
S: 1 OK Begin TLS negotiation now.
C: 2 STARTTLS
ERROR: IMAP read/timeout error.
C: 3 STARTTLS
S: 
^V^C^A^@<BA>^D^@^@<B6>^@^@^@^@^@<B0><A0><FE>i7<8C><D4><<nGS<D3>^F<BA><FF><9A><FB>k<FB><D2>eH|<96><C6>}i^W^B<D1><C7>D<BA><8E><9D>@Ty{1^_^G<E9><B8>4<B6>^Z<CE><C7>0Q%^Y<9E>`<E2><FF>P<E5><89><F2>?<AE>/<98>Ih)
oS<C9><DF><C7>X<A4><DE>b<CE>^N<BD>l_%<DE>T^O^Q<CE><D7>?9<B3>^V<89><8B><E2>3m<CE><DA><E8><C7>d<BD><8B>Fn<C9>^M<A9>Mn<C1><B3><80>97<A0><E9>+<B0>^Ye?7M<8F>ywZ<C3>)o^P.^X?^E=?v^N^<C1><DC><D6>^\<9F>c^Z<B1><FC>D/
<D7>B<D9>?G<DF>^P<F0><8F><A3>^N^Z<DF>2^GF^T^C^A^@^A^A^V^C^A^@0<FD>O<C0><8B><A5>S9[<A9><D4>$<E8><FC>?<D9>n<E5><98>y<E2>?^V<A0>+1<C9>5<DC>l[?<89>@K^B^X<9F>;<C0><80>$q<AA>TP^U^C^A^@ 
<B1><F0>_<A1>8^GS^D<CC>d<B3>
<CE>JD<A8><95>
S: ~<98>hM<E3>S<B4>^L<BE>ac^S<D3><C5>0
ERROR: IMAP server closed the connection.
C: 4 STARTTLS
ERROR: IMAP server closed the connection.
------------------------------
Timestamp: Mon, 12 Dec 2011 14:18:58 +0100
S: * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID 
ENABLE STARTTLS AUTH=PLAIN] Dovecot ready.
C: 1 STARTTLS
S: 1 OK Begin TLS negotiation now.


12/08/2011 08:44:27 PM Michael Slusarz Comment #17 Reply to this comment
Your IMAP server is broken.
dovecot-imapd                    1:1.2.9-1ubuntu6.5
That version is 2+ years old.  Timo has fixed a bunch of bugs in 1.2.x 
since then:

http://dovecot.org/doc/NEWS-1.2

[Show Quoted Text - 10 lines]
Irrelevant.

Without a debug log, we can't do anything unfortunately.  Your other 
option is to isolate a message causing the issue, move it to a 
temporary account, and then do imap debug logging on just that account.
12/08/2011 08:37:37 PM samuel (dot) wolf (at) wolf-maschinenbau (dot) de Comment #16 Reply to this comment
Your IMAP server is broken.
dovecot-imapd                    1:1.2.9-1ubuntu6.5
You need to provide IMAP debug logs, so we can see if we are able to 
workaround the broken server.
Horde/IMP imap debug log is impossible on a production server (logfile 
size) but I found something interesting in the syslog at this time:
Dec  8 14:23:13 mailserver dovecot: imap-login: Disconnected (no auth 
attempts): rip=127.0.0.1, lip=127.0.0.1, TLS handshaking: SSL_accept() 
failed: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number




12/08/2011 06:46:15 PM Michael Slusarz Comment #15
Assigned to Michael Slusarz
Priority ⇒ 1. Low
Reply to this comment
Your IMAP server is broken.

You need to provide IMAP debug logs, so we can see if we are able to 
workaround the broken server.


To further debug this issue, we need details of the IMP -> IMAP/POP 
communication.

To enable debugging, see instructions contained in 
imp/config/backends.php (the 'debug' config parameter).

Debugging should not be enabled on a production server,   Attach/post 
only the portion of the log that directly deals with the problem 
reported (it may be simplest to clear the log file and then perform 
the event that causes the error).
12/08/2011 05:19:29 PM samuel (dot) wolf (at) wolf-maschinenbau (dot) de Comment #14 Reply to this comment
Today it happened again, this is definitely the problem:

2011-12-08T14:23:13+01:00 NOTICE: HORDE [imp] PHP ERROR: Undefined 
offset: 1 [pid 9681 on line 3922 of 
"/usr/share/php/Horde/Imap/Client/Socket.php"]
2011-12-08T14:23:13+01:00 NOTICE: HORDE [imp] PHP ERROR: Undefined 
offset: 1 [pid 9681 on line 3922 of 
"/usr/share/php/Horde/Imap/Client/Socket.php"]
2011-12-08T14:23:13+01:00 NOTICE: HORDE [imp] PHP ERROR: Uninitialized 
string offset: 0 [pid 9681 on line 3750 of 
"/usr/share/php/Horde/Imap/Client/Base.php"]
2011-12-08T14:23:13+01:00 ERR: HORDE [imp] IMAP server closed the 
connection unexpectedly. [pid 9681 on line 340 of 
"/var/www/https/horde4/imp/lib/Imap.php"]
2011-12-08T14:23:13+01:00 NOTICE: HORDE [imp] PHP ERROR: fwrite(): 
send of 10 bytes failed with errno=32 Datenübergabe unterbrochen 
(broken pipe) [pid 9681 on line 3747 of 
"/usr/share/php/Horde/Imap/Client/Socket.php"]
2011-12-08T14:23:13+01:00 NOTICE: HORDE [imp] PHP ERROR: fwrite(): 
send of 2 bytes failed with errno=32 Datenübergabe unterbrochen 
(broken pipe) [pid 9681 on line 3749 of 
"/usr/share/php/Horde/Imap/Client/Socket.php"]

Thu Dec  8 14:23:01 CET 2011
www-data  9681  0.3  0.3 752888  6544 ?        S    14:22   0:00 
/usr/sbin/apache2 -k start

Thu Dec  8 14:24:01 CET 2011
www-data  9681 76.9  1.3 762456 27844 ?        RL   14:22   0:48 
/usr/sbin/apache2 -k start

Thu Dec  8 14:25:01 CET 2011
www-data  9681 87.9  1.3 762456 27844 ?        RL   14:22   1:48 
/usr/sbin/apache2 -k start
12/07/2011 04:45:17 PM samuel (dot) wolf (at) wolf-maschinenbau (dot) de Comment #13 Reply to this comment
You will need to provide an example message that triggers this.  Or   
else determine where the PHP code is causing full CPU usage.
Activate NOTICE logging in Horde and write the CPU load every minute 
to a logfile.
36 hours happens nothing, than the CPU load of apache2 climb up to 
100%, horde.log show at this time:

2011-12-07T14:18:56+01:00 ERR: HORDE [imp] IMAP read error or IMAP 
connection timed out. [pid 15436 on line 340 of 
"/var/www/https/horde4/imp/lib/Imap.php"]
2011-12-07T14:18:56+01:00 NOTICE: HORDE [imp] PHP ERROR: fwrite(): 
send of 10 bytes failed with errno=104 Die Verbindung wurde vom 
Kommunikationspartner zurückgesetzt [pid 15436 on line 3747 of 
"/usr/share/php/Horde/Imap/Client/Socket.php"]
2011-12-07T14:18:56+01:00 NOTICE: HORDE [imp] PHP ERROR: fwrite(): 
send of 2 bytes failed with errno=32 Datenübergabe unterbrochen 
(broken pipe) [pid 15436 on line 3749 of 
"/usr/share/php/Horde/Imap/Client/Socket.php"]

Wed Dec  7 14:19:01 CET 2011
www-data 15436  8.8  1.4 762812 30204 ?        RL   14:18   0:05 
/usr/sbin/apache2 -k start

Wed Dec  7 14:20:01 CET 2011
www-data 15436 54.3  1.4 762812 30204 ?        RL   14:18   1:04 
/usr/sbin/apache2 -k start

Wed Dec  7 14:21:01 CET 2011
www-data 15436 69.5  1.4 762812 30204 ?        RL   14:18   2:04 
/usr/sbin/apache2 -k start

Wed Dec  7 14:22:01 CET 2011
www-data 15436 77.0  1.4 762812 30204 ?        RL   14:18   3:04 
/usr/sbin/apache2 -k start

Wed Dec  7 14:23:01 CET 2011
www-data 15436 81.5  1.4 762812 30204 ?        RL   14:18   4:03 
/usr/sbin/apache2 -k start
12/02/2011 09:36:13 PM Michael Slusarz Comment #12 Reply to this comment
Thanks Git. After I modified the file, when I compose a new message, 
I see a null in the body message textbox. Is there a way to get rid 
of it?
This was recently fixed for IMP 5.0.16.  It only affected IE.

12/02/2011 09:34:18 PM Michael Slusarz Comment #11 Reply to this comment

[Show Quoted Text - 10 lines]
No - this will throw an error but is otherwise harmless.  It would not 
cause 100% cpu usage.
12/01/2011 10:46:48 PM samuel (dot) wolf (at) wolf-maschinenbau (dot) de Comment #10 Reply to this comment
You will need to provide an example message that triggers this.  Or 
else determine where the PHP code is causing full CPU usage.
Maybe thats the problem of the full CPU load?:

[Thu Dec 01 14:56:15 2011] [error] [client 10.11.2.23] PHP Fatal 
error:  Call to a member function getName() on a non-object in 
/var/www/https/horde4/imp/lib/Ajax/Appli
cation.php on line 1338, referer: 
https://example.com/horde4/imp/message-dimp.php?ajaxui=1&mailbox=SU5CT1g&uid=7971&uniq=1322747603481
    **** Warning:  An error occurred while reading an XREF table.
    **** The file has been damaged.  This may have been caused
    **** by a problem while converting or transfering the file.
    **** Ghostscript will attempt to recover the data.

    **** This file had errors that were repaired or ignored.
    **** Please notify the author of the software that produced this
    **** file that it does not conform to Adobe's published PDF
    **** specification.
11/30/2011 06:56:34 PM Jan Schneider State ⇒ Feedback
 
11/27/2011 08:42:58 PM Michael Slusarz Comment #9 Reply to this comment
Last night I installed imp 5.0.15. Today ~100% CPU load again, 
Apache restart helps for a while.
If I want load the preview of a really damage mail imp load and 
never stop, the CPU load is than ~100%.
You will need to provide an example message that triggers this.  Or 
else determine where the PHP code is causing full CPU usage.
11/25/2011 08:46:27 AM samuel (dot) wolf (at) wolf-maschinenbau (dot) de Comment #8 Reply to this comment
Last night I installed imp 5.0.15. Today ~100% CPU load again, Apache 
restart helps for a while.
If I want load the preview of a really damage mail imp load and never 
stop, the CPU load is than ~100%.
11/19/2011 02:17:57 AM Michael Slusarz Comment #7 Reply to this comment

[Show Quoted Text - 10 lines]
This patch may require other changes since IMP 5.0.14 then also.  So 
unless you are running a full git master installation, you will have 
to wait for 5.0.15.
11/17/2011 10:24:09 PM pwong (at) chem (dot) utoronto (dot) ca Comment #6 Reply to this comment
Changes have been made in Git for this ticket:

Bug #10776: Don't access undefined offsets.

  1 files changed, 29 insertions(+), 19 deletions(-)
http://git.horde.org/horde-git/-/commit/0e7fbcd397165a01d4762534ede41f08e72cd6c0
Thanks Git. After I modified the file, when I compose a new message, I 
see a null in the body message textbox. Is there a way to get rid of it?

11/17/2011 07:44:21 PM Michael Slusarz Comment #5 Reply to this comment
I really have no idea why this would break the mailbox view.  The 
error is occurring due to issues with a user's identity that are 
thrown when that user opens a compose window.

I've fixed the undefined offsets, but that should have just been an 
annoying log-filling warning, not a fatal issue.  You will need to 
track down the request(s) that are hammering the server in your cases 
or, better still, what is triggering these requests.
11/17/2011 07:40:59 PM Git Commit Comment #4 Reply to this comment
Changes have been made in Git for this ticket:

Bug #10776: Don't access undefined offsets.

  1 files changed, 29 insertions(+), 19 deletions(-)
http://git.horde.org/horde-git/-/commit/0e7fbcd397165a01d4762534ede41f08e72cd6c0
11/17/2011 03:08:35 PM samuel (dot) wolf (at) wolf-maschinenbau (dot) de Comment #3 Reply to this comment
Some users' inbox reads "Loading..."
on top instead of seeing the "Inbox". But they can still work with the
webmail.
I can confirm this problem, Apache use 100% CPU, login via SSH is very slow.
My setup:
php5  5.3.2-1ubuntu4.10
apache2  2.2.14-5ubuntu8.7
Ubuntu 10.04 Server

11/17/2011 02:51:13 PM samuel (dot) wolf (at) wolf-maschinenbau (dot) de Comment #2 Reply to this comment
Some users' inbox reads "Loading..."  on top instead of seeing the 
"Inbox". But they can still work with the  webmail.
I can confirm this problem, Apache use 100% CPU, login via SSH is very slow.
11/17/2011 02:38:33 PM pwong (at) chem (dot) utoronto (dot) ca Comment #1
Priority ⇒ 2. Medium
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Summary ⇒ cpu usage is high (~ 100%)
Type ⇒ Bug
Queue ⇒ IMP
Reply to this comment
Ever since we installed the latest version of HORDE/IMP, we get the 
following errors in the log which caused 100% in one of the cores. Is 
this related to the dynamic mode? Some users' inbox reads "Loading..." 
on top instead of seeing the "Inbox". But they can still work with the 
webmail.

horde.log:2011-11-14T09:23:32-05:00 NOTICE: HORDE [imp] PHP ERROR:
Undefined offset: 3 [pid 6416 on line 1799 of 
"/var/httpd/htdocs/mail/horde/imp/lib/Ajax/Application.php"]
horde.log:2011-11-14T09:23:32-05:00 NOTICE: HORDE [imp] PHP ERROR:
Undefined offset: 2 [pid 6416 on line 1799 of 
"/var/httpd/htdocs/mail/horde/imp/lib/Ajax/Application.php"]
horde.log:2011-11-14T09:23:32-05:00 NOTICE: HORDE [imp] PHP ERROR:
Undefined offset: 1 [pid 6416 on line 1799 of 
"/var/httpd/htdocs/mail/horde/imp/lib/Ajax/Application.php"]

Thanks in advance,

Saved Queries