Skip to contentSkip to conversation

mlmmj-process dies with "free(): invalid next size"

DISCUSSION Applied Christoph Wilke 4 participants 9 messages Nov 10, 2006 – Nov 13, 2006

lore
Share & tools
lore
#0 lore raw

Hej!

As stated in the subject mlmmj-process dies with an memory error, if the subject line of the mailfile contains an equal sign ( = ).

After I found the error in my logs, I tried to run the process by hand:

# ~/mlmmj/mlmmj-1.2.12-RC4/src/mlmmj-process -L /var/spool/mlmmj/test \
-m /var/spool/mlmmj/test/incoming/647f4170739768df
*** glibc detected *** free(): invalid next size (fast): 0x08054a40 *** Aborted
#

I tested it with the attached mailfile -- error the same file, but without the equal signs -- no error the same file, but only an equal sign as subject -- error.

Further testing/checking showed, the bug was introduced in RC3, because RC2 runs just fine.

Ciao
Chris

ps. The versions I used to test weren't patched.

#1 lore raw
Quoted 1 line · Christoph Wilke

ps. The versions I used to test weren't patched.

Can you please try RC4 with the latest patch from Morten?

Signature · 4 lines
Mads Martin Joergensen, http://mmj.dk
"Why make things difficult, when it is possible to make them cryptic
 and totally illogical, with just a little bit more effort?"
                                 -- A. P. J.
#2 lore raw
In reply to Christoph Wilke
Quoted 6 lines · Mads Martin Joergensen
Quoted 1 line · Christoph Wilke

ps. The versions I used to test weren't patched.

Can you please try RC4 with the latest patch from Morten?

We get this too: mlmmj-process: *** glibc detected *** free():
invalid next size (fast): 0x116383a8 ***

RC4 doesn't solve the issue (unless there's some patch against it that I'm missing).

Signature · 6 lines
Andrea Barisani <[email protected]>                            .*.
Gentoo Linux Infrastructure Developer                          V
                                                             (   )
PGP-Key 0x864C9B9E http://dev.gentoo.org/~lcars/pubkey.asc   (   )
    0A76 074A 02CD E989 CE7F AC3F DA47 578E 864C 9B9E        ^^_^^
      "Pluralitas non est ponenda sine necessitate"
#3 lore raw
In reply to Christoph Wilke
Quoted 9 lines · Andrea Barisani
Quoted 3 lines
Quoted 1 line

ps. The versions I used to test weren't patched.

Can you please try RC4 with the latest patch from Morten?

We get this too: mlmmj-process: *** glibc detected *** free():
invalid next size (fast): 0x116383a8 ***

RC4 doesn't solve the issue (unless there's some patch against it that I'm missing).

There was this patch from Morten:

http://mlmmj.mmj.dk/~mortenp/patch-mlmmj-1.2.12_RC4-gethdrline.diff

Signature · 4 lines
Mads Martin Joergensen, http://mmj.dk
"Why make things difficult, when it is possible to make them cryptic
 and totally illogical, with just a little bit more effort?"
                                 -- A. P. J.
#4 lore raw
In reply to Christoph Wilke
Quoted 8 lines · Mads Martin Joergensen
Quoted 7 lines · Andrea Barisani
Quoted 3 lines
Quoted 1 line

ps. The versions I used to test weren't patched.

Can you please try RC4 with the latest patch from Morten?

We get this too: mlmmj-process: *** glibc detected *** free():
invalid next size (fast): 0x116383a8 ***

Quoted 7 lines
Quoted 2 lines

RC4 doesn't solve the issue (unless there's some patch against it that I'm missing).

There was this patch from Morten:

http://mlmmj.mmj.dk/~mortenp/patch-mlmmj-1.2.12_RC4-gethdrline.diff

Applied, let's see what happens. Also today I found to mlmmj-process at 100% CPU battling with each other. I'll try to debug it if it happens again.

Cheers

Quoted 5 lines
Signature · 4 lines
Mads Martin Joergensen, http://mmj.dk
"Why make things difficult, when it is possible to make them cryptic
 and totally illogical, with just a little bit more effort?"
                                 -- A. P. J.
Signature · 6 lines
Andrea Barisani <[email protected]>                            .*.
Gentoo Linux Infrastructure Developer                          V
                                                             (   )
PGP-Key 0x864C9B9E http://dev.gentoo.org/~lcars/pubkey.asc   (   )
    0A76 074A 02CD E989 CE7F AC3F DA47 578E 864C 9B9E        ^^_^^
      "Pluralitas non est ponenda sine necessitate"
#5 lore raw
In reply to Christoph Wilke
Quoted 8 lines · Mads Martin Joergensen
Quoted 7 lines · Andrea Barisani
Quoted 3 lines
Quoted 1 line

ps. The versions I used to test weren't patched.

Can you please try RC4 with the latest patch from Morten?

We get this too: mlmmj-process: *** glibc detected *** free():
invalid next size (fast): 0x116383a8 ***

Quoted 12 lines
Quoted 2 lines

RC4 doesn't solve the issue (unless there's some patch against it that I'm missing).

There was this patch from Morten:

http://mlmmj.mmj.dk/~mortenp/patch-mlmmj-1.2.12_RC4-gethdrline.diff

Signature · 4 lines
Mads Martin Joergensen, http://mmj.dk
"Why make things difficult, when it is possible to make them cryptic
 and totally illogical, with just a little bit more effort?"
                                 -- A. P. J.

