On Wed Apr 23, 2003 at 15:13:27 +0300, Timo Sirainen wrote:
Yes, I'd like to know why it crashes. I've tried to prevent that everywhere. Two ways to do this:
Program received signal SIGSEGV, Segmentation fault. 0xd017f528 in memset () from /usr/lib/libc.a(shr.o) (gdb) bt #0 0xd017f528 in memset () from /usr/lib/libc.a(shr.o) #1 0x1001e5a4 in mail_index_init_header (index=0x2000ef58, hdr=0xffffffff) at mail-index-open.c:231 #2 0x1001e820 in mail_index_create_memory (index=0x2000ef58, flags=19) at mail-index-open.c:289 #3 0x1001ec24 in mail_index_open (index=0x2000ef58, flags=3) at mail-index-open.c:411 #4 0x1000ded0 in index_storage_init (storage=0x200096a8, box=0x20000cb0, index=0x2000ef58, name=0x10065ae8 "INBOX", readonly=0, fast=0) at index-storage.c:259 #5 0x100401e0 in mbox_open (storage=0x200096a8, name=0x10065ae8 "INBOX", readonly=0, fast=0) at mbox-storage.c:360 #6 0x100402f0 in mbox_open_mailbox (storage=0x200096a8, name=0x20009a78 "inbox", readonly=0, fast=0) at mbox-storage.c:380 #7 0x1004e23c in _cmd_select_full (client=0x200097a8, readonly=0) at cmd-select.c:23 #8 0x1004e4c4 in cmd_select (client=0xffffffff) at cmd-select.c:87 #9 0x1004b9ec in client_handle_input (client=0x200097a8) at client.c:306 #10 0x1004bb5c in _client_input (context=0x200097a8) at client.c:342 #11 0x10001ec0 in io_loop_handler_run (ioloop=0x20008fe8) at ioloop-poll.c:212 #12 0x1000148c in io_loop_run (ioloop=0x20008fe8) at ioloop.c:295 #13 0x10000964 in main (argc=-1, argv=0x20004de4, envp=0x2ff22b80) at main.c:166 ---Type <return> to continue, or q <return> to quit--- #14 0x100001dc in __start () (gdb)
The problem seems to be that
index->mmap_base = mmap_anon(index->mmap_full_length);
in lib-index/mail-index-open.c(287) returns -1 (MAP_FAILED) which is then fed to mail_index_init_header(..., 0xffffffff) without being checked.
The mmap in anon_mmap_fixed in lib/mmap-anon.c returns "Not enough space" in errno. The parameter values are "address=0x00002000 length=0x00002000".
Adam
Adam adam@os.inf.tu-dresden.de Lackorzynski http://os.inf.tu-dresden.de/~adam/