Re: [Dovecot] dovecot-lda segfaults with some sieve scripts

2010-09-30 Thread interfaSys sàrl
Hello Stephan,

This fix works. Thank you for that.

Cheers,

Olivier


On 29/09/2010 18:11, Stephan Bosch wrote:
 
 Hello again,

 I've added the -d and -f flags to the command line and this time I got a
 trace.

 (gdb) r
 Starting program: /usr/libexec/dovecot/dovecot-lda -p
 example-message.eml -f u...@domain.com -d u...@domain.com
 (no debugging symbols found)...(no debugging symbols found)...(no
 debugging symbols found)...(no debugging symbols found)...(no debugging
 symbols foun.
 Program received signal SIGSEGV, Segmentation fault.
 0x000800e70140 in seff_flags_merge () from
 /usr/lib/dovecot/libdovecot-sieve.so.0
 (gdb) bt full
 #0  0x000800e70140 in seff_flags_merge () from
 /usr/lib/dovecot/libdovecot-sieve.so.0
 No symbol table info available.
 
 Does the attached patch fix it perhaps?
 
 Regards,
 
 Stepha.


Re: [Dovecot] dovecot-lda segfaults with some sieve scripts

2010-09-29 Thread Stephan Bosch

 Op 29-9-2010 14:42, interfaSys sàrl schreef:

  Hello,

One account couldn't get emails all the sudden.
dovecot-lda was crashing with signal 11 (segmentation fault).
There was absolutely nothing in the dovecot logs, even with mail_debug=yes.

I found out that it was because of the following lines in a sieve script
that were generated by a script generator (Ingo).

if true {
 keep;
 stop;
}

I'm using the latest revision of pigeonhole with Dovecot 2.0.4.


Hmm. I cannot reproduce this.

You should:

1) send your dovecot -n output.

2) If you can easily reproduce it: produce a backtrace of the problem 
using gdb:


You can for instance run dovecot-lda manually as follows: gdb --args 
/usr/lib/dovecot-lda -p example-message.eml


And then:

- issue 'r' command
- (hopefully) see it crash with sigsegfault
- issue 'bt full' command and report the output back here
- also include a copy of the full Sieve script that you are using and 
the example message.


You can also use core dumps if the problem is more transient: 
http://www.dovecot.org/bugreport.html


Regards,

Stephan.








Re: [Dovecot] dovecot-lda segfaults with some sieve scripts

2010-09-29 Thread interfaSys sàrl
OK, I'll give the trace a try. Thanks for the instructions.

In the meantime, here is more info.
The sieve script does a redirect and a local save. It works fine if only
the redirect is in place.

if true {
redirect some.em...@domain.com;
}

if true {
keep;
stop;
}

I'm using mdbox as storage.

Cheers,

Olivier


On 29/09/2010 15:01, Stephan Bosch wrote:
  Op 29-9-2010 14:42, interfaSys sàrl schreef:
   Hello,

 One account couldn't get emails all the sudden.
 dovecot-lda was crashing with signal 11 (segmentation fault).
 There was absolutely nothing in the dovecot logs, even with
 mail_debug=yes.

 I found out that it was because of the following lines in a sieve script
 that were generated by a script generator (Ingo).

 if true {
  keep;
  stop;
 }

 I'm using the latest revision of pigeonhole with Dovecot 2.0.4.
 
 Hmm. I cannot reproduce this.
 
 You should:
 
 1) send your dovecot -n output.
 
 2) If you can easily reproduce it: produce a backtrace of the problem
 using gdb:
 
 You can for instance run dovecot-lda manually as follows: gdb --args
 /usr/lib/dovecot-lda -p example-message.eml
 
 And then:
 
 - issue 'r' command
 - (hopefully) see it crash with sigsegfault
 - issue 'bt full' command and report the output back here
 - also include a copy of the full Sieve script that you are using and
 the example message.
 
 You can also use core dumps if the problem is more transient:
 http://www.dovecot.org/bugreport.html
 
 Regards,
 
 Stephan.
 
 
 
 
 
 