Ok I can confirm that with the patch we are still getting the error.

Signature · 6 lines
Andrea Barisani <[email protected]>                            .*.
Gentoo Linux Infrastructure Developer                          V
                                                             (   )
PGP-Key 0x864C9B9E http://dev.gentoo.org/~lcars/pubkey.asc   (   )
    0A76 074A 02CD E989 CE7F AC3F DA47 578E 864C 9B9E        ^^_^^
      "Pluralitas non est ponenda sine necessitate"
#6 lore raw
In reply to Christoph Wilke

Hi Christoph

Quoted 4 lines · Christoph Wilke

# ~/mlmmj/mlmmj-1.2.12-RC4/src/mlmmj-process -L /var/spool/mlmmj/test \
-m /var/spool/mlmmj/test/incoming/647f4170739768df
*** glibc detected *** free(): invalid next size (fast): 0x08054a40 *** Aborted

Ouch. That smells like a double-free.

Quoted 2 lines

I tested it with the attached mailfile -- error the same file, but without the equal signs -- no error

I am unable to reproduce the error with the attached mailfile. The bug might depend on a specific setting. Could you send me (a link to) a tarball of the listdir/control/ directory?

Quoted 1 line

the same file, but only an equal sign as subject -- error.

There was a bug in cleanquotedp() that would cause it to read past the end of its buffer, if there was an equal sign within the last two bytes of the subject.

I have fixed that issue now:

http://mlmmj.mmj.dk/~mortenp/patch-mlmmj-1.2.12_RC4-cleanquotedp.diff

However, I belive that this is a seperate bug. Was the glibc error message for this case the same as the error message for the first case?

Quoted 2 lines

Further testing/checking showed, the bug was introduced in RC3, because RC2 runs just fine.

Strange. I don't see how the change in gethdrline() could have anything to do with this, but I might be wrong.

Could you run this again (with the patch) with Valgrind?

Morten

Signature · 2 lines
Morten K. Poulsen <[email protected]>
http://www.afdelingp.dk/
#7 lore raw
In reply to Christoph Wilke
Quoted 11 lines · Morten K. Poulsen

Hi Christoph

Quoted 6 lines · Christoph Wilke

# ~/mlmmj/mlmmj-1.2.12-RC4/src/mlmmj-process -L /var/spool/mlmmj/test \
-m /var/spool/mlmmj/test/incoming/647f4170739768df
*** glibc detected *** free(): invalid next size (fast): 0x08054a40
***
Aborted

Quoted 8 lines

Ouch. That smells like a double-free.

Quoted 2 lines

I tested it with the attached mailfile -- error the same file, but without the equal signs -- no error

I am unable to reproduce the error with the attached mailfile. The bug might depend on a specific setting. Could you send me (a link to) a tarball of the listdir/control/ directory?

I think you are right, strace showed me, it crashes during the insertion of the prefix.
I forgot to mention this, sorry.

I placed the control directory online here:
https://130.83.185.211/mlmmj/test_control.tar.bz2

Quoted 7 lines
Quoted 2 lines

the same file, but only an equal sign as subject -- error.

There was a bug in cleanquotedp() that would cause it to read past the end of its buffer, if there was an equal sign within the last two bytes of the subject.

Quoted 7 lines

I have fixed that issue now:

http://mlmmj.mmj.dk/~mortenp/patch-mlmmj-1.2.12_RC4-cleanquotedp.diff

However, I belive that this is a seperate bug. Was the glibc error message for this case the same as the error message for the first case?

I will test this later. Not much time at the moment...

Quoted 8 lines
Quoted 3 lines

Further testing/checking showed, the bug was introduced in RC3, because RC2 runs just fine.

Strange. I don't see how the change in gethdrline() could have anything to do with this, but I might be wrong.

Could you run this again (with the patch) with Valgrind?

I did, and it works now for me.

Quoted 2 lines

Morten

Ciao
Chris

#8 lore raw
In reply to Christoph Wilke
Quoted 1 line · Christoph Wilke

On Sun, November 12, 2006 22:32, Morten K. Poulsen wrote:

[...]

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

I tested it with the attached mailfile -- error the same file, but without the equal signs -- no error

[...]

Quoted 9 lines
Quoted 9 lines
Quoted 1 line

the same file, but only an equal sign as subject -- error.

There was a bug in cleanquotedp() that would cause it to read past the
end of its buffer, if there was an equal sign within the last two bytes of the subject.

I have fixed that issue now:

Quoted 7 lines
Quoted 5 lines

http://mlmmj.mmj.dk/~mortenp/patch-mlmmj-1.2.12_RC4-cleanquotedp.diff

However, I belive that this is a seperate bug. Was the glibc error message for this case the same as the error message for the first case?

I will test this later. Not much time at the moment...

With the full subject I get:

# /root/mlmmj/mlmmj-1.2.12-RC4/src/mlmmj-process -L /var/spool/mlmmj/test -m /var/spool/mlmmj/test/incoming/647f4170739768df
*** glibc detected *** free(): invalid next size (normal): 0x08055260 *** Aborted
#

with the equal sign, it results in:

# /root/mlmmj/mlmmj-1.2.12-RC4/src/mlmmj-process -L /var/spool/mlmmj/test -m /var/spool/mlmmj/test/incoming/647f4170739768df
*** glibc detected *** free(): invalid next size (fast): 0x080551c8 *** Aborted
#

Ciao
Chris