Bug 587 - incorrect type causes .newsrc corruption
Summary: incorrect type causes .newsrc corruption
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: trn
Version: 5.2
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact:
: 277 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 1998-12-26 00:06 UTC by tzs
Modified: 2014-03-17 02:08 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 1999-02-10 22:15:21 UTC

Attachments (Terms of Use)

Description tzs 1998-12-26 00:06:31 UTC
In the file rcln.c, there is code like this:

bool morenum;
morenum = isdigit(*s);

"bool" is defined as char, and isdigit returns an int.  On
glibc on little-endian processors, that int is >256 when *s
is a digit, which gets truncated to 0 when stuffed into a
char.  Oops.

Two ways to fix: (1) change bool to bool_int.  That's what
the Debian people did last February.  (2) In common.h, chang
"#define bool char" to "#define bool int", so that any other
places that any other places that have this problem will get
fixed.  I have asked the maintainer of trn about this, and
he says #2 is an OK fix.

Note: I reported this bug, and this fix, back in August.
Please don't lose it this time.

Comment 1 Aleksey Nogin 1998-12-26 23:52:59 UTC
This was already discussed in bug report #277, but never was fixed
(report #277 was discarded for no apparent reason)

Comment 2 Jay Turner 1998-12-29 19:00:59 UTC
Unable to replicate #277 in test lab, but logic is correct and should
be fixed.

Comment 3 tzs 1998-12-29 20:01:59 UTC
Best way to reproduce is to read a few random articles in
comp.os.linux.advocacy, or any other group where a lot of articles are
cross-posted.  The effect of the bug is that when trn updates the
entries for those other groups in .newsrc, it botches, and you end up
with entries that have the comas in the wrong place.  E.g., instead of
1-500,505,507,510,520-530, you might get 1-500,505,,,507510520-530.

Note that trn won't complain about the problem until you get to one of
the groups whose entry is corrupted, and it does *NOT* corrupt the
group you are currently reading in, so it can appear that the
corruption had nothing to do with what you were actually doing.

Comment 4 vek 1999-01-29 12:56:59 UTC
Was there eny plan to actually fix this?  If so you can close this
as well as 277 when the fix has been made.

Comment 5 Jeff Johnson 1999-02-02 14:58:59 UTC
*** Bug 277 has been marked as a duplicate of this bug. ***

The trn news reader often looses the list of already read
articles.  It occurs after you get a warning that someone
has modified the news group and that it is now assumed that
nothing is read.

Difficult to explain the symptoms, but the problem occurs in
the source file rcln.c around line 81:

The variable morenum is now a 8 bit bool type, but should be
at least 16 bit in orer to hold the result if isdigit()

The result is that the variable morenum is always false, and
that causes the list of read articles to become garbeled.

The problem poped up while reading the comp.os.linux groups
with several thousane articles, and a lot of crossposts
within these groups.  The rpoblem is related to mark all
occurences of a crossposted article as read.


Villy Kruse

------- Additional Comments From jturner@redhat.com  12/08/98 15:06 -------
Can you give us more information about any messages that you get when
this deletion occurs.  It sounds as if you are getting caught in the
expire cycle on your newsreader.  Is this a correct statement?

------- Additional Comments From ayn2@cornell.edu  12/22/98 22:26 -------
It seems the person who closed the bug did not read the bug e-mail
directory. I believe this bug should be reopened.

------- Additional Comments From vek@pharmapartners.nl  01/05/99 09:16 -------
The problem was not fixed

See my e-mail messages where my full message is to be found.


------- Additional Comments From ayn2@cornell.edu  01/06/99 00:39 -------
This is a duplicate of #587

Comment 6 Mike Maher 1999-02-10 22:15:59 UTC
Updating packages for Rawhide..  ammended bug for trn from report for
next release.

Note You need to log in before you can comment on or make changes to this bug.