Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

IMAPSTATUS causes crash

0 views
Skip to first unread message

Erik Quaeghebeur

unread,
Jan 26, 2006, 5:15:08 PM1/26/06
to
In a recent post, I saw IMAPSTATUS suggested, and wanted to try it.
This crashed my pine session (I get "shell exited with signal 6" from my
desktop environment).

I use pine 4.64 on a Gentoo system (linux kernel 2.6.15), with Eduardo's
patches applied (I think) in a shell under KDE 3.4.3. FULLSTATUS works.

Before that I go to the debugging stage, I was wondering if there were
IMAP servers that do not support this. I tried telneting my server, which
works, but it doesn't say what type of server it is (I thought Cyrus).
Can I give a command in the telnet session to get more info? Skimming
through <http://www.faqs.org/rfcs/rfc1730.html> did not get me anywhere.

Any advice/suggestions appreciated,

Erik

Eduardo Chappa

unread,
Jan 26, 2006, 6:07:28 PM1/26/06
to
*** Erik Quaeghebeur (baequ...@nospammail.net.comm) wrote in...:

:) Before that I go to the debugging stage, I was wondering if there were
:) IMAP servers that do not support this.

This is not a property of the server. Data is collected by Pine from the
server in terms of status of the messages, and somehow this is making Pine
crash. Do you have a debug backtrace from gdb? I would be interested in
seeing it. I have never had any trouble with this (I use IMAPSTATUS for
years already, so I can't imagine what your problem may be).

--
Eduardo
Patches/Help: http://www.math.washington.edu/~chappa/pine/
XML/RSS feed: http://www.math.washington.edu/~chappa/pine/pine.xml
Please send spam to webmaster@localhost

Erik Quaeghebeur

unread,
Jan 27, 2006, 4:58:48 AM1/27/06
to
On Thu, 26 Jan 2006, Erik Quaeghebeur wrote:

> In a recent post, I saw IMAPSTATUS suggested, and wanted to try it. This
> crashed my pine session (I get "shell exited with signal 6" from my
> desktop environment).
>

> Before that I go to the debugging stage, I was wondering if there were
> IMAP servers that do not support this.
>

I now tried it at work from a pine 4.63 install on SuSE 10.0, and
IMAPSTATUS works here. So it must be the installation of pine 4.64 on
Gentoo at home, and not the server, as Eduardo already said in another
post.

Debugging time...

Erik

Mark Crispin

unread,
Jan 27, 2006, 3:10:16 PM1/27/06
to
On Fri, 27 Jan 2006, Erik Quaeghebeur wrote:
>> In a recent post, I saw IMAPSTATUS suggested, and wanted to try it. This
>> crashed my pine session (I get "shell exited with signal 6" from my
>> desktop environment).
> I now tried it at work from a pine 4.63 install on SuSE 10.0, and
> IMAPSTATUS works here. So it must be the installation of pine 4.64 on
> Gentoo at home, and not the server

That is correct. Is your version of Pine the unmodified UW distribution?
If it did not come directly from the
http://www.washington.edu/getpine
or
ftp://ftp.cac.washington.edu/pine/
sites, then it probably has been modified by third parties and the problem
may be in one of those modifications.

-- Mark --

http://panda.com/mrc
Democracy is two wolves and a sheep deciding what to eat for lunch.
Liberty is a well-armed sheep contesting the vote.

Erik Quaeghebeur

unread,
Jan 30, 2006, 3:45:08 PM1/30/06
to
On Fri, 27 Jan 2006, Mark Crispin wrote:

> [...] Erik Quaeghebeur wrote:
> >
> > In a recent post, I saw IMAPSTATUS suggested, and wanted to try it.
> > This crashed my pine session (I get "shell exited with signal 6" from
> > my desktop environment).
>

> [...] Is your version of Pine the unmodified UW distribution?
>
> [if it] has been modified by third parties and the problem may be in one
> of those modifications.
>
It is indeed modified (by the Gentoo maintainer). The applied(?) patches
(as reported in the `ebuild') are included at end of post.

I have run pine -d 9 and looked at the debug file. It does not seem to
give any clue (but who am I to judge?). The last actions are (obfuscated
personally identifiable material):

---- FOLDER LISTER ----
IMAP 21:11:47 1/30 mm_log babble: Trying IP address [xxx.xxx.xxx.xxx]
IMAP 21:11:48 1/30 mm_notify babble: -no folder-: news.xxx.xxx
InterNetNews NNRP server INN 2.3.3 ready (posting ok).
About to open folder "xxx" inbox is: "INBOX"
expunge_and_close: "xxx" (NO_CLOSE bit set)
IMAP 21:12:02 1/30 mm_log babble: Trying IP address [xxx.xxx.xxx.xxx]
IMAP 21:12:03 1/30 mm_notify babble:
{xxx}xxx.xxx: xxx
Cyrus IMAP4 v2.1.18 server ready
Opened folder
"{xxx}xxx.xxx"
with 18 messages
Sorting by Arrival
Sorting by tHread
sort_thread_callback
sort_thread_callback done

This is a folder that contains threads. I tried some other (incoming)
folders that do not contain threads, and those do not cause a crash.
Crashing occurs before the folder is shown, and while 'Sorting' is shown.

If the Pine developers or Eduardo (considering his patch is used) are
interested, I can send the whole debug file. You can ask here or send me
an e-mail.


Further actions I plan to take: inquire on the Gentoo forums, file a
Gentoo-bug, compile the unpatched sources and try those.


Applied patches (comments about sanity are welcome, I'll pas them on to
the Gentoo maintainer):

epatch "${FILESDIR}/pine-4.62-spooldir-permissions.patch" || die

# Various fixes and features.
epatch "${WORKDIR}/${CHAPPA_PF}-chappa-all.patch" || die
# Fix flock() emulation.
cp "${FILESDIR}/flock.c" "${S}/imap/src/osdep/unix" || die
# Build the flock() emulation.
epatch "${FILESDIR}/imap-4.7c2-flock_4.60.patch" || die
if use ldap ; then
# Link to shared ldap libs instead of static.
epatch "${FILESDIR}/pine-4.30-ldap.patch" || die
mkdir "${S}/ldap"
ln -s /usr/lib "${S}/ldap/libraries"
ln -s /usr/include "${S}/ldap/include"
fi
# if use ipv6 ; then
# epatch "${DISTDIR}/${P}-v6-20031001.diff" || die
# fi
if use passfile ; then
#Is this really the correct place to define it?
epatch "${FILESDIR}/pine-4.56-passfile.patch" || die
fi
if use largeterminal ; then
# Add support for large terminals by doubling the size of
pine's internal display buffer
epatch "${FILESDIR}/pine-4.61-largeterminal.patch" || die
fi

# Something from RedHat.
epatch "${FILESDIR}/pine-4.31-segfix.patch" || die
# Create lockfiles with a mode of 0600 instead of 0666.
epatch "${FILESDIR}/pine-4.40-lockfile-perm.patch" || die
# Add missing time.h includes.
epatch "${FILESDIR}/imap-2000-time.patch" || die
# Bug #23336 - makes pine transparent in terms that support it.
epatch "${FILESDIR}/transparency.patch" || die

# Bug #72861 - relaxes subject length for base64-encoded subjects
epatch "${FILESDIR}/pine-4.61-subjectlength.patch" || die

Erik Quaeghebeur

unread,
Jan 30, 2006, 4:53:32 PM1/30/06
to
As a follow-up to my own post:

On Mon, 30 Jan 2006, Erik Quaeghebeur wrote:

>> [...] Erik Quaeghebeur wrote:
>> >
>> > In a recent post, I saw IMAPSTATUS suggested, and wanted to try it. This
>> > crashed my pine session (I get "shell exited with signal 6" from my
>> > desktop environment).
>>

From a textconsole, I get:

*** glibc detected *** double free or corruption (!prev):
0x0000000000a9a750 ***

> Further actions I plan to take: inquire on the Gentoo forums, file a
> Gentoo-bug, compile the unpatched sources and try those.
>

The Gentoo bugreport is <http://bugs.gentoo.org/show_bug.cgi?id=120981>.

Erik

Eduardo Chappa

unread,
Jan 30, 2006, 5:00:12 PM1/30/06
to
*** Erik Quaeghebeur (baequ...@nospammail.net.comm) wrote in...:

:) This is a folder that contains threads. I tried some other (incoming)
:) folders that do not contain threads, and those do not cause a crash.
:) Crashing occurs before the folder is shown, and while 'Sorting' is
:) shown.

Hello Erik,

I am very interested to learn how to reproduce this crash. However I
have been unsuccesful to do it. What I would like to see is a ".pinerc"
file that shows the bug.

I do not need your server names. You can remove them. If I have a copy
of the rest of your options, I could see if I could use it to reproduce
the crash. You can send me a copy of a .pinerc file that shows the problem
directly by e-mail if you prefer.

Thank you!

Erik Quaeghebeur

unread,
Jan 30, 2006, 5:39:25 PM1/30/06
to
On Mon, 30 Jan 2006, Erik Quaeghebeur wrote:
>
> Further actions I plan to take: inquire on the Gentoo forums, file a
> Gentoo-bug, compile the unpatched sources and try those.
>
I compiled the unpatched sources and those work (using them ATM, with
IMAPSTATUS).

It must be one of the patches...

Erik

Eduardo Chappa

unread,
Jan 30, 2006, 10:38:30 PM1/30/06
to
*** Erik Quaeghebeur (baequ...@nospammail.net.comm) wrote in...:

:) On Mon, 30 Jan 2006, Erik Quaeghebeur wrote:
:) >
:) > Further actions I plan to take: inquire on the Gentoo forums, file a
:) > Gentoo-bug, compile the unpatched sources and try those.
:) >
:) I compiled the unpatched sources and those work (using them ATM, with
:) IMAPSTATUS).
:)
:) It must be one of the patches...

Yep. This is what happens.

You have the ATT token in the index-format. This causes Pine to call
fetch_body, which corrupts the "index data". This does not affect any
other call in Pine, because Pine does not rely on index data in general,
but relies on the elt data. In short, the problem was fixed by making Pine
rely on the elt data.

I thank you a lot for your help. I have posted new patches that fix this
problem.

Erik Quaeghebeur

unread,
Feb 6, 2006, 3:49:20 PM2/6/06
to
On Mon, 30 Jan 2006, Eduardo Chappa wrote:
>
> *** Erik Quaeghebeur (baequ...@nospammail.net.comm) wrote in...:
>
> :) On Mon, 30 Jan 2006, Erik Quaeghebeur wrote:
> :) >
> :) I compiled the unpatched sources and those work (using them ATM, with
> :) IMAPSTATUS).
> :)
> :) It must be one of the patches...
>
> Yep. This is what happens.
>
> You have the ATT token in the index-format. This causes Pine to call
> fetch_body, which corrupts the "index data". This does not affect any
> other call in Pine, because Pine does not rely on index data in general,
> but relies on the elt data. In short, the problem was fixed by making Pine
> rely on the elt data.
>
> I thank you a lot for your help. I have posted new patches that fix this
> problem.
>
The Gentoo package maintainers updated the pine ebuild to include your
latest patchset, but this update does not solve the problem. (How can I
check the patch revision, post-compile, post-cleanup?)

I also tried removing the ATT token, but this does not seem to have any
influence: with or without, pine crashes when IMAPSTATUS is set and a new
folder (with threads) is opened. Opening an already open folder after
changing `index-format' to include IMAPSTATUS and opening folders without
threads does not seem to cause the crash.

Erik

Eduardo Chappa

unread,
Feb 20, 2006, 4:23:50 PM2/20/06
to
*** Erik Quaeghebeur (baequ...@nospammail.net.comm) wrote in...:

:) I also tried removing the ATT token, but this does not seem to have any
:) influence: with or without, pine crashes when IMAPSTATUS is set and a
:) new folder (with threads) is opened. Opening an already open folder
:) after changing `index-format' to include IMAPSTATUS and opening folders
:) without threads does not seem to cause the crash.

Erik,

Ok, I think I found the problem. There was a memory corruption problem
caused by initializing a variable using an incorrect size for the array. I
have fixed the code to account for this and this is available in my web
page.

Thank you Erik for all your help while debugging this problem.

--
Eduardo
http://www.math.washington.edu/~chappa/pine/

0 new messages