Re: [Dovecot] dovecot-lda segfaults with some sieve scripts

2010-09-29 Thread interfaSys sàrl
Hello,

I tried to do a trace but it didn't seem to work.

(gdb) r
Starting program: /usr/libexec/dovecot/dovecot-lda -p example-message.eml
(no debugging symbols found)...(no debugging symbols found)...(no
debugging symbols found)...(no debugging symbols found)...(no debugging
symbols founn

Program exited with code 0100.

Nothing gets delivered.

Cheers,

Olivier


On 29/09/2010 15:01, Stephan Bosch wrote:
  Op 29-9-2010 14:42, interfaSys sàrl schreef:
   Hello,

 One account couldn't get emails all the sudden.
 dovecot-lda was crashing with signal 11 (segmentation fault).
 There was absolutely nothing in the dovecot logs, even with
 mail_debug=yes.

 I found out that it was because of the following lines in a sieve script
 that were generated by a script generator (Ingo).

 if true {
  keep;
  stop;
 }

 I'm using the latest revision of pigeonhole with Dovecot 2.0.4.
 
 Hmm. I cannot reproduce this.
 
 You should:
 
 1) send your dovecot -n output.
 
 2) If you can easily reproduce it: produce a backtrace of the problem
 using gdb:
 
 You can for instance run dovecot-lda manually as follows: gdb --args
 /usr/lib/dovecot-lda -p example-message.eml
 
 And then:
 
 - issue 'r' command
 - (hopefully) see it crash with sigsegfault
 - issue 'bt full' command and report the output back here
 - also include a copy of the full Sieve script that you are using and
 the example message.
 
 You can also use core dumps if the problem is more transient:
 http://www.dovecot.org/bugreport.html
 
 Regards,
 
 Stephan.
 
 
 
 
 
 


Re: [Dovecot] dovecot-lda segfaults with some sieve scripts

2010-09-29 Thread interfaSys sàrl
Hello again,

I've added the -d and -f flags to the command line and this time I got a
trace.

