nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] Large Message Number Causes Many Nmh Commands To Abort

2014-01-07 09:58:50
Ken Hornstein <kenh(_at_)pobox(_dot_)com> writes:
A message number, 2147483647 which is 2^31 -1, causes many nmh commands,
including scan, folder and inc, to abort with

     Malloc failed

Do you have a message number "1" (or something else low in that folder)?

Yes, I do. The large message number was generated by a bug in my program.

If so ... yeah, okay, that's going to happen (at least it doesn't crash).
The folder structure has some fields which are allocated based on the number
of possible entries, which start from the lowest numbered message and range
to the highest numbered message.  All of those commands don't have hardwired
limits anymore, they allocate as much memory as they need ... until they
can't anymore, as you've discovered.  I'm not sure there's a great solution
to that; redoing the folder structure to handle a sparse folder layout is
more work than I personally want to do right now.  Also, we probably have
some overflow problems when you get message numbers that high.
workers

Any fix, is if little import to me. I was just being a good citizen in
reporting it.You could turn the bug into a non-bug, with a man page entry
somewhere, putting an upper limit on the range of message numbers, or
perhaps just a maximum message number.

    Norman Shapiro

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>