Closed Bug 171230 Opened 22 years ago Closed 19 years ago

infinite loop trying to open existing news server directories

Categories

(MailNews Core :: Networking: NNTP, defect)

x86
Linux
defect
Not set
critical

Tracking

(Not tracked)

RESOLVED EXPIRED

People

(Reporter: idallen, Assigned: sspitzer)

Details

(Keywords: hang)

Mozilla 1.2a went into a CPU loop when I tried to open a newsgroup URL.
A Linux strace showed it looping, trying to find subdirectories that weren't there:

stat64("/home/idallen/.mozilla/idallen/1oh2vvhw.slt/News/host-news.algonquincollege.com/algonquinc.academic.courses.cst.8129.02f.announce.msf",
0xbfffe95c) = -1 ENOENT (No such file or directory)
rmdir("/home/idallen/.mozilla/idallen/1oh2vvhw.slt/News/host-news.algonquincollege.com/algonquinc.academic.courses.cst.8129.02f.announce.msf")
= -1 ENOENT (No such file or directory)
stat64("/home/idallen/.mozilla/idallen/1oh2vvhw.slt/News/host-news.algonquincollege.com/algonquinc.academic.courses.cst.8129.02f.announce.msf",
0xbfffe950) = -1 ENOENT (No such file or directory)
open("/home/idallen/.mozilla/idallen/1oh2vvhw.slt/News/host-news.algonquincollege.com/algonquinc.academic.courses.cst.8129.02f.announce.msf",
O_RDWR|O_CREAT|O_TRUNC, 0666) = -1 ENOENT (No such file or directory)
stat64("/home/idallen/.mozilla/idallen/1oh2vvhw.slt/News/host-news.algonquincollege.com/algonquinc.academic.courses.cst.8129.02f.announce.msf",
0xbfffe95c) = -1 ENOENT (No such file or directory)
rmdir("/home/idallen/.mozilla/idallen/1oh2vvhw.slt/News/host-news.algonquincollege.com/algonquinc.academic.courses.cst.8129.02f.announce.msf")
= -1 ENOENT (No such file or directory)
[...etc...]

When I manually created these directories, the looping stopped and things
started working again.  (I had installed a previous version of Mozilla, which is
why it was looking for these news servers.  Looks like it didn't migrate the
".newsrc" files properly, nor did it handle the missing News/ directory or sub
directories properly.)
I duplicated this infinite loop on a second Linux system.  (Both were Mandrake
8.2.)  While Mozilla was looping, I created the missing News/ directory, then
the missing host-news.algonquincollege.com/ directory, and then the looping
stopped and the news group opened correctly.
Dupe of bug 131599 ?
Ian, can you remember why you are missing the News directory in the first place?
 Have you modified your profile at all?
Keywords: hang
Summary: infinite loop tyring to open existing news server directories → infinite loop trying to open existing news server directories
I might have had a config file that I migrated from an earlier 
Netscape/Mozilla release?  Because Mozilla keeps hanging on me on some web 
pages, I am struggling to keep Mozilla 1.x, Netscape 7, and Netscape 6
[now expired, oh dear] all running with similar settings and bookmarks,
and that means that I (or mozilla) might have copied something from an
earlier release (prefs.js?) without the associated directories.
If you create a new profile and/or a new news account, does this still occur?

In all instances I've tried, we create that directory.

Maybe this bug could be changed into "if no news directory, silently fail and
create one", though that seems a bit extreme.  I'm not understanding how a
normal user gets into this state, yet.
I suspect the missing News directory is due to my migration from and
return to previous versions of Netscape/Mozilla.  Some previous versions
didn't have this News directory, so when I start up a new Mozilla that
picks up some preferences from a previous Netscape/Mozilla, things are
incomplete.  I still have to run Netscape 6 because Mozilla hangs on
some pages; so, I may have migrated a preferences file (which I read is a
Bad Thing To Do).  So my missing News directory is probably my own fault.

It doesn't much matter how the poor user gets into this state; what
matters is how Mozilla reacts to it.  Mozilla should not go into an
infinite loop here; it should either fix things and move on or else print
an error and give up.  Either of those things would have prevented the
bug report.

