Bug 91209 - Problem with portupgrade 2.0
Summary: Problem with portupgrade 2.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-02 08:30 UTC by Darin Martin
Modified: 2006-01-02 12:20 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Martin 2006-01-02 08:30:08 UTC
portupgrade hangs on certain ports.. Not all though.. It spins up and chews up most free memory on the system, then fails with the following errors:

/usr/local/lib/ruby/site_ruby/1.8/portsdb.rb:89:in `<<': failed to allocate memory (NoMemoryError)
        from /usr/local/lib/ruby/site_ruby/1.8/portsdb.rb:89:in `trace'
        from /usr/local/sbin/pkgdb:648:in `tracing_deorigin'
        from /usr/local/sbin/pkgdb:663:in `guess_dep'
        from /usr/local/sbin/pkgdb:578:in `fix_dependencies'
        from /usr/local/sbin/pkgdb:565:in `each'
        from /usr/local/sbin/pkgdb:565:in `fix_dependencies'
        from /usr/local/sbin/pkgdb:340:in `fix_db_phase1'
        from /usr/local/sbin/pkgdb:336:in `each'
        from /usr/local/sbin/pkgdb:336:in `fix_db_phase1'
        from /usr/local/sbin/pkgdb:286:in `fix_db'
        from /usr/local/sbin/pkgdb:232:in `main'
        from /usr/local/sbin/pkgdb:65:in `initialize'
        from /usr/local/sbin/pkgdb:65:in `new'
        from /usr/local/sbin/pkgdb:65:in `main'
        from /usr/local/sbin/pkgdb:1044

Fix: 

Have been unable to find a fix yet.
How-To-Repeat: 'portupgrade php4' will cause it to happen

I have uninstalled portupgrade, ruby18, and ruby18-bdb1 and completely reinstalled.
I have changed my portupdate script to use portsdb -F
I have also removed /var/db/pkg/pkgdb.db and run pkgdb -Fu to rebuild the database.

I have also removed the php4 directory in /var/db and manually reinstalled the port with make/make install in case there was corruption in those files.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2006-01-02 08:49:19 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback
Comment 2 KOMATSU Shinichiro 2006-01-02 10:49:25 UTC
Thank you for reporting. I also discovered this problem a few hours ago.

The source of this trouble is that the following line exists in MOVED,

    lang/php4|lang/php4|2003-05-22|re-separated from www/mod_php4

where "moved from" and "moved to" is the same,
but portupgrade does not check this case and infinite loop occurs.

Fix to this problem will be in the next portupgrade release,
but in the meanwhile, whould you commit the following patch, please?

Thanks.


diff --exclude=CVS --exclude=*.log* -urN portupgrade.old/Makefile portupgrade/Makefile
--- portupgrade.old/Makefile	Mon Jan  2 00:43:35 2006
+++ portupgrade/Makefile	Mon Jan  2 19:32:09 2006
@@ -7,7 +7,7 @@
 
 PORTNAME=	portupgrade
 PORTVERSION=	2.0.0
-PORTREVISION=	0
+PORTREVISION=	1
 PORTEPOCH=	1
 CATEGORIES=	sysutils
 MASTER_SITES=	http://dists.lovepeers.org/distfiles/portupgrade/
diff --exclude=CVS --exclude=*.log* -urN portupgrade.old/files/patch-lib-portsdb.rb portupgrade/files/patch-lib-portsdb.rb
--- portupgrade.old/files/patch-lib-portsdb.rb	Thu Jan  1 09:00:00 1970
+++ portupgrade/files/patch-lib-portsdb.rb	Mon Jan  2 19:31:29 2006
@@ -0,0 +1,18 @@
+Index: lib/portsdb.rb
+===================================================================
+--- lib/portsdb.rb	(revision 54)
++++ lib/portsdb.rb	(revision 59)
+@@ -87,8 +87,11 @@
+       while true
+ 	if moved = @moved[me]
+ 	  t << moved
+-	  me = moved.to
+-	  break if me.nil?
++	  if me.nil? or me == moved.to
++	    break
++	  else
++	    me = moved.to
++	  end
+ 	else
+ 	  break
+ 	end
Comment 3 Edwin Groothuis freebsd_committer freebsd_triage 2006-01-02 11:03:47 UTC
State Changed
From-To: feedback->closed

Committed, thanks!
Comment 4 Darin Martin 2006-01-02 12:16:10 UTC
The fix worked perfectly.. Thanks a million!

Darin -

KOMATSU Shinichiro wrote:

>Thank you for reporting. I also discovered this problem a few hours ago.
>
>The source of this trouble is that the following line exists in MOVED,
>
>    lang/php4|lang/php4|2003-05-22|re-separated from www/mod_php4
>
>where "moved from" and "moved to" is the same,
>but portupgrade does not check this case and infinite loop occurs.
>
>Fix to this problem will be in the next portupgrade release,
>but in the meanwhile, whould you commit the following patch, please?
>
>Thanks.
>
>
>diff --exclude=CVS --exclude=*.log* -urN portupgrade.old/Makefile portupgrade/Makefile
>--- portupgrade.old/Makefile	Mon Jan  2 00:43:35 2006
>+++ portupgrade/Makefile	Mon Jan  2 19:32:09 2006
>@@ -7,7 +7,7 @@
> 
> PORTNAME=	portupgrade
> PORTVERSION=	2.0.0
>-PORTREVISION=	0
>+PORTREVISION=	1
> PORTEPOCH=	1
> CATEGORIES=	sysutils
> MASTER_SITES=	http://dists.lovepeers.org/distfiles/portupgrade/
>diff --exclude=CVS --exclude=*.log* -urN portupgrade.old/files/patch-lib-portsdb.rb portupgrade/files/patch-lib-portsdb.rb
>--- portupgrade.old/files/patch-lib-portsdb.rb	Thu Jan  1 09:00:00 1970
>+++ portupgrade/files/patch-lib-portsdb.rb	Mon Jan  2 19:31:29 2006
>@@ -0,0 +1,18 @@
>+Index: lib/portsdb.rb
>+===================================================================
>+--- lib/portsdb.rb	(revision 54)
>++++ lib/portsdb.rb	(revision 59)
>+@@ -87,8 +87,11 @@
>+       while true
>+ 	if moved = @moved[me]
>+ 	  t << moved
>+-	  me = moved.to
>+-	  break if me.nil?
>++	  if me.nil? or me == moved.to
>++	    break
>++	  else
>++	    me = moved.to
>++	  end
>+ 	else
>+ 	  break
>+ 	end
>
>
>!DSPAM:43b9077f21913682442798!
>
>  
>