Mailing List Archive

[Bug 2343] exim_tidydb eats infinite memory
https://bugs.exim.org/show_bug.cgi?id=2343

David Woodhouse <dwmw2@infradead.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
CC| |dwmw2@infradead.org
Resolution|WORKSFORME |---

--- Comment #2 from David Woodhouse <dwmw2@infradead.org> ---
# db_dump wait-remote_smtp
VERSION=3
format=bytevalue
type=hash
db_pagesize=4096
HEADER=END
6f73672e73616d73756e672e636f6d00
93d7ea5f0100000000000000316b753942782d3030303236412d524b00000000
DATA=END

--
You are receiving this mail because:
You are on the CC list for the bug.
--
## List details at https://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 2343] exim_tidydb eats infinite memory [ In reply to ]
https://bugs.exim.org/show_bug.cgi?id=2343

--- Comment #3 from David Woodhouse <dwmw2@infradead.org> ---
I didn't delete mine; I kept a copy.

First I tried recreating the actual database file:
mkdir old
mv wait-remote.smtp old
db_dump old/wait-remote.smtp | dbload wait-remote.smtp


That doesn't fix it; I even managed to reproduce the problem by creating the
database in /tmp/db (from the same dump) on a different machine.

--
You are receiving this mail because:
You are on the CC list for the bug.
--
## List details at https://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 2343] exim_tidydb eats infinite memory [ In reply to ]
https://bugs.exim.org/show_bug.cgi?id=2343

--- Comment #4 from Jeremy Harris <jgh146exb@wizmail.org> ---
Assuming comment 2 is a dump of a failing db - works ok for me:

[eximtest@lap test]$ db_dump db/misc
VERSION=3
format=bytevalue
type=hash
db_pagesize=4096
HEADER=END
6f73672e73616d73756e672e636f6d00
93d7ea5f0100000000000000316b753942782d3030303236412d524b00000000
DATA=END
[eximtest@lap test]$ eximdir/exim_dumpdb `pwd` misc
04-Feb-2157 13:43:47 osg.samsung.com
[eximtest@lap test]$ time strace ../src/build-Linux-x86_64/exim_tidydb `pwd`
misc 2> jghlog
Tidying Exim hints database /home/jgh/git/exim/test/db/misc
Tidying complete

real 0m0.012s
user 0m0.006s
sys 0m0.006s
[eximtest@lap test]$ tail -40 jghlog
set_robust_list(0x7f2a1fd4d460, 24) = 0
rt_sigaction(SIGRTMIN, {sa_handler=0x7f2a1fd55c00, sa_mask=[],
sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x7f2a1fd62a90}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {sa_handler=0x7f2a1fd55ca0, sa_mask=[],
sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f2a1fd62a90}, NULL,
8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024,
rlim_max=RLIM64_INFINITY}) = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0x2), ...}) = 0
brk(NULL) = 0x206c000
brk(0x208d000) = 0x208d000
brk(NULL) = 0x208d000
write(1, "Tidying Exim hints database /hom"..., 60) = 60
openat(AT_FDCWD, "/home/jgh/git/exim/test/db/misc.lockfile", O_RDWR) = 3
rt_sigaction(SIGALRM, {sa_handler=0x402346, sa_mask=[], sa_flags=SA_RESTORER,
sa_restorer=0x7f2a1fdaca70}, NULL, 8) = 0
alarm(60) = 0
fcntl(3, F_SETLKW, {l_type=F_WRLCK, l_whence=SEEK_SET, l_start=0, l_len=0}) = 0
alarm(0) = 60
getpid() = 5594
openat(AT_FDCWD, "/sys/devices/system/cpu/online", O_RDONLY|O_CLOEXEC) = 4
read(4, "0-3\n", 8192) = 4
close(4) = 0
openat(AT_FDCWD, "/home/jgh/git/exim/test/db/DB_CONFIG", O_RDONLY) = -1 ENOENT
(No such file or directory)
stat("/var/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=4096, ...}) = 0
stat("/lib64/libpthread.so.0", {st_mode=S_IFREG|0755, st_size=317728, ...}) = 0
stat("/home/jgh/git/exim/test/db/misc", {st_mode=S_IFREG|0644, st_size=12288,
...}) = 0
openat(AT_FDCWD, "/home/jgh/git/exim/test/db/misc", O_RDWR) = 4
fcntl(4, F_GETFD) = 0
fcntl(4, F_SETFD, FD_CLOEXEC) = 0
read(4,
"\0\0\0\0\1\0\0\0\0\0\0\0a\25\6\0\t\0\0\0\0\20\0\0\0\10\0\0\0\0\0\0"..., 512) =
512
close(4) = 0
openat(AT_FDCWD, "/home/jgh/git/exim/test/db/misc", O_RDWR|O_CREAT, 000) = 4
fcntl(4, F_GETFD) = 0
fcntl(4, F_SETFD, FD_CLOEXEC) = 0
fstat(4, {st_mode=S_IFREG|0644, st_size=12288, ...}) = 0
pread64(4,
"\0\0\0\0\1\0\0\0\0\0\0\0a\25\6\0\t\0\0\0\0\20\0\0\0\10\0\0\0\0\0\0"..., 4096,
0) = 4096
pread64(4,
"\0\0\0\0\1\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\2\0\316\17\0\r\357\17\316\17\0\0"...,
4096, 4096) = 4096
pread64(4,
"\0\0\0\0\1\0\0\0\2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\0\r\0\0\0\0\0\0"..., 4096,
8192) = 4096
close(4) = 0
close(3) = 0
write(1, "Tidying complete\n", 17) = 17
exit_group(0) = ?
+++ exited with 0 +++
[eximtest@lap test]$

--
You are receiving this mail because:
You are on the CC list for the bug.
--
## List details at https://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 2343] exim_tidydb eats infinite memory [ In reply to ]
https://bugs.exim.org/show_bug.cgi?id=2343

--- Comment #5 from Jeremy Harris <jgh146exb@wizmail.org> ---
Ah, cancel that. The db filename matters; invokes different processing.

--
You are receiving this mail because:
You are on the CC list for the bug.
--
## List details at https://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 2343] exim_tidydb eats infinite memory [ In reply to ]
https://bugs.exim.org/show_bug.cgi?id=2343

Jeremy Harris <jgh146exb@wizmail.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
Assignee|unallocated@exim.org |jgh146exb@wizmail.org

--
You are receiving this mail because:
You are on the CC list for the bug.
--
## List details at https://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 2343] exim_tidydb eats infinite memory [ In reply to ]
https://bugs.exim.org/show_bug.cgi?id=2343

Git Commit <git@exim.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |git@exim.org

--- Comment #6 from Git Commit <git@exim.org> ---
Git commit:
https://git.exim.org/exim.git/commitdiff/fc96555ab63243de9d468325aeaaa14cd77b9943

commit fc96555ab63243de9d468325aeaaa14cd77b9943
Author: Jeremy Harris <jgh146exb@wizmail.org>
AuthorDate: Sat Jan 9 13:08:35 2021 +0000
Commit: Jeremy Harris <jgh146exb@wizmail.org>
CommitDate: Sat Jan 9 13:08:35 2021 +0000

utilities: harden exim_tidydb against corrupt wait-records. bug 2343
----
src/src/exim_dbutil.c | 30 ++++++++++++++++++++++++++----
src/src/macros.h | 3 ++-
2 files changed, 28 insertions(+), 5 deletions(-)

--
You are receiving this mail because:
You are on the CC list for the bug.
--
## List details at https://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##