(gdb) r
Starting program: /usr/libexec/dovecot/dovecot-lda -p
example-message.eml -f u...@domain.com -d u...@domain.com
(no debugging symbols found)...(no debugging symbols found)...(no
debugging symbols found)...(no debugging symbols found)...(no debugging
symbols foun.
Program received signal SIGSEGV, Segmentation fault.
0x000800e70140 in seff_flags_merge () from
/usr/lib/dovecot/libdovecot-sieve.so.0
(gdb) bt full
#0  0x000800e70140 in seff_flags_merge () from
/usr/lib/dovecot/libdovecot-sieve.so.0
No symbol table info available.
#1  0x000800e58d61 in sieve_result_side_effects_merge.clone.0 ()
from /usr/lib/dovecot/libdovecot-sieve.so.0
No symbol table info available.
#2  0x000800abf0b0 in ?? ()
No symbol table info available.
#3  0x000800abc040 in ?? ()
No symbol table info available.
#4  0x000800abf0f8 in ?? ()
No symbol table info available.
#5  0x000800ea08e0 in sieve_side_effect_operand_class () from
/usr/lib/dovecot/libdovecot-sieve.so.0
No symbol table info available.
#6  0x000800abc388 in ?? ()
No symbol table info available.
#7  0x000800abc040 in ?? ()
No symbol table info available.
#8  0x000800abc388 in ?? ()
No symbol table info available.
#9  0x7fffe180 in ?? ()
No symbol table info available.
#10 0x000800abf078 in ?? ()
No symbol table info available.
#11 0x000800e58f71 in _sieve_result_add_action () from
/usr/lib/dovecot/libdovecot-sieve.so.0
No symbol table info available.
#12 0x000800e59415 in sieve_result_add_keep () from
/usr/lib/dovecot/libdovecot-sieve.so.0
No symbol table info available.
#13 0x000800e670f3 in cmd_keep_operation_execute () from
/usr/lib/dovecot/libdovecot-sieve.so.0
No symbol table info available.
#14 0x00080005 in ?? ()
No symbol table info available.
#15 0x in ?? ()
No symbol table info available.
#16 0x00080001 in ?? ()
No symbol table info available.
#17 0x000800abf0b0 in ?? ()
No symbol table info available.
#18 0x000800abf040 in ?? ()
No symbol table info available.
#19 0x000800e5542b in sieve_interpreter_continue () from
/usr/lib/dovecot/libdovecot-sieve.so.0
No symbol table info available.
#20 0x000800e555bb in sieve_interpreter_run () from
/usr/lib/dovecot/libdovecot-sieve.so.0
No symbol table info available.
#21 0x000800e6a8f5 in sieve_multiscript_run () from
/usr/lib/dovecot/libdovecot-sieve.so.0
No symbol table info available.
#22 0x in ?? ()
No symbol table info available.
#23 0x000800abf040 in ?? ()
No symbol table info available.
#24 0x0001 in ?? ()
No symbol table info available.
#25 0x0001 in ?? ()
No symbol table info available.
#26 0x0001 in ?? ()
No symbol table info available.
#27 0x000800a06248 in ?? ()
No symbol table info available.
#28 0x0008 in ?? ()
No symbol table info available.
#29 0x000800a23e40 in ?? ()
No symbol table info available.
#30 0x0001 in ?? ()
No symbol table info available.
#31 0x000800515bfb in lda_sieve_deliver_mail () from
/usr/lib/dovecot/lib90_sieve_plugin.so


Cheers,

Olivier

On 29/09/2010 15:01, Stephan Bosch wrote:
  Op 29-9-2010 14:42, interfaSys sàrl schreef:
   Hello,

 One account couldn't get emails all the sudden.
 dovecot-lda was crashing with signal 11 (segmentation fault).
 There was absolutely nothing in the dovecot logs, even with
 mail_debug=yes.

 I found out that it was because of the following lines in a sieve script
 that were generated by a script generator (Ingo).

 if true {
  keep;
  stop;
 }

 I'm using the latest revision of pigeonhole with Dovecot 2.0.4.
 
 Hmm. I cannot reproduce this.
 
 You should:
 
 1) send your dovecot -n output.
 
 2) If you can easily reproduce it: produce a backtrace of the problem
 using gdb:
 
 You can for instance run dovecot-lda manually as follows: gdb --args
 /usr/lib/dovecot-lda -p example-message.eml
 
 And then:
 
 - issue 'r' command
 - (hopefully) see it crash with sigsegfault
 - issue 'bt full' command and report the output back here
 - also include a copy of the full Sieve script that you are using and
 the example message.
 
 You can also use core dumps if the problem is more transient:
 http://www.dovecot.org/bugreport.html
 
 Regards,
 
 Stephan.
 
 
 
 
 
 


Re: [Dovecot] dovecot-lda segfaults with some sieve scripts

2010-09-29 Thread Stephan Bosch

 Op 29-9-2010 17:33, interfaSys sàrl schreef:

Hello again,

I've added the -d and -f flags to the command line and this time I got a
trace.

