From nobody@FreeBSD.org  Fri Apr 27 12:27:53 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 32F0E106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 27 Apr 2012 12:27:53 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 1E4D58FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 27 Apr 2012 12:27:53 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q3RCRqV7053017
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 27 Apr 2012 12:27:52 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q3RCRq3K053016;
	Fri, 27 Apr 2012 12:27:52 GMT
	(envelope-from nobody)
Message-Id: <201204271227.q3RCRq3K053016@red.freebsd.org>
Date: Fri, 27 Apr 2012 12:27:52 GMT
From: Slawa Olhovchenkov <slw@zxy.spb.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: pmcstat crashed if symbols found (striped image)
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         167361
>Category:       bin
>Synopsis:       [patch] pmcstat(8) crashed if symbols found (striped image)
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    glebius
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 27 12:30:11 UTC 2012
>Closed-Date:    Tue Jun 05 20:09:54 UTC 2012
>Last-Modified:  Tue Jun  5 20:10:13 UTC 2012
>Originator:     Slawa Olhovchenkov
>Release:        10-CURRENT
>Organization:
>Environment:
FreeBSD  10.0-CURRENT FreeBSD 10.0-CURRENT #18: Tue Apr 24 16:42:14 MSK 2012     root@:/usr/obj/usr/src/sys/NETMAP  amd64

>Description:
pmcstat try to load symbols from striped files and crashed at pmcstat_log.c:592 (symptr is NULL).

>How-To-Repeat:
Run pmcstat on system with striped world.

>Fix:
patch pmcstat_log.c

Patch attached with submission follows:

--- pmcstat_log.c.orig	2012-04-27 15:50:05.000000000 +0400
+++ pmcstat_log.c	2012-04-27 15:50:56.000000000 +0400
@@ -565,6 +565,8 @@
 	image->pi_symcount += newsyms;
 
 	assert(newsyms <= nfuncsyms);
+	if(image->pi_symcount == 0)
+	    return;
 
 	/*
 	 * Return space to the system if there were duplicates.


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->eadler 
Responsible-Changed-By: eadler 
Responsible-Changed-When: Sun May 13 22:25:02 UTC 2012 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=167361 
State-Changed-From-To: open->closed 
State-Changed-By: glebius 
State-Changed-When: Tue Jun 5 20:09:33 UTC 2012 
State-Changed-Why:  
Committed, thanks! 


Responsible-Changed-From-To: eadler->glebius 
Responsible-Changed-By: glebius 
Responsible-Changed-When: Tue Jun 5 20:09:33 UTC 2012 
Responsible-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=167361 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/167361: commit references a PR
Date: Tue,  5 Jun 2012 20:09:14 +0000 (UTC)

 Author: glebius
 Date: Tue Jun  5 20:08:59 2012
 New Revision: 236634
 URL: http://svn.freebsd.org/changeset/base/236634
 
 Log:
   Don't crash trying to load symbols from striped file.
   
   PR:		bin/167361
   Submitted by:	Slawa Olhovchenkov <slw zxy.spb.ru>
   Silence from:	jkoshy
 
 Modified:
   head/usr.sbin/pmcstat/pmcstat_log.c
 
 Modified: head/usr.sbin/pmcstat/pmcstat_log.c
 ==============================================================================
 --- head/usr.sbin/pmcstat/pmcstat_log.c	Tue Jun  5 19:59:09 2012	(r236633)
 +++ head/usr.sbin/pmcstat/pmcstat_log.c	Tue Jun  5 20:08:59 2012	(r236634)
 @@ -564,6 +564,8 @@ pmcstat_image_add_symbols(struct pmcstat
  	}
  
  	image->pi_symcount += newsyms;
 +	if (image->pi_symcount == 0)
 +		return;
  
  	assert(newsyms <= nfuncsyms);
  
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
