segfaults when executing quota command
Craig White
craigwhite at azapple.com
Thu Apr 14 03:33:21 EDT 2005
On Mon, 2005-04-11 at 23:37 -0400, Derrick J Brashear wrote:
> On Mon, 11 Apr 2005, Craig White wrote:
>
> >>> thanks - I know not of these things - appreciate your patience with me.
> >>>
> >>> (gdb) where
> >>> #0 0x00be1513 in _int_realloc () from /lib/tls/libc.so.6
> >>> #1 0x00be0156 in realloc () from /lib/tls/libc.so.6
> >>> #2 0x00c1b586 in glob_in_dir () from /lib/tls/libc.so.6
> >>> #3 0x00c1a7fc in glob () from /lib/tls/libc.so.6
> >>> #4 0x0808328e in mboxlist_findsub_alt ()
> >>> #5 0x0804baa0 in ?? ()
> >>> #6 0x0811b1e8 in ?? ()
> >>> #7 0xbfff8580 in ?? ()
> >>> #8 0x00000000 in ?? ()
> >>>
> >>> indeed, it was not the only stack. There was no rest of the backtrace
> >>> unless you are asking for the stuff that came 'before' I executed '(gdb)
> >>> run -f' which I didn't include because I didn't think that it had
> >>> meaningful information but for completeness...
> >>
> >> no, you answered what i wanted to know, above. I need to look at the regex
> >> code in mboxlist_findsub_alt
> > ----
> > any progress here?
>
> Not especially. Having symbols would help. It's going to be something in
> foreach() in lib/cyrusdb_quotalegacy.c, though, since that's the only
> place you'd be using the system glob().
>
> I suppose, for simplicity, you can just add a
>
> printf("%s\n", quota_path);
>
> before and after
> /* strip off the qr specific path and replace with pattern */
> sprintf(strstr(quota_path, FNAME_QUOTADIR) + strlen(FNAME_QUOTADIR),
> "?/%s*", prefix);
>
> And see what 2 lines you get just before the crash, as a way of cheating.
----
OK - here's the cheating...
# su - cyrus -c 'gdb /usr/lib/cyrus-imapd/quota'
cyrus at AZAPPLE.COM's Password:
su: krb5_verify_user: Client (cyrus at AZAPPLE.COM) unknown
GNU gdb Red Hat Linux (6.1post-1.20040607.52rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you
are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for
details.
This GDB was configured as "i386-redhat-linux-gnu"...Using host
libthread_db library "/lib/tls/libthread_db.so.1".
(gdb) run -f
Starting program: /usr/lib/cyrus-imapd/quota -f
[Thread debugging using libthread_db enabled]
[New Thread -1218568064 (LWP 23872)]
/var/lib/imap/quota/q/
/var/lib/imap/quota/?/*
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1218568064 (LWP 23872)]
0x00a86513 in _int_realloc () from /lib/tls/libc.so.6
(gdb) where
#0 0x00a86513 in _int_realloc () from /lib/tls/libc.so.6
#1 0x00a85156 in realloc () from /lib/tls/libc.so.6
#2 0x00ac0586 in glob_in_dir () from /lib/tls/libc.so.6
#3 0x00abf7fc in glob () from /lib/tls/libc.so.6
#4 0x0808327a in foreach (db=0x9836178, prefix=0xbfffb160 "",
prefixlen=0, goodp=0x804b7c0 <find_p>, cb=0x804b880 <find_cb>,
rock=0xbfffb158, tid=0x0)
at cyrusdb_quotalegacy.c:503
#5 0x0804baa0 in buildquotalist (domain=0x0, roots=0xbfffb43c,
nroots=0) at quota.c:291
#6 0x0804b6d7 in main (argc=2, argv=0xbfffb434) at quota.c:187
(gdb)
so in answer to your question...the two lines were
/var/lib/imap/quota/q/
/var/lib/imap/quota/?/*
# ls -l /var/lib/imap/quota/
total 28
drwx------ 2 cyrus mail 4096 Apr 11 00:00 a
drwx------ 2 cyrus mail 4096 Feb 27 07:56 b
drwx------ 2 cyrus mail 4096 Apr 14 00:30 c
drwx------ 2 cyrus mail 4096 Feb 20 12:01 h
drwx------ 2 cyrus mail 4096 Feb 20 12:01 j
drwx------ 2 cyrus mail 4096 Feb 27 07:03 p
drwx------ 2 cyrus mail 4096 Mar 23 16:33 t
I don't have a 'q' or '?' directory
Craig
---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
More information about the Info-cyrus
mailing list