Hi all,
A few days ago Paul F De La Cruz told us that dbmail was crashing on his
Dual Opteron system. He has given me the opportunity to use his system
for debugging.
I actually found two bugs. One was a bug that I could reproduce on my
own systems.
It's located in header.c, in the function read_header(). In line 72,
fgets can return NULL. There was no check for this, so the strlen() on
line 73 segfaulted.
After fixing this bug, I happily, and wrongly ;), concluded that I had
fixed it all! Paul told me that the thing was still segfaulting.. It
turned out to be the makemd5() function from dbmd5.c that eventually
(somewhere deep down in the md5 functions) overwrites some memory it
should not overwrite. The md5 algorithm is pretty unclear to me, so I
cannot find what is going wrong.
running valgrind on x86 did not reveal any problems.
Does anyone have an idea how to fix this?
Ilja
A few days ago Paul F De La Cruz told us that dbmail was crashing on his
Dual Opteron system. He has given me the opportunity to use his system
for debugging.
I actually found two bugs. One was a bug that I could reproduce on my
own systems.
It's located in header.c, in the function read_header(). In line 72,
fgets can return NULL. There was no check for this, so the strlen() on
line 73 segfaulted.
After fixing this bug, I happily, and wrongly ;), concluded that I had
fixed it all! Paul told me that the thing was still segfaulting.. It
turned out to be the makemd5() function from dbmd5.c that eventually
(somewhere deep down in the md5 functions) overwrites some memory it
should not overwrite. The md5 algorithm is pretty unclear to me, so I
cannot find what is going wrong.
running valgrind on x86 did not reveal any problems.
Does anyone have an idea how to fix this?
Ilja