(gdb) r
Starting program: /usr/libexec/dovecot/dovecot-lda -p
example-message.eml -f u...@domain.com -d u...@domain.com
(no debugging symbols found)...(no debugging symbols found)...(no
debugging symbols found)...(no debugging symbols found)...(no debugging
symbols foun.
Program received signal SIGSEGV, Segmentation fault.
0x000800e70140 in seff_flags_merge () from
/usr/lib/dovecot/libdovecot-sieve.so.0
(gdb) bt full
#0  0x000800e70140 in seff_flags_merge () from


According to this, you have a require imap4flags; somewhere on top of 
your Sieve script right?


Regards,

Stephan.



Re: [Dovecot] dovecot-lda segfaults with some sieve scripts

2010-09-29 Thread Stephan Bosch

 Op 29-9-2010 17:35, Stephan Bosch schreef:

 Op 29-9-2010 17:33, interfaSys sàrl schreef:

(gdb) bt full
#0  0x000800e70140 in seff_flags_merge () from


According to this, you have a require imap4flags; somewhere on top 
of your Sieve script right?


Also, it's apparently running in multiscript context:

#21 0x000800e6a8f5 in sieve_multiscript_run () from
/usr/lib/dovecot/libdovecot-sieve.so.0


Could you send me (not the list necessarily) full versions of all 
involved scripts (including those executed from 
sieve_before/sieve_after) and the output of dovecot -n?


Regards,

Stephan.




Re: [Dovecot] dovecot-lda segfaults with some sieve scripts

2010-09-29 Thread interfaSys sàrl


On 29/09/2010 16:40, Stephan Bosch wrote:
  Op 29-9-2010 17:35, Stephan Bosch schreef:
  Op 29-9-2010 17:33, interfaSys sàrl schreef:
 (gdb) bt full
 #0  0x000800e70140 in seff_flags_merge () from

 According to this, you have a require imap4flags; somewhere on top
 of your Sieve script right?
 

Nope, only fileinto, but the sieve_before script does.

***
require fileinto;

if true {
redirect ofu...@gmail.com;
}

if true {
keep;
stop;
}
***


 Also, it's apparently running in multiscript context:
 #21 0x000800e6a8f5 in sieve_multiscript_run () from
 /usr/lib/dovecot/libdovecot-sieve.so.0
 
Indeed

 Could you send me (not the list necessarily) full versions of all
 involved scripts (including those executed from
 sieve_before/sieve_after) and the output of dovecot -n?
 

There is just one.

**
require [fileinto,imap4flags];

if allof(header :contains X-DSPAM-Result Spam,
 not header :contains X-DSPAM-Reclassified Innocent) {

 setflag \\Seen;
 fileinto INBOX/spam;
 stop;
}

keep;
**


I'll send doveconf -n separately

 Regards,
 
 Stephan.
 
 

Cheers,

Olivier


Re: [Dovecot] dovecot-lda segfaults with some sieve scripts

2010-09-29 Thread Stephan Bosch



Hello again,

I've added the -d and -f flags to the command line and this time I got a
trace.

(gdb) r
Starting program: /usr/libexec/dovecot/dovecot-lda -p
example-message.eml -f u...@domain.com -d u...@domain.com
(no debugging symbols found)...(no debugging symbols found)...(no
debugging symbols found)...(no debugging symbols found)...(no debugging
symbols foun.
Program received signal SIGSEGV, Segmentation fault.
0x000800e70140 in seff_flags_merge () from
/usr/lib/dovecot/libdovecot-sieve.so.0
(gdb) bt full
#0  0x000800e70140 in seff_flags_merge () from
/usr/lib/dovecot/libdovecot-sieve.so.0
No symbol table info available.


Does the attached patch fix it perhaps?

Regards,

Stepha.
diff -r 5cb795d0d1de src/lib-sieve/plugins/imap4flags/tag-flags.c
--- a/src/lib-sieve/plugins/imap4flags/tag-flags.c  Tue Sep 28 22:50:04 
2010 +0200
+++ b/src/lib-sieve/plugins/imap4flags/tag-flags.c  Wed Sep 29 19:09:06 
2010 +0200
@@ -340,7 +340,8 @@
const struct sieve_side_effect *new_seffect,
void **old_context)
 {
-   *old_context = new_seffect-context;
+   if ( new_seffect != NULL )
+   *old_context = new_seffect-context;

return 1;
 }