🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
16 messages
16 total messages Started by Tony Thu, 30 May 2013 14:58
INN2 - 32bit - Wheezy
#85504
Author: Tony
Date: Thu, 30 May 2013 14:58
41 lines
2776 bytes
So it seems that INN2 on Wheezy (32bit) doesn't work if you try and enable
any perl filtering.

Debian Bug #655748 covers it.

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=655748

One of the solutions is to use the LFS enabled package, which does work.

I've recently migrated my news server from Squeeze to Wheezy.  Luckily, I
wasn't worried about any of the existing spool (I only keep 14 days
anyway), so I just installed the LFS enabled version and everything is
okay.

I'm using the 32bit version because the VPS it runs on only has 256MB of
memory, and so I don't gain any significant benefit from the 64bit version,
and historically, I've always run the 32bit version on that machine.

However, I have another machine (at home) running 32bit Squeeze and INN2,
which has 10+ years of articles in some groups in the uk.* hierarchy (by
the way, if anyone has a longer archive of uk.*, I'd love to hear from
them).

I need to upgrade that machine to Wheezy, but that means either turning off
perl filtering (which isn't too bad on that machine), or, migrating to the
LFS version.

What I don't know, are what, if any, steps I would need to follow to
migrate from the non-LFS version to the LFS version and keep the spool and
all the other files intact.

Does anyone have any insight?

Also, if I've missed something fundamental or misunderstood anything in
what I've read, feel free to correct me.
-- 
Tony Evans
Saving trees and wasting electrons since 1993
blog  -> http://perceptionistruth.com/
books -> http://www.bookthing.co.uk/
[ anything below this line wasn't written by me ]
Re: INN2 - 32bit - Wheezy
#85505
Author: Russ Allbery
Date: Thu, 30 May 2013 17:41
33 lines
2564 bytes
Tony <tony@darkstorm.invalid> writes:

> I need to upgrade that machine to Wheezy, but that means either turning
> off perl filtering (which isn't too bad on that machine), or, migrating
> to the LFS version.

> What I don't know, are what, if any, steps I would need to follow to
> migrate from the non-LFS version to the LFS version and keep the spool
> and all the other files intact.

> Does anyone have any insight?

Are all the articles stored in tradspool or timehash?  If so, you can just
rebuild history and overview from tradspool and you should be okay.

If you have articles in CNFS or timecaf, you need to either:

1. Write the piece of code that no one has had a chance to write yet to
   convert a CNFS or CAF file from 32-bit to 64-bit.

2. Set up a new server and feed all the articles from the old server to
   the new server instead of doing an in-place upgrade.

The problem is that INN uses binary off_t and similar data types directly
in the on-disk structures without any ability to detect incorrect sizes or
convert from old formats.  (This is, obviously, a bug, but it's a bug in
the on-disk data format and therefore rather difficult to fix.)

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: INN2 - 32bit - Wheezy
#85506
Author: Tony
Date: Thu, 30 May 2013 22:10
26 lines
2282 bytes
In news.software.nntp, Russ Allbery <rra@stanford.edu> wrote:

>Tony <tony@darkstorm.invalid> writes:
>
>> I need to upgrade that machine to Wheezy, but that means either turning
>> off perl filtering (which isn't too bad on that machine), or, migrating
>> to the LFS version.
>
>> What I don't know, are what, if any, steps I would need to follow to
>> migrate from the non-LFS version to the LFS version and keep the spool
>> and all the other files intact.
>
>> Does anyone have any insight?
>
>Are all the articles stored in tradspool or timehash?  If so, you can just
>rebuild history and overview from tradspool and you should be okay.

Ah excellent, I used tradspool in this instance.  So I should be okay just
to remove inn, do the upgrade to Wheezy, install inn2-lfs, and then rebuild
history/overview before starting inn.
-- 
Tony Evans
Saving trees and wasting electrons since 1993
blog  -> http://perceptionistruth.com/
books -> http://www.bookthing.co.uk/
[ anything below this line wasn't written by me ]
Re: INN2 - 32bit - Wheezy
#85507
Author: Russ Allbery
Date: Thu, 30 May 2013 22:11
18 lines
2024 bytes
Tony <tony@darkstorm.invalid> writes:
> In news.software.nntp, Russ Allbery <rra@stanford.edu> wrote:

>> Are all the articles stored in tradspool or timehash?  If so, you can
>> just rebuild history and overview from tradspool and you should be
>> okay.

> Ah excellent, I used tradspool in this instance.  So I should be okay
> just to remove inn, do the upgrade to Wheezy, install inn2-lfs, and then
> rebuild history/overview before starting inn.

Yes, that should work.  I would back the files up first just in case.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: INN2 - 32bit - Wheezy
#85510
Author: yamo'
Date: Fri, 31 May 2013 09:06
21 lines
2036 bytes
Hi,

Tony a tapoté, le 30/05/2013 16:58:
> So it seems that INN2 on Wheezy (32bit) doesn't work if you try and
> enable any perl filtering.
> 
> Debian Bug #655748 covers it.

On : <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=655748#70> :

> A quick workaround seems to be to put perlfilter: false in all (or
> the relevant) access groups in /etc/news/readers.conf.




-- 
Stéphane	<http://pasdenom.info/fortune/?>
BOFH excuse #148:

Insert coin for new game
Re: INN2 - 32bit - Wheezy
#85509
Author: Tony
Date: Fri, 31 May 2013 09:19
33 lines
2570 bytes
On 2013-05-31, yamo' <yamo@beurdin.invalid> wrote:
> Hi,
>
> Tony a tapot?, le 30/05/2013 16:58:
>> So it seems that INN2 on Wheezy (32bit) doesn't work if you try and
>> enable any perl filtering.
>> 
>> Debian Bug #655748 covers it.
>
> On : <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=655748#70> :
>
>> A quick workaround seems to be to put perlfilter: false in all (or
>> the relevant) access groups in /etc/news/readers.conf.

Indeed, as I said in my original post to which you've replied,

"I need to upgrade that machine to Wheezy, but that means either turning
off perl filtering (which isn't too bad on that machine), or, migrating to
the LFS version."

So I am aware that you can work around this.  However, on the primary
server in question, I use the perl filter, and therefore it's not an option.

On the second machine, it's not quite so critical, but I'd rather not 
have avoid a standard feature of inn just because there's a problem in how
it was compiled, when I can move to the LFS version and still have filtering.

-- 
Tony Evans
Saving trees and wasting electrons since 1993
blog  -> http://perceptionistruth.com/
books -> http://www.bookthing.co.uk/
[ anything below this line wasn't written by me ]
Re: INN2 - 32bit - Wheezy
#85508
Author: yamo'
Date: Fri, 31 May 2013 09:36
18 lines
1824 bytes
Hi,

Tony a tapoté, le 31/05/2013 11:19:
> Indeed, as I said in my original post to which you've replied,
> 
> "I need to upgrade that machine to Wheezy, but that means either turning
> off perl filtering (which isn't too bad on that machine), or, migrating to
> the LFS version."


Turning off perl filtering is only for readers.
Cleanfeed may filter after posting?



-- 
Stéphane	<http://pasdenom.info/fortune/?>
Sorry for my bad English.
Re: INN2 - 32bit - Wheezy
#85511
Author: Tony
Date: Fri, 31 May 2013 10:06
22 lines
1996 bytes
On 2013-05-31, yamo' <yamo@beurdin.invalid> wrote:
> Hi,
>
> Tony a tapot?, le 31/05/2013 11:19:
>> Indeed, as I said in my original post to which you've replied,
>> 
>> "I need to upgrade that machine to Wheezy, but that means either turning
>> off perl filtering (which isn't too bad on that machine), or, migrating to
>> the LFS version."
>
>
> Turning off perl filtering is only for readers.
> Cleanfeed may filter after posting?

I use filter_nnrpd.pl.

-- 
Tony Evans
Saving trees and wasting electrons since 1993
blog  -> http://perceptionistruth.com/
books -> http://www.bookthing.co.uk/
[ anything below this line wasn't written by me ]
Re: INN2 - 32bit - Wheezy
#85527
Author: Julien ÉLIE
Date: Mon, 03 Jun 2013 19:00
32 lines
2333 bytes
Hi all,

> So it seems that INN2 on Wheezy (32bit) doesn't work if you try and enable
> any perl filtering.

Has anyone tested to change in nnrpd/perl.c the following line:

   sv_setsv(body, &PL_sv_undef);

to

   body = &PL_sv_undef;

?


Maybe nnrpd posting filter works fine with this change.  It does not 
manipulate on-disk data as far as I can see but only on-memory strings.

innd filter do not call &PL_sv_undef, and we found out in
   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=655748
that it is exactly this call to sv_setsv() that triggers the error in 
nnrpd filter.  So it could be worthwhile tring this change and checks if 
everything is OK with it.
Then, if that is the case, releasing an update of the inn2 package for 
Wheezy will hopefully deal with this annoying issue.

-- 
Julien ÉLIE

« A program should always respond to the user in the way that
   astonishes him least. » (Plauger's Law of Least Astonishment)
Re: INN2 - 32bit - Wheezy
#85545
Author: Tony
Date: Sat, 08 Jun 2013 12:31
28 lines
2609 bytes
In news.software.nntp, Russ Allbery <rra@stanford.edu> wrote:

>Tony <tony@darkstorm.invalid> writes:
>> In news.software.nntp, Russ Allbery <rra@stanford.edu> wrote:
>
>>> Are all the articles stored in tradspool or timehash?  If so, you can
>>> just rebuild history and overview from tradspool and you should be
>>> okay.
>
>> Ah excellent, I used tradspool in this instance.  So I should be okay
>> just to remove inn, do the upgrade to Wheezy, install inn2-lfs, and then
>> rebuild history/overview before starting inn.
>
>Yes, that should work.  I would back the files up first just in case.

It did work, but it took much, much longer than I expected, in part due to
a very slow drive.  I hadn't realised quite how slow it was until I tried
to copy the old news spool off it.  Then, 3/4's of the way through the
first history rebuild, my session died (both machines on my local LAN,
didn't think I would need to use screen, oh well).

Still, it's all done and dusted now.
-- 
Tony Evans
Saving trees and wasting electrons since 1993
blog  -> http://perceptionistruth.com/
books -> http://www.bookthing.co.uk/
[ anything below this line wasn't written by me ]
Re: INN2 - 32bit - Wheezy
#85589
Author: Martin Burmester
Date: Mon, 17 Jun 2013 17:50
37 lines
2398 bytes
Hi,

Am 03.06.2013 21:00, schrieb Julien ÉLIE:
> Hi all,
>
>> So it seems that INN2 on Wheezy (32bit) doesn't work if you try and
>> enable
>> any perl filtering.
>
> Has anyone tested to change in nnrpd/perl.c the following line:
>
>    sv_setsv(body, &PL_sv_undef);
>
> to
>
>    body = &PL_sv_undef;
>
> ?
>
>
> Maybe nnrpd posting filter works fine with this change.  It does not
> manipulate on-disk data as far as I can see but only on-memory strings.
>
> innd filter do not call &PL_sv_undef, and we found out in
>    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=655748
> that it is exactly this call to sv_setsv() that triggers the error in
> nnrpd filter.  So it could be worthwhile tring this change and checks if
> everything is OK with it.
> Then, if that is the case, releasing an update of the inn2 package for
> Wheezy will hopefully deal with this annoying issue.

Did anyone try if that works?

Cheers,
	Martin

Re: INN2 - 32bit - Wheezy
#85631
Author: Tony
Date: Mon, 17 Jun 2013 18:27
87 lines
3729 bytes
In news.software.nntp, Martin Burmester <martin@burmester.org> wrote:

>Am 03.06.2013 21:00, schrieb Julien ÉLIE:

>> Has anyone tested to change in nnrpd/perl.c the following line:
>>
>>    sv_setsv(body, &PL_sv_undef);
>>
>> to
>>
>>    body = &PL_sv_undef;

>Did anyone try if that works?

Yes, it works.

I got the source for inn2, modified nnrpd/perl.c as suggested,

root@xwing:~/build/inn2-2.5.3# fakeroot debian/rules binary
<snip>

root@xwing:~/build# dpkg -i inn2-inews_2.5.3-3_i386.deb
then
root@xwing:~/build# dpkg -i inn2_2.5.3-3_i386.deb

root@xwing:/etc/news# telnet 127.0.0.1 119
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
200 server.example.net InterNetNews server INN 2.5.3 ready (transit mode)
mode reader
200 server.example.net InterNetNews NNRP server INN 2.5.3 ready (posting
ok)
post
340 Ok, recommended message-ID <kpnk00$t4e$1@xwing.darkstorm.co.uk>
From: Tony <tony@darkstorm.invalid>
Newsgroups: local.test
Subject: test6

test6
- --
Tony Evans
Saving trees and wasting electrons since 1993
blog  -> http://perceptionistruth.com/
books -> http://www.bookthing.co.uk/
[ anything below this line wasn't written by me ]

..
240 Article received <kpnk00$t4e$1@xwing.darkstorm.co.uk>
quit
205 Bye!
Connection closed by foreign host.

I then apt-get removed inn2, and re-installed straight from the Debian
repository,

root@xwing:/etc/news# telnet 127.0.0.1 119
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
200 server.example.net InterNetNews server INN 2.5.3 ready (transit mode)
mode reader
200 server.example.net InterNetNews NNRP server INN 2.5.3 ready (posting
ok)
post
340 Ok, recommended message-ID <kpnk5h$bd$1@xwing.darkstorm.co.uk>
From: Tony <tony@darkstorm.invalid>
Newsgroups: local.test
Subject: dfgsdfg

dfgdfgsdg
- --
Tony Evans
Saving trees and wasting electrons since 1993
blog  -> http://perceptionistruth.com/
books -> http://www.bookthing.co.uk/
[ anything below this line wasn't written by me ]
..
Bizarre copy of UNKNOWN.
Connection closed by foreign host.

-- 
Tony Evans
Saving trees and wasting electrons since 1993
blog  -> http://perceptionistruth.com/
books -> http://www.bookthing.co.uk/
[ anything below this line wasn't written by me ]
Re: INN2 - 32bit - Wheezy
#85641
Author: Julien ÉLIE
Date: Wed, 19 Jun 2013 17:17
19 lines
1863 bytes
Hi Tony,

>>> Has anyone tested to change in nnrpd/perl.c the following line:
>>>
>>>     sv_setsv(body, &PL_sv_undef);
>>>
>>> to
>>>
>>>     body = &PL_sv_undef;
>> Did anyone try if that works?
> Yes, it works.

Oh, that's good news!
Thanks for having tested.

-- 
Julien ÉLIE

« Aliud est celare, aliud tacere. »
Re: INN2 - 32bit - Wheezy
#85642
Author: Tony
Date: Wed, 19 Jun 2013 19:15
26 lines
2046 bytes
In news.software.nntp, Julien ÉLIE <iulius@nom-de-mon-site.com.invalid>
wrote:

>Hi Tony,
>
>>>> Has anyone tested to change in nnrpd/perl.c the following line:
>>>>
>>>>     sv_setsv(body, &PL_sv_undef);
>>>>
>>>> to
>>>>
>>>>     body = &PL_sv_undef;
>>> Did anyone try if that works?
>> Yes, it works.
>
>Oh, that's good news!
>Thanks for having tested.

No worries, I often wish I could help more with the open source projects
that I use most (like INN2).
-- 
Tony Evans
Saving trees and wasting electrons since 1993
blog  -> http://perceptionistruth.com/
books -> http://www.bookthing.co.uk/
[ anything below this line wasn't written by me ]
Re: INN2 - 32bit - Wheezy
#85793
Author: Julien ÉLIE
Date: Sat, 27 Jul 2013 14:28
109 lines
5585 bytes
Hi Russ,

> 1. Write the piece of code that no one has had a chance to write yet to
>     convert a CAF file from 32-bit to 64-bit.
> 
> The problem is that INN uses binary off_t and similar data types directly
> in the on-disk structures without any ability to detect incorrect sizes or
> convert from old formats.  (This is, obviously, a bug, but it's a bug in
> the on-disk data format and therefore rather difficult to fix.)

I am still puzzled about what should be done.

Let's consider the CAF file named <patharticles>/timecaf-02/0c/5129.CF
on my 32-bit system without LFS support.

Its header is:

00000000  43 52 4d 54 01 00 00 00  00 00 04 00 03 00 00 00  |CRMT............|
00000010  00 00 00 00 00 c2 4c 00  00 02 00 00 cc c1 1c 00  |......L.........|
00000020  cc 01 00 00 0c 08 7d b7  00 00 00 00 00 00 00 00  |......}.........|
00000030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

corresponding to:

typedef struct _CAFHEADER {
    char         Magic[4];          /* Magic Number "CRMT" */
    ARTNUM       Low;               /* lowest article in the file */
    ARTNUM       NumSlots;          /* number of articles there are room for in the TOC */
    ARTNUM       High;              /* last article actually present in the file */
    size_t       Free;              /* amount of space currently unused (freed by cancels/expires) */
    off_t        StartDataBlock;    /* offset of first article data block. */
    unsigned int BlockSize;         /* unit of allocation for CAF files. */
    size_t       FreeZoneTabSize;   /* amount of space taken up by the free zone table. */
    size_t       FreeZoneIndexSize; /* size taken up by the "index" part of the free zone table. */
    time_t       LastCleaned;       /* note time of last cleaning. */
    int          spare[3];
} CAFHEADER;

that is to say:

Magic[4] - 43 52 4d 54
Low - 01 00 00 00 (=1)
NumSlots - 00 00 04 00 (=262144)
High - 03 00 00 00 (=3)
Free - 00 00 00 00 (=0)
StartDataBlock - 00 c2 4c 00 (=5030400)
BlockSize - 00 02 00 00 (=512)
FreeZoneTabSize - cc c1 1c 00 (=1884620)
FreeZoneIndexSize - cc 01 00 00 (=460)
LastCleaned - 0c 08 7d b7 (seems broken:  =3078424588, which is Tue Jan 19 04:14:07 2038)
spare[3] - 00 00 00 00 00 00 00 00 00 00 00 00

then we have the table of free blocks.  (We'll see it later.)


Then we have TOC entries:

001cc200  00 00 00 00 00 00 00 00  00 00 00 00 00 c4 4c 00  |..............L.|
001cc210  2c 08 00 00 2a 29 0c 51  00 ce 4c 00 0a 0a 00 00  |,...*).Q..L.....|
001cc220  6c 29 0c 51 00 00 00 00  00 00 00 00 00 00 00 00  |l).Q............|
001cc230  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

corresponding to:

typedef struct _CAFTOCENT {
    off_t  Offset;
    size_t Size;
    time_t ModTime;
} CAFTOCENT;

that is to say we have here two articles.  The first one is:

Offset - 00 c4 4c 00
Size - 2c 08 00 00 (=2092)
ModTime - 2a 29 0c 51 (Fri Feb  1 21:44:26 2013)

and we properly see it at this offset:

004cc400  58 2d 52 65 63 65 69 76  65 64 3a 20 62 79 20 31  |X-Received: by 1|
[...]




We can check that:
  sizeof(CAFHEADER) + FreeZoneTabSize + NumSlots*sizeof(CAFTOCENT) = StartDataBlock
  52 + 1884620 + 262144*12 = 5030400

  sizeof(CAFHEADER) + FreeZoneTabSize => start of TOC entries (offset 001cc200)





My questions are related to how the CAF file is supposed to be converted for LFS.
- should ARTNUM (unsigned long) be written on 8 bytes?
- should size_t be written on 8 bytes?
- should off_t be written on 8 bytes?
- should int and be written on 8 bytes?
- should time_t be written on 8 bytes?
- my example above is from a 32-bit system where an off_t is 4 byte-long; maybe it is already 8 byte-long on other systems; in that case, should something be done for them with regards to LFS?
- should something else than a mere conversion of the CAF file be done?  (change in the source code?)

-- 
Julien ÉLIE

« – Je t'ai préparé une bonne soupe dont tu me diras des
    nouvelles, mon garçon !
  – Pour moi, ça, ce n'est pas des bonnes nouvelles ! » (Astérix)
Re: INN2 - 32bit - Wheezy
#85794
Author: Ivan Shmakov
Date: Mon, 29 Jul 2013 19:36
77 lines
3779 bytes
>>>>> Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> writes:
>>>>> Hi Russ,

 >> 1. Write the piece of code that no one has had a chance to write yet
 >> to convert a CAF file from 32-bit to 64-bit.

 >> The problem is that INN uses binary off_t and similar data types
 >> directly in the on-disk structures without any ability to detect
 >> incorrect sizes or convert from old formats.  (This is, obviously, a
 >> bug, but it's a bug in the on-disk data format and therefore rather
 >> difficult to fix.)

	Well, my guess is that some heuristics may help.  For instance,
	checking that NumSlots, if read assuming 64-bit types, is a
	"sensible" value, like:

   if (NumSlots * sizeof (CAFTOCENT) < filesize) {
     /* assume 64-bit versions of the data structures */
   } else {
     /* assume 32-bit ones */
   }

 > I am still puzzled about what should be done.

[...]

 > My questions are related to how the CAF file is supposed to be
 > converted for LFS.

 > - should ARTNUM (unsigned long) be written on 8 bytes?

 > - should size_t be written on 8 bytes?

 > - should off_t be written on 8 bytes?

	Yes.

 > - should int and be written on 8 bytes?

	No; at least the amd64 (x86-64) systems seem to use 32-bit int.

 > - should time_t be written on 8 bytes?

	Yes.

 > - my example above is from a 32-bit system where an off_t is 4
 > byte-long; maybe it is already 8 byte-long on other systems; in that
 > case, should something be done for them with regards to LFS?

 > - should something else than a mere conversion of the CAF file be
 > done?  (change in the source code?)

	First of all, I'd replace all of the above with known-size
	types, like int64_t, int32_t, etc.

	Naturally, in order to preserve compatibility, /both/ 32-bit and
	64-bit variants of CAFHEADER and CAFTOCENT are to be provided,
	with some code mapping them to either the "wider" or the
	"native" version.  (There, we may choose to also implement the
	byte order conversion, BTW.)

	... Though, somehow, I now see at least /three/ variants of
	these structures:

	* 32-bit, /without/ LFS: 32-bit ARTNUM, etc.;

	* 32-bit, /with/ LFS: 32-bit ARTNUM, etc.; yet 64-bit off_t;

	* 64-bit: all types 64-bit, except int.

	Then, it should be made possible for the user to choose the
	particular format.  And besides of solving the compatibility
	issue at hand, this may also allow one to save a few bytes by
	using the "narrower" version of the format.

-- 
FSF associate member #7257	np. Wizball (high score) — Johan Andersson
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads