Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 231528 - stabilize =dev-lang/php-5.2.6-r7 because of USE=snmp memory leaks
Summary: stabilize =dev-lang/php-5.2.6-r7 because of USE=snmp memory leaks
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High enhancement (vote)
Assignee: PHP Bugs
URL: http://bugs.php.net/45405
Whiteboard:
Keywords: STABLEREQ
Depends on:
Blocks:
 
Reported: 2008-07-11 20:16 UTC by Federico Cuello
Modified: 2008-11-09 11:47 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Fix snmp memory leak (php-ext-snmp-fix-leaks.patch,2.66 KB, text/plain)
2008-07-11 20:17 UTC, Federico Cuello
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Federico Cuello 2008-07-11 20:16:43 UTC
The snmp extension has many memory leaks. The bug is reported uptream at http://bugs.php.net/45405

I've fixed it and there is a patch included.
Comment 1 Federico Cuello 2008-07-11 20:17:45 UTC
Created attachment 160139 [details]
Fix snmp memory leak

Applies against latest php
Comment 2 Christian Hoffmann (RETIRED) gentoo-dev 2008-07-19 13:35:17 UTC
In general it's fine to include such patches in our patchsets, but I'd prefer to see a comment from upstream about the proposed patch first.
Comment 3 Christian Hoffmann (RETIRED) gentoo-dev 2008-08-11 14:31:34 UTC
It's part of php-5.2.6-r7 which you can find in the php-testing overlay available via layman. Will probably go into the official tree when the next major php-patchset update happens (probably security-related).

Just for reference, I took the latest patch from the upstream bug (after lots of whitespace cleanup....).

Please test and report back.
Comment 4 Rodrigo Campos 2008-08-12 02:26:04 UTC
(In reply to comment #3)
> It's part of php-5.2.6-r7 which you can find in the php-testing overlay
> available via layman. Will probably go into the official tree when the next
> major php-patchset update happens (probably security-related).

Thanks a lot!

> 
> Just for reference, I took the latest patch from the upstream bug (after lots
> of whitespace cleanup....).

Yeah, i didn't find a way to upload a file in that bugzilla and pasting the patch in the comment generates lots of whitespaces. Sorry I didn't upload the patch here.

> 
> Please test and report back.

As I say in the upstream bug report, we are using php with that patch applied since 15 July and we didn't find any problems yet =)

Thanks,
Rodrigo
Comment 5 Chris Gianelloni 2008-09-04 16:00:39 UTC
OK, I know that this is slated for the next patch update, but this is actually a *major* issue for anybody using packages like net-analyzer/cacti.  Is there any way that we can get this patch inclusion accelerated into the main tree?  Having "stable" packages which aren't quite so stable/usable isn't the best situation to remain in for an extended period of time.
Comment 6 Rodrigo Campos 2008-09-06 18:02:00 UTC
(In reply to comment #2)
> In general it's fine to include such patches in our patchsets, but I'd prefer
> to see a comment from upstream about the proposed patch first.
> 

I know its already applied to your svn tree. But I wanted just to let you know that it has been applied (as is) upstream (to php 6.0, 5.3 and 5.2) as you can see here:

http://marc.info/?t=122064976800003&r=1&w=2


Thanks,
Rodrigo
Comment 7 Christian Hoffmann (RETIRED) gentoo-dev 2008-09-06 20:48:56 UTC
(In reply to comment #5)
> OK, I know that this is slated for the next patch update, but this is actually
> a *major* issue for anybody using packages like net-analyzer/cacti.  Is there
> any way that we can get this patch inclusion accelerated into the main tree?
I agree, but I did not want to include a user-supplied (no offense intended!) patch, which evidently had severe problems (double frees) in its first version, to the tree without extensive testing and/or upstream approval.

> Having "stable" packages which aren't quite so stable/usable isn't the best
> situation to remain in for an extended period of time.
Just curious, but this sounds like this was a regression -- was it?

(In reply to comment #6)
> I know its already applied to your svn tree. But I wanted just to let you know
> that it has been applied (as is) upstream (to php 6.0, 5.3 and 5.2) as you can
> see here:
> 
> http://marc.info/?t=122064976800003&r=1&w=2
Thanks for the pointer (I'm closely following both php-internals and the cvs commit lists, btw), I just didn't get to it earlier as I was / will be on vacation again.

Anyway, I moved php-5.2.6-r7 with the fix from the overlay to the main tree, so that we can stable it soon. I don't think we need to wait the full 30 days here, especially considering that the problem seems rather severe, that the only change affects only ext/snmp and that no other part of php and that this version already received some testing in the overlay.

So, thanks again to Rodrigo Campos, for cleaning up the patch and pushing this upstream!
Comment 8 Federico Cuello 2008-09-06 21:23:23 UTC
(In reply to comment #7)
> > Having "stable" packages which aren't quite so stable/usable isn't the best
> > situation to remain in for an extended period of time.
> Just curious, but this sounds like this was a regression -- was it?

It seems the leak was there from the beginning (it's present at least since 1999 as i could see from php-src CVS). I also found a report about the leak from about 2 years ago.

We hit the leak as we were developing an application that uses the extension intensively and then wrote the patch.
Comment 9 Christian Hoffmann (RETIRED) gentoo-dev 2008-09-16 15:24:38 UTC
(In reply to comment #8)
> It seems the leak was there from the beginning (it's present at least since
> 1999 as i could see from php-src CVS). I also found a report about the leak
> from about 2 years ago.
Ok, thanks.

I think it has been in the tree long enough now.

Arches, please test and stabilize:
  =dev-lang/php-5.2.6-r7

Target keywords: alpha amd64 arm hppa ia64 ppc ppc64 s390 sh sparc x86 ~x86-fbsd
Already done: amd64

We are quick-stabling because of the seriousness of the bug. In the worst case this should only break things for USE=snmp users, in the best case it'll make USE=snmp usable again by fixing the mentioned memory leaks.
Comment 10 Brent Baude (RETIRED) gentoo-dev 2008-09-16 18:05:01 UTC
ppc and ppc64 done
Comment 11 Markus Meier gentoo-dev 2008-09-20 13:17:28 UTC
x86 stable
Comment 12 Raúl Porcel (RETIRED) gentoo-dev 2008-09-21 15:58:20 UTC
alpha/ia64/sparc stable
Comment 13 Jeroen Roovers (RETIRED) gentoo-dev 2008-09-22 03:26:37 UTC
Stable for HPPA.