Looking at the strace output, I cannot imagine how the existing code
is correct:  (I haven't downloaded all the source to look yet.)

    First, I see a stat() of the news *.msf file that returns ENOENT.
    That is followed by a rmdir() of the same pathname, which makes no
    sense at all: (a) the pathname doesn't exist (ENOENT), so the rmdir()
    is guaranteed to fail and (b) the pathname is a file, not a directory,
    even when it does exist, so the rmdir() wouldn't work anyway.

    After the rmdir() comes another stat() of the same pathname, which
    again may make no sense because we already know it isn't there
    (ENOENT).  That is followed by an open() to create the filename,
    which fails with ENOENT as well (because the directory hierarchy
    doesn't exist, for whatever strange reason).  Then we do another
    stat() and the whole process repeats, over and over.

At the point where the open() fails with ENOENT, something should react
differently.  Either print an error message and give up or try to fix
the missing News directory hierarchy.  But, please, no looping!
>If you create a new profile and/or a new news account, does this still occur?

I couldn't find a menu that says anything about profile management in
1.2A.  I expected it under Edit; but, it's not there.  Tools has a bunch
of managers; but, profiles isn't one of them.  Where are you hiding it?

I don't know that Mozilla is at fault for not creating the News directory,
since I may have had a funny incomplete pre-existing .netscape or 
.mozilla directory from which the new Mozilla 1.2A picked up some bad
news preferences.  The missing News directories could well be a mess that
I created through my use of Netscape 6, 7, and Mozilla 0.9x, 1.0, etc.

What is definitely a problem is how Mozilla went into a loop due to 
the missing directory.  That should be fixed independently of how the
directory went missing in the first place.
Hang, critical severity.

Reporter, you can create a new profile by running "mozilla.exe -profilemanager".
Can you still reproduce this problem on Mozilla 1.3 alpha or later, and a new
profile?
Severity: normal → critical
>Can you still reproduce this problem on Mozilla 1.3 alpha or later,
>and a new profile?

Here's how to reproduce the infinite loop in Mozilla 1.3a (Linux):

I removed my .mozilla directory.

I typed /usr/bin/mozilla.

In the Mozilla address box, I entered:

   news://cnews.corel.ca/corel.linux.linux-faq

I said yes to subscribe to the news group.  I entered some stuff about
my identity.  I was able to read the news articles in the news group.

I closed Mozilla.

I removed the News directory .mozilla/default/20a31a36.slt/News

I typed /usr/bin/mozilla.

In the Mozilla address box, I entered:

   news://cnews.corel.ca/corel.linux.linux-faq

I said yes to subscribe to the news group.

Mozilla went into an infinite loop:

stat64("/home/idallen/.mozilla/default/20a31a36.slt/News/news/corel.linux.linux-faq.msf",
0xbfffe814) = -1 ENOENT (No such file or directory)
open("/home/idallen/.mozilla/default/20a31a36.slt/News/news/corel.linux.linux-faq.msf",
O_RDWR|O_CREAT|O_TRUNC, 0666) = -1 ENOENT (No such file or directory)
stat64("/home/idallen/.mozilla/default/20a31a36.slt/News/news/corel.linux.linux-faq.msf",
0xbfffe820) = -1 ENOENT (No such file or directory)
rmdir("/home/idallen/.mozilla/default/20a31a36.slt/News/news/corel.linux.linux-faq.msf")
= -1 ENOENT (No such file or directory)

stat64("/home/idallen/.mozilla/default/20a31a36.slt/News/news/corel.linux.linux-faq.msf",
0xbfffe814) = -1 ENOENT (No such file or directory)
open("/home/idallen/.mozilla/default/20a31a36.slt/News/news/corel.linux.linux-faq.msf",
O_RDWR|O_CREAT|O_TRUNC, 0666) = -1 ENOENT (No such file or directory)
stat64("/home/idallen/.mozilla/default/20a31a36.slt/News/news/corel.linux.linux-faq.msf",
0xbfffe820) = -1 ENOENT (No such file or directory)
rmdir("/home/idallen/.mozilla/default/20a31a36.slt/News/news/corel.linux.linux-faq.msf")
= -1 ENOENT (No such file or directory)

stat64("/home/idallen/.mozilla/default/20a31a36.slt/News/news/corel.linux.linux-faq.msf",
0xbfffe814) = -1 ENOENT (No such file or directory)
open("/home/idallen/.mozilla/default/20a31a36.slt/News/news/corel.linux.linux-faq.msf",
O_RDWR|O_CREAT|O_TRUNC, 0666) = -1 ENOENT (No such file or directory)
stat64("/home/idallen/.mozilla/default/20a31a36.slt/News/news/corel.linux.linux-faq.msf",
0xbfffe820) = -1 ENOENT (No such file or directory)
rmdir("/home/idallen/.mozilla/default/20a31a36.slt/News/news/corel.linux.linux-faq.msf")
= -1 ENOENT (No such file or directory)
...repeat forever...

I let it run for a few minutes.  Mozilla grew to over 450MB!  Not only
does it loop, it loses memory, fast!

While it was still looping, I did this:

    mkdir .mozilla/default/20a31a36.slt/News
    mkdir .mozilla/default/20a31a36.slt/News/news

The looping stopped.  The news reader opened.

Anyone who uses rdist/rsync/rcp to distribute their Mozilla profile
among machines will have this problem.
Product: MailNews → Core
This is an automated message, with ID "auto-resolve01".

This bug has had no comments for a long time. Statistically, we have found that
bug reports that have not been confirmed by a second user after three months are
highly unlikely to be the source of a fix to the code.

While your input is very important to us, our resources are limited and so we
are asking for your help in focussing our efforts. If you can still reproduce
this problem in the latest version of the product (see below for how to obtain a
copy) or, for feature requests, if it's not present in the latest version and
you still believe we should implement it, please visit the URL of this bug
(given at the top of this mail) and add a comment to that effect, giving more
reproduction information if you have it.

If it is not a problem any longer, you need take no action. If this bug is not
changed in any way in the next two weeks, it will be automatically resolved.
Thank you for your help in this matter.

The latest beta releases can be obtained from:
Firefox:     http://www.mozilla.org/projects/firefox/
Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html
Seamonkey:   http://www.mozilla.org/projects/seamonkey/
This bug has been automatically resolved after a period of inactivity (see above
comment). If anyone thinks this is incorrect, they should feel free to reopen it.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → EXPIRED
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.