misc/93178: patch for portmanager crash when trying to remove a MOVED port with -y option

Eric eric7wang at gmail.com
Sat Feb 11 03:50:05 PST 2006


>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 at 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:


More information about the freebsd-bugs mailing list