Re: [Dovecot] dovecot1.2 segfault

2009-02-24 Thread Stephan Bosch

Ian P. Christian wrote:

2009/2/24 Timo Sirainen :

Looks like the POP3 proxying code was just broken. Fixed:
http://hg.dovecot.org/dovecot-1.2/rev/98e1115cd8f0


Timo,  thank you so much for your amazingly fast response - I really
appreciate it.

Stephan, how often does your apt repos re-bundle the source package from RCS?

Every hour.

v1.1 starts building at *:30 and v1.2 starts building at *:50. A build 
takes about 10 minutes on this server.


Regards,

--
Stephan Bosch
step...@rename-it.nl


Re: [Dovecot] dovecot1.2 segfault

2009-02-24 Thread Ian P. Christian
2009/2/24 Timo Sirainen :
> Looks like the POP3 proxying code was just broken. Fixed:
> http://hg.dovecot.org/dovecot-1.2/rev/98e1115cd8f0

Timo,  thank you so much for your amazingly fast response - I really
appreciate it.

Stephan, how often does your apt repos re-bundle the source package from RCS?


Re: [Dovecot] dovecot1.2 segfault

2009-02-24 Thread Timo Sirainen
On Tue, 2009-02-24 at 21:29 +, Ian P. Christian wrote:
> #1  0x00405fdd in proxy_input (input=0x6533a0,
> output=0x653528, client=0x64e790) at pop3-proxy.c:210
> line = 0x6271b8 "?qb"
> __PRETTY_FUNCTION__ = "proxy_input"

Looks like the POP3 proxying code was just broken. Fixed:
http://hg.dovecot.org/dovecot-1.2/rev/98e1115cd8f0



signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] dovecot1.2 segfault

2009-02-24 Thread Ian P. Christian
Hope this helps Timo, thanks! Hope I'm not doing anything stupid ;)

(gdb) cont
Continuing.

Program received signal SIGSEGV, Segmentation fault.
i_stream_next_line (stream=0x6533a0) at istream.c:248
248 istream.c: No such file or directory.
in istream.c
(gdb) bt full
#0  i_stream_next_line (stream=0x6533a0) at istream.c:248
_stream = (struct istream_private *) 0x0
ret_buf = 
i = 
#1  0x00405fdd in proxy_input (input=0x6533a0,
output=0x653528, client=0x64e790) at pop3-proxy.c:210
line = 0x6271b8 "?qb"
__PRETTY_FUNCTION__ = "proxy_input"
#2  0x00411d5b in io_loop_handler_run (ioloop=) at ioloop-epoll.c:202
ctx = (struct ioloop_handler_context *) 0x64a050
event = (const struct epoll_event *) 0x64cd40
list = (struct io_list *) 0x6532f0
io = (struct io_file *) 0x64fe30
tv = {tv_sec = 179, tv_usec = 952746}
t_id = 2
msecs = 
ret = 1
call = 
#3  0x004111e8 in io_loop_run (ioloop=0x64bf00) at ioloop.c:338
No locals.
#4  0x00407c57 in main (argc=1, argv=0x7fff20ba3748,
envp=0x7fff20ba3758) at main.c:481
group_name = 
remote_ip = {family = 18656, u = {ip6 = {in6_u = {u6_addr8 =
":+\000\000\220?A\000\000\000\000\000\000\000\000", u6_addr16 =
{11066, 0, 48016, 65, 0, 0, 0, 0},
u6_addr32 = {11066, 4307856, 0, 0}}}, ip4 = {s_addr = 11066}}}
local_ip = {family = 1, u = {ip6 = {in6_u = {u6_addr8 =
":+\000\000\000\000\000\000\000\000\000\000\001\000\000", u6_addr16 =
{11066, 0, 0, 0, 0, 0, 1, 0},
u6_addr32 = {11066, 0, 0, 1}}}, ip4 = {s_addr = 11066}}}
remote_port = 0
local_port = 0
max_fds = 532
proxy = (struct ssl_proxy *) 0x0
client = (struct client *) 0x0
i = 11066
fd = 532
master_fd = -1
ssl = 


Re: [Dovecot] dovecot1.2 segfault

