• Bug#265054: Difficulties (and segfaults) in setting up mairix (1/2)

    From Enrico Zini@1:229/2 to All on Wed Aug 11 17:20:07 2004
    From: [email protected]

    Package: mairix
    Version: 0.14-1
    Severity: normal

    Hello,

    I'm having difficulties setting up mairix. This is my .mairixrc file:

    base=/home/enrico/Maildir
    maildir=...
    mfolder=mairix
    mformat=maildir
    database=/home/enrico/.mairix_database

    I now run mairix:

    $ mairix -v -o ~/Maildir/.mairix-debtags debtags
    mairix V0.14, Copyright (C) 2002-2004 Richard P. Curnow
    mairix comes with ABSOLUTELY NO WARRANTY.
    This is free software, and you are welcome to redistribute it
    under certain conditions; see the GNU General Public License for
    details.

    open: No such file or directory
    $

    Strace says that it can't open /home/enrico/.mairix_database . I do it
    and:

    $ touch /home/enrico/.mairix_database
    $ mairix -v -o ~/Maildir/.mairix-debtags debtags
    mairix V0.14, Copyright (C) 2002-2004 Richard P. Curnow
    mairix comes with ABSOLUTELY NO WARRANTY.
    This is free software, and you are welcome to redistribute it
    under certain conditions; see the GNU General Public License for
    details.

    Segmentation fault
    $

    The stack trace is not that helpful:

    (gdb) where
    #0 0x08052cf3 in ?? ()
    #1 0x000041c0 in ?? ()
    #2 0x00000002 in ?? ()
    #3 0x000003e8 in ?? ()
    #4 0x0805d9c8 in ?? ()
    #5 0x00000707 in ?? ()
    #6 0x00000000 in ?? ()
    #7 0x40010000 in realloc () from /lib/ld-linux.so.2
    #8 0x0805413e in ?? ()
    #9 0x00000000 in ?? ()
    #10 0xbffff974 in ?? ()
    #11 0x0805d6b8 in ?? ()
    #12 0x00000000 in ?? ()
    #13 0x00000000 in ?? ()
    #14 0x00000001 in ?? ()
    #15 0x00000000 in ?? ()
    #16 0x0805d820 in ?? ()
    #17 0x00000001 in ?? ()
    #18 0x08057e68 in _IO_stdin_used ()
    #19 0xbffff8d8 in ?? ()
    #20 0x08049e09 in ?? ()
    #21 0x00000000 in ?? ()
    #22 0x00000000 in ?? ()
    #23 0x0805d870 in ?? ()
    #24 0x0805d820 in ?? ()
    #25 0xbffffabe in ?? ()
    #26 0xbffff974 in ?? ()
    #27 0x00000000 in ?? ()
    #28 0x00000001 in ?? ()
    #29 0x00000000 in ?? ()
    #30 0x0805aed4 in ?? ()
    #31 0xbffff8b8 in ?? ()
    #32 0x00000000 in ?? ()
    #33 0x00000000 in ?? ()
    #34 0x00000000 in ?? ()
    #35 0x00000001 in ?? ()
    #36 0x00000000 in ?? ()
    #37 0x00000000 in ?? ()
    #38 0xbffffabe in ?? ()
    #39 0x00000000 in ?? ()
    #40 0x4015fd34 in ?? () from /lib/tls/i686/cmov/libc.so.6
    #41 0xbffff97c in ?? ()
    #42 0x40161010 in timezone () from /lib/tls/i686/cmov/libc.so.6
    #43 0xbffff964 in ?? ()
    #44 0x4003e7da in __libc_start_main () from /lib/tls/i686/cmov/libc.so.6
    #45 0x4015fd34 in ?? () from /lib/tls/i686/cmov/libc.so.6

    This is strace output:

    execve("/usr/bin/mairix", ["mairix", "-v", "-o", "/home/enrico/Maildir/.mairix-debtags", "debtags"], [/* 32 vars */]) = 0
    uname({sys="Linux", node="mitac", ...}) = 0
    brk(0) = 0x805c000
    old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40017000
    access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or directory) open("/etc/ld.so.cache", O_RDONLY) = 3
    fstat64(3, {st_mode=S_IFREG|0644, st_size=66125, ...}) = 0
    old_mmap(NULL, 66125, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40018000
    close(3) = 0
    access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/tls/i686/cmov/libc.so.6", O_RDONLY) = 3
    read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\300X\1"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0644, st_size=1278660, ...}) = 0
    old_mmap(NULL, 1284876, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40029000 old_mmap(0x40158000, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x12f000) = 0x40158000
    old_mmap(0x40160000, 11020, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40160000
    close(3) = 0
    old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40163000
    set_thread_area({entry_number:-1 -> 6, base_addr:0x401632a0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
    munmap(0x40018000, 66125) = 0
    write(2, "mairix V0.14, Copyright (C) 2002"..., 235) = 235
    getuid32() = 1000
    brk(0) = 0x805c000
    brk(0x807d000) = 0x807d000
    brk(0) = 0x807d000
    socket(PF_FILE, SOCK_STREAM, 0) = 3
    connect(3, {sa_family=AF_FILE, path="/var/run/.nscd_socket"}, 110) = -1 ENOENT (No such file or directory)
    close(3) = 0
    open("/etc/nsswitch.conf", O_RDONLY) = 3
    fstat64(3, {st_mode=S_IFREG|0644, st_size=465, ...}) = 0
    mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40018000
    read(3, "# /etc/nsswitch.conf\n#\n# Example"..., 4096) = 465
    read(3, "", 4096) = 0
    close(3) = 0
    munmap(0x40018000, 4096) = 0
    open("/etc/ld.so.cache", O_RDONLY) = 3
    fstat64(3, {st_mode=S_IFREG|0644, st_size=66125, ...}) = 0
    old_mmap(NULL, 66125, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40018000
    close(3) = 0
    access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/tls/i686/cmov/libnss_compat.so.2", O_RDONLY) = 3
    read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200\20"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0644, st_size=29744, ...}) = 0
    old_mmap(NULL, 32756, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x40164000 old_mmap(0x4016b000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x6000) = 0x4016b000
    close(3) = 0
    access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/tls/i686/cmov/libnsl.so.1", O_RDONLY) = 3
    read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\3209\0"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0644, st_size=74456, ...}) = 0
    old_mmap(NULL, 85792, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x4016c000 old_mmap(0x4017e000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x11000) = 0x4017e000
    old_mmap(0x4017f000, 7968, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4017f000
    close(3) = 0
    munmap(0x40018000, 66125) = 0
    open("/etc/ld.so.cache", O_RDONLY) = 3
    fstat64(3, {st_mode=S_IFREG|0644, st_size=66125, ...}) = 0

    [continued in next message]

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)
  • From Kevin Rosenberg@1:229/2 to Enrico Zini on Wed Aug 11 21:40:07 2004
    From: [email protected]

    Enrico Zini wrote:
    $ touch /home/enrico/.mairix_database

    From the segv below, I imagine that it is an error for mairix to have
    a zero-length database file. I don't think the stack trace is
    important. What is important is that you should not create the
    database yourself.

    By the way, I uploaded a major new release of mairix yesterday. You
    may want to try that version after you delete the ~/.mairix_database
    file you created.

    As for your configuration file, I don't know if it is correct or
    not. I did find it unusual that you set your maildir to '...'. What is
    that supposed to mean?

    If you have questions about correctly setting you your configuration
    file, you may want to directly email the upstream author.

    Kevin


    --
    To UNSUBSCRIBE, email to [email protected]
    with a subject of "unsubscribe". Trouble? Contact [email protected]

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)
  • From Enrico Zini@1:229/2 to Kevin Rosenberg on Thu Aug 12 12:00:17 2004
    From: [email protected]

    On Wed, Aug 11, 2004 at 01:09:22PM -0600, Kevin Rosenberg wrote:

    $ touch /home/enrico/.mairix_database
    From the segv below, I imagine that it is an error for mairix to have
    a zero-length database file. I don't think the stack trace is
    important. What is important is that you should not create the
    database yourself.

    Oh, I see. I was lead in doing that by the "open failed" message.
    Now that I understand the situation, I really suggest that if mairix
    doesn't find the database, instead of saying "open failed" it should
    say "Please run mairix with no arguments to create the index." and, why
    not, if isatty(1), also a "Do you want to generate the index now (it may
    take a long while)? [Y/n]".


    By the way, I uploaded a major new release of mairix yesterday. You
    may want to try that version after you delete the ~/.mairix_database
    file you created.

    I've run "mairix" with no arguments and it generated the index for me.
    Then I noticed that the manpage doesn't tell how to run mairix in index
    mode, it just tells you that you can.

    Also, the manpage doesn't document the -o switch.


    As for your configuration file, I don't know if it is correct or
    not. I did find it unusual that you set your maildir to '...'. What is
    that supposed to mean?

    It means "index all the mailboxes". It works, and it's a quite obvious
    thing to do, although it's never mentioned in any of the examples and
    it's not obvious to come up with that.


    If you have questions about correctly setting you your configuration
    file, you may want to directly email the upstream author.

    Sure, thanks. This getting started with mairix has been quite a source
    of suggestions for small improvements. I'll Cc upstream with this
    message, then.

    Another thing that I can't find out how to do is how to index all
    folders BUT some. For example, I'd like to index all folders except
    sent-mail and mairix-*, possibly without having to alter my folder
    naming scheme or moving sent-mail and mairix search folders in another directory, or I get crazy finding them with mutt.


    Ciao,

    Enrico

    --
    GPG key: 1024D/797EBFAB 2000-12-05 Enrico Zini <[email protected]>

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.5 (GNU/Linux)

    iD8DBQFBGzmW9LSwzHl+v6sRAoGkAJ9EBDmFfOjBrgIbEUQlYxTOJC71JQCfeX/e DzSDwIbvomzCQSq4IMpJsTY=
    =iCda
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)
  • From Richard Curnow@1:229/2 to Enrico Zini on Wed Aug 18 01:30:12 2004
    From: [email protected]

    Hi Enrico,

    On Thu, Aug 12, 2004 at 10:34:14AM +0100, Enrico Zini wrote:

    Oh, I see. I was lead in doing that by the "open failed" message.
    Now that I understand the situation, I really suggest that if mairix
    doesn't find the database, instead of saying "open failed" it should
    say "Please run mairix with no arguments to create the index." and,
    why not, if isatty(1), also a "Do you want to generate the index now
    (it may take a long while)? [Y/n]".

    It's fair to say that there isn't really much checking of the database
    file at all. It would be hard (and slow) to guard against all possible
    forms of corruption. I took the view that if somebody messes with the
    file and expects mairix to handle it, they get what comes to them.

    In the case of a missing db file, it would certainly be better to have a
    more helpful message, as you suggest.

    I've run "mairix" with no arguments and it generated the index for me.
    Then I noticed that the manpage doesn't tell how to run mairix in index
    mode, it just tells you that you can.

    Also, the manpage doesn't document the -o switch.

    The manpage is not kept up to date like the texi file. I used to rely
    on other people sending in patches for the manpage. (I don't like
    manpage format so I tend to avoid dealing with it.)

    I guess the easiest thing to do is to add a statement to the top of the
    manpage that it may be out of date compared to the texi file.

    As for your configuration file, I don't know if it is correct or
    not. I did find it unusual that you set your maildir to '...'. What is
    that supposed to mean?

    It means "index all the mailboxes". It works, and it's a quite obvious
    thing to do, although it's never mentioned in any of the examples and
    it's not obvious to come up with that.

    I'll see if I can add this to the manual as it's certainly a useful
    trick.

    Another thing that I can't find out how to do is how to index all
    folders BUT some. For example, I'd like to index all folders except sent-mail and mairix-*, possibly without having to alter my folder
    naming scheme or moving sent-mail and mairix search folders in another directory, or I get crazy finding them with mutt.

    Yes, I hoped to get around to adding this sometime. When I added the
    globbing support to the folder specification stuff, I intended this kind
    of thing to be possible sometime. I've never got round to working out
    the details of what's really needed though.

    Cheers
    Richard

    --
    Richard P. Curnow | Free software developer
    Weston-super-Mare |
    United Kingdom | http://www.rc0.org.uk/


    --
    To UNSUBSCRIBE, email to [email protected]
    with a subject of "unsubscribe". Trouble? Contact [email protected]

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)