Page 1 of 1

Patched perl for redhat distros

Posted: Fri Aug 29, 2008 9:39 am
by jeremiah
Hello,

Well, first do you think that qmail-scanner & spamassassin are very much slowed down by this 'bless' perl bug?
https://bugzilla.redhat.com/show_bug.cgi?id=379791

If so, how about a patch:)

I'm happy to help, if you think the patch would speed things up, since I know you're busy (who isn't). Just point me in the right direction - I've just got cos5 boxes though... and 64bit at that, but let me know.

Thanks!

Posted: Fri Aug 29, 2008 9:47 am
by scott
Have you ever done an RPM before? Its not that hard, I can walk you through it

Posted: Fri Aug 29, 2008 10:56 am
by jeremiah
I'm down. Never built one from source before, just src.rpms.

I think some of the centos/other(edit: read 'scientific linux') folks are going to try putting together perl5.10 in the extras(edit: read 'Plus') repo, but don't know how long that'll be.

Should I grab that version's source and the patch?

Posted: Fri Aug 29, 2008 2:15 pm
by scott
Grab the src.rpm from centos first, then look up all the patches needed for this fix. I saw this guys page documenting them (I'm not sure if this is all of them):

http://use.perl.org/~nicholas/journal/37274

Then you'll just need to add them into the .spec file, in the Patch and %patch sections, and rebuild.

Posted: Fri Aug 29, 2008 2:58 pm
by jeremiah
Ok, stupid question... the spec file is a separate entity from the src.rpm right? If so, where do I get it? I found the src.rpm ok at http://mirror.centos.org/centos/5.2/os/SRPMS/. Then googled but can't seem to find it...

Thanks for the guidance.

Posted: Fri Aug 29, 2008 3:57 pm
by scott
Yup, the .spec is inside the src.rpm. Just install it with rpm -Uvh and look for it in /usr/src/redhat/SPECS/

Posted: Mon Sep 01, 2008 1:53 am
by jeremiah
Thanks for that, I got the spec file and might have added the patches properly...

Having a problem when trying to build the rpm with mock though.
(x86_64 / mock-0.6.13-1.el5.centos.1)

I installed the perl src.rpm with rpm -Uvh, modified the spec file and am using a default mock cfg (copied).
When I run mock -r el5-x86_64 perl-5.8.8-10.el5_0.2.src.rpm I continue to get this error

Code: Select all

Traceback (most recent call last):
  File "/usr/libexec/mock-yum", line 12, in ?
...
  File "/usr/lib/python2.4/site-packages/yum/rpmtrans.py", line 355, in _instOpenFile
OSError: [Errno 2] No such file or directory: '/var/lib/mock/epel-5-x86_64/root/var/cache/yum/os/packages/python-2.4.3-21.el5.x86_64.rpm'

Error performing yum command: /usr/sbin/mock-helper yum --installroot /var/lib/mock/epel-5-x86_64/root install buildsys-build
...
Even though...

Code: Select all

-rw-r--r-- 1 root mock 6236478 Jun 15 07:01 /var/lib/mock/epel-5-x86_64/root/var/cache/yum/os/packages/python-2.4.3-21.el5.x86_64.rpm
I tried downloading a fresh copy of the python rpm to that location, but no diff.
When I installed the perl src.rpm I got errors about user and group mockbuild not existing, but assumed those were ok to ignore - is that right?

Is the mock cfg here a good example of what I should use (wondering about the repos in particular)? - http://www.atomicorp.com/Tutorials/Building%20RPMS/.

So, the patches... Comparing the existing patch files to what I got from http://use.perl.org/~nicholas/journal/37274 I see the existing files have a different diff format... all I did was paste the diffs linked to from the perl.org page into a file for each (perl-5.8.8-bsXXXX.patch in SOURCES)... is that it? Also, any patch naming convention I'm violating?

Thanks!

[UPDATE]
Now that I've looked in my logs... it seems grsec was blocking rpm -q for that user. Now that's out of the way the build process completes but one of the tests fails

Code: Select all

lib/Benchmark.............................#   Failed test 'is 960 within 0.4 of estimate (1461.33)'
#   in ../lib/Benchmark.t at line 80.
# Looks like you failed 1 test of 194.
FAILED at test 13
I'm not sure what the Benchmark test tests, but imagine my patches didn't work or the performance bug wasn't fixed with them?
Will look into it later, now for some r&r 8)

Posted: Tue Sep 02, 2008 10:42 am
by scott
The following is the test code for the function. A normal perl should do that in less than a second.

Code: Select all

#!/usr/bin/perl
use overload q(<) => sub {};
my %h;
for (my $i=0; $i<50000; $i++) {
   $h{$i} = bless [ ] => 'main';
      print STDERR '.' if $i % 1000 == 0;
      }

Posted: Thu Sep 04, 2008 2:07 pm
by jeremiah
Ok, thanks. So I have gone back to the beginning now (after getting more time to work on this). I found that all I did at first was build an rpm from the same src.rpm I downloaded... Think I've got the rhythm now: install src.rpm, create patch files, edit spec file, *rebuild src.rpm*, build rpm... Abort,Retry,Fail... he he fun stuff.

My patches do indeed need to be in unified format, but I can't figure out how to get them there from what's linked to from here http://use.perl.org/~nicholas/journal/37274.

It seems there should be a tool somewhere to utilize the patches as provided... what am I missing?

[UPDATE]
...patch, I was missing patch...

I got some messages about 4 out of 7 chunks failing when applying one of the patches - do I need to apply these changes manually or what happens in these cases?

One patch worked, so I don't think I'm too far off, but...
Here's how I'm using patch:

Code: Select all

patch -z .orig -p1 -i bs32016.diff