2009-02-24 Thread Stephan Bosch

Timo Sirainen schreef:

On Tue, 2009-02-24 at 16:14 +, Ian P. Christian wrote:


Feb 24 16:06:07 proxy kernel: pop3-login[6825]: segfault at
0128 rip 004107b5 rsp 7fff77bb6520 error 4
Feb 24 16:06:07 proxy dovecot: child 6825 (login) killed with signal
11 (ip=127.0.1.34)


You can reproduce this always? If so, could you get a gdb backtrace?


login_processes_count: 10


Set this to 1. Then start dovecot. You'll see one pop3-login process.
Attach gdb to it:

gdb -p 
cont

bt full

And paste the output.
Oh and make sure you have debug symbols enabled. The Debian package 
strips those by default. Set the environment variable:


DEB_BUILD_OPTIONS=nostrip

And (re-)build your package.

Regards,

--
Stephan Bosch
step...@rename-it.nl


Re: [Dovecot] dovecot1.2 segfault

2009-02-24 Thread Timo Sirainen
On Tue, 2009-02-24 at 16:14 +, Ian P. Christian wrote:

> Feb 24 16:06:07 proxy kernel: pop3-login[6825]: segfault at
> 0128 rip 004107b5 rsp 7fff77bb6520 error 4
> Feb 24 16:06:07 proxy dovecot: child 6825 (login) killed with signal
> 11 (ip=127.0.1.34)

You can reproduce this always? If so, could you get a gdb backtrace?

> login_processes_count: 10

Set this to 1. Then start dovecot. You'll see one pop3-login process.
Attach gdb to it:

gdb -p 
cont

bt full

And paste the output.



signature.asc
Description: This is a digitally signed message part


[Dovecot] dovecot1.2 segfault

2009-02-24 Thread Ian P. Christian
I've tried 2 builds of dovecot, based on a amd64 rebuild of the
experimental package  on http://xi.rename-it.nl/debian/

I've tried to include as much useful info as possible, sorry if I've
missed out anything of use.  Let me know as I'm more then happy to
assist in any way possible.


$ telnet host 110
Escape character is '^]'.
+OK Dovecot ready.
USER i...@domain.com
+OK
PASS ...
+OK Logged in.
Connection closed by foreign host.


in the logs:
Feb 24 16:06:07 proxy dovecot: auth(default): client in:
AUTH#0111#011PLAIN#011service=pop3#011lip=127.0.11.155#011rip=127.0.1.34#011lport=110#011rport=57834#011resp=
Feb 24 16:06:07 proxy dovecot: auth(default):
cache(i...@domain.com,127.0.1.34): miss
Feb 24 16:06:07 proxy dovecot: auth-worker(default):
sql(i...@domain.com,127.0.1.34): query: SELECT password, password as
pass, home_server as host, 'i...@domain.com' AS destuser, 'Y' AS
nologin, 'Y' AS nodelay, 'Y' AS proxy, null AS nopassword FROM
mail_user WHERE ( (username = 'ian' AND domain = 'timico.net') OR
(username = 'i...@domain.com' AND domain = '') ) AND IF('pop3' =
'pop3', allow_pop3, true) = true AND IF('imap' = 'pop3', allow_imap,
true) = true AND active = true LIMIT 1
Feb 24 16:06:07 proxy dovecot: auth(default): client out:
ok#0111#011user=...@domain.com#011pass=#011host=127.0.11.106#011destuser=...@domain.com#011nologin#011proxy
Feb 24 16:06:07 proxy dovecot: pop3-login: proxy(i...@domain.com):
started proxying to 127.0.11.106:110: user=,
method=PLAIN, rip=127.0.1.34, lip=127.0.11.155
Feb 24 16:06:07 proxy dovecot: auth(default): new auth connection: pid=6825
Feb 24 16:06:07 proxy kernel: pop3-login[6825]: segfault at
0128 rip 004107b5 rsp 7fff77bb6520 error 4
Feb 24 16:06:07 proxy dovecot: child 6825 (login) killed with signal
11 (ip=127.0.1.34)

