Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Feb 2006 11:41:31 GMT
From:      Eric <eric7wang@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/93178: patch for portmanager crash when trying to remove a MOVED port with -y option
Message-ID:  <200602111141.k1BBfVYQ006472@www.freebsd.org>
Resent-Message-ID: <200602111150.k1BBo4vl075687@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         93178
>Category:       misc
>Synopsis:       patch for portmanager crash when trying to remove a MOVED port with -y option
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 11 11:50:03 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Eric
>Release:        RELENG_6
>Organization:
>Environment:
FreeBSD mybsd.mydomain.test 6.1-PRERELEASE FreeBSD 6.1-PRERELEASE #10: Fri Feb 10 01:45:19 EST 2006    root@mybsd.mydomain.test:/uu/obj/uu/src/sys/MYKERNEL  i386
        
>Description:
portmanager -v:
rParseCommandLine 0.4.1_4

portmanager will always crash (bus error) when:
-y option is provided, and
an installed port was moved to other category, so portmanager trying to remove it.

BackTrace shows the error happends at line 183 in libMGPM/src/MGPMrGetPortName.c
>How-To-Repeat:
execute: portmanager -u -bu -l -y
and you have one installed port (ex, tomcat)  which was moved to another category.


portmanager will crash during cache building stage.






>Fix:
Patch: 
(This is the first time I submit PR, so not sure if this is correct)
--------PATCH START---------
--- libMGPM/src/MGPMrGetPortName.c      Wed Dec 14 10:27:41 2005
+++ libMGPM/src/MGPMrGetPortName2.c     Fri Feb 10 21:43:34 2006
@@ -180,7 +180,8 @@
                        }
                        else
                        {
-                               fclose( property->STDIN );
+                               if( property->autoMoved == 0 )
+                                       fclose( property->STDIN );
                                MGPMlogAdd( property, "installed ", portName,
                                        " removed from system:  no longer in ports tree:  see /usr/ports/MOVED", " ", " " );                        }
--------PATCH END-----------
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200602111141.k1BBfVYQ006472>