Op 20-11-2019 om 8:50 schreef Jens Rey via dovecot:
Hi,
You can attach GDB to imap with follow-fork-mode set to 'child', so you can maybe see what causes the segfault.
now I am confused. Hopefully, I used GDB correctly, but as far as I can see, everything seemed to work.
The only difference I can see is that I executed the whole thing as root, but I would hope doveadm uses the correct user (vmail). At least on the file system all emails still belong to vmail, so I guess that works.
For a quick reference, here is what I executed:
root@mail:~# gdb --args doveadm exec imap -u user@domain ... (gdb) set follow-fork-mode child (gdb) r . SELECT Spam . MOVE 1 Inbox
And the (imho) relevant output:
imap(user@domain)<13290><+PcoBrjs1F3qMwAAcD3JoA>: Debug: program exec:/usr/lib/dovecot/sieve/rspamd-learn-ham.sh: Establishing connection [New process 13335] imap(user@domain)<13290><+PcoBrjs1F3qMwAAcD3JoA>: Debug: program exec:/usr/lib/dovecot/sieve/rspamd-learn-ham.sh: Forked child process imap(user@domain)<13290><+PcoBrjs1F3qMwAAcD3JoA>: Debug: program exec:/usr/lib/dovecot/sieve/rspamd-learn-ham.sh (13335): Connected to program [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". process 13335 is executing new program: /bin/dash process 13335 is executing new program: /usr/bin/rspamc [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7fffee7ff700 (LWP 13338)] [New Thread 0x7fffebffe700 (LWP 13339)] [New Thread 0x7fffe97fd700 (LWP 13340)] imap(user@domain)<13290><+PcoBrjs1F3qMwAAcD3JoA>: Debug: program exec:/usr/lib/dovecot/sieve/rspamd-learn-ham.sh (13335): Finished streaming payload to program imap(user@domain)<13290><+PcoBrjs1F3qMwAAcD3JoA>: Debug: program exec:/usr/lib/dovecot/sieve/rspamd-learn-ham.sh (13335): Finished input to program imap(user@domain)<13290><+PcoBrjs1F3qMwAAcD3JoA>: Debug: program exec:/usr/lib/dovecot/sieve/rspamd-learn-ham.sh (13335): Disconnected imap(user@domain)<13290><+PcoBrjs1F3qMwAAcD3JoA>: Debug: program exec:/usr/lib/dovecot/sieve/rspamd-learn-ham.sh (13335): Waiting for program to finish after 886 msecs [Thread 0x7fffe97fd700 (LWP 13340) exited] [Thread 0x7fffebffe700 (LWP 13339) exited] [Thread 0x7ffff7fd1140 (LWP 13335) exited] [Inferior 2 (process 13335) exited normally] imap(user@domain)<13290><+PcoBrjs1F3qMwAAcD3JoA>: Debug: program exec:/usr/lib/dovecot/sieve/rspamd-learn-ham.sh (13335): Child process ended imap(user@domain)<13290><+PcoBrjs1F3qMwAAcD3JoA>: Debug: program exec:/usr/lib/dovecot/sieve/rspamd-learn-ham.sh (13335): Destroy imap(user@domain)<13290><+PcoBrjs1F3qMwAAcD3JoA>: Info: sieve: pipe action: piped message to program `rspamd-learn-ham.sh'
There is more output, lots more, but we are talking about spam after all... If it is needed, please say so and I will provide it.
Hmm, so now it suddenly works. So, why would it not fail when run in GDB?
Regards, Jens