# dovecot -n
# 1.2.beta1: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.18-6-xen-amd64 x86_64 Debian 5.0
syslog_facility: local5
protocols: managesieve imap imaps pop3 pop3s
disable_plaintext_auth: no
login_dir: /var/run/dovecot/login
login_executable(default): /usr/lib/dovecot/imap-login
login_executable(imap): /usr/lib/dovecot/imap-login
login_executable(pop3): /usr/lib/dovecot/pop3-login
login_executable(managesieve): /usr/lib/dovecot/managesieve-login
login_process_per_connection: no
login_processes_count: 10
mail_max_userip_connections(default): 35
mail_max_userip_connections(imap): 35
mail_max_userip_connections(pop3): 10
mail_max_userip_connections(managesieve): 10
mail_executable(default): /usr/lib/dovecot/imap
mail_executable(imap): /usr/lib/dovecot/imap
mail_executable(pop3): /usr/lib/dovecot/pop3
mail_executable(managesieve): /usr/lib/dovecot/managesieve
mail_plugins(default): quota imap_quota
mail_plugins(imap): quota imap_quota
mail_plugins(pop3):
mail_plugins(managesieve):
mail_plugin_dir(default): /usr/lib/dovecot/modules/imap
mail_plugin_dir(imap): /usr/lib/dovecot/modules/imap
mail_plugin_dir(pop3): /usr/lib/dovecot/modules/pop3
mail_plugin_dir(managesieve): /usr/lib/dovecot/modules/managesieve
auth default:
  mechanisms: plain cram-md5 digest-md5 login ntlm
  cache_size: 4096
  cache_ttl: 7200
  user: nobody
  verbose: yes
  debug: yes
  passdb:
driver: sql
args: /etc/dovecot/dovecot-sql.conf
  userdb:
driver: static
args: static uid=mail gid=mail home=/dev/null

# cat /etc/dovecot/dovecot-sql.conf
driver = mysql

connect = host=127.0.0.1 dbname=mail user=exim password=..

default_pass_scheme = plain

password_query = \
  SELECT \
  password, password as pass, home_server as host, '%u' AS
destuser, 'Y' AS nologin, 'Y' AS nodelay, 'Y' AS proxy, null AS
nopassword \
  FROM mail_user \
  WHERE ( \
(username = '%n' AND domain = '%d') OR \
(username = '%u' AND domain = '') \
  ) \
  AND IF('pop3' = '%s', allow_pop3, true) = true \
  AND IF('imap' = '%s', allow_imap, true) = true \
  AND active = true \
  LIMIT 1


$ strace -f dovecot -F
[pid  6771] <... epoll_wait resumed> {{EPOLLIN, {u32=6613264,
u64=6613264}}}, 6, 18) = 1
[pid  6771] gettimeofday({1235491268, 481726}, {0, 0}) = 0
[pid  6771] read(10, "PASS Yast7310\r\n"..., 4075) = 15
[pid  6771] gettimeofday({1235491268, 482089}, NULL) = 0
[pid  6771] write(11, "AUTH\t1\tPLAIN\tservice=pop3\tlip=62."..., 120

[pid  6759] <... epoll_wait resumed> {{EPOLLIN, {u32=6850224,
u64=6850224}}}, 34, 5000) = 1
[pid  6771] <... write resumed> )   = 120
[pid  6759] gettimeofday( 
[pid  6771] epoll_ctl(9, EPOLL_CTL_DEL, 10, {0, {u32=6613264,
u64=6613264}} 
[pid  6759] <... gettimeofday resumed> {1235491268, 482588}, {0, 0}) = 0
[pid  6771] <... epoll_ctl resumed> )   = 0
[pid  6759] read(19,  
[pid  6771] gettimeofday( 
[pid  6759] <... read resumed>
"AUTH\t1\tPLAIN\tservice=pop3\tlip=62."..., 4074) = 120
[pid  6771] <... gettimeofday resumed> {1235491268, 482873}, NULL) = 0
[pid  6759] write(2, "\1Iclient in: AUTH\t1\tPLAIN\tservice"..., 109

[pid  6771] epoll_wait(9,  
[pid  6756] <... epoll_wait resumed> {{E