Bug 167361 - [patch] pmcstat(8) crashed if symbols found (striped image)
Summary: [patch] pmcstat(8) crashed if symbols found (striped image)
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: Gleb Smirnoff
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-27 13:30 UTC by slw
Modified: 2012-06-05 21:10 UTC (History)
0 users

See Also:


Attachments
file.diff (308 bytes, patch)
2012-04-27 13:30 UTC, slw
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description slw 2012-04-27 13:30:11 UTC
pmcstat try to load symbols from striped files and crashed at pmcstat_log.c:592 (symptr is NULL).

Fix: patch pmcstat_log.c

Patch attached with submission follows:
How-To-Repeat: Run pmcstat on system with striped world.
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2012-05-13 23:25:02 UTC
Responsible Changed
From-To: freebsd-bugs->eadler

I'll take it.
Comment 2 dfilter service freebsd_committer freebsd_triage 2012-06-05 21:09:14 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"
Comment 3 Gleb Smirnoff freebsd_committer freebsd_triage 2012-06-05 21:09:33 UTC
State Changed
From-To: open->closed

Committed, thanks! 


Comment 4 Gleb Smirnoff freebsd_committer freebsd_triage 2012-06-05 21:09:33 UTC
Responsible Changed
From-To: eadler->glebius

Committed, thanks!