Date: Tue, 12 Jan 2010 11:01:07 GMT From: Luca Pizzamiglio <luca.pizzamiglio@gmail.com> To: freebsd-gnats-submit@FreeBSD.org Subject: i386/142742: pmcstat segmentation fault with Intel Core CPU Message-ID: <201001121101.o0CB174V038763@www.freebsd.org> Resent-Message-ID: <201001121110.o0CBA1Pa025493@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 142742 >Category: i386 >Synopsis: pmcstat segmentation fault with Intel Core CPU >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-i386 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jan 12 11:10:00 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Luca Pizzamiglio >Release: 7-STABLE >Organization: >Environment: FreeBSD pcXX.xxxx.de 7.2-STABLE FreeBSD 7.2-STABLE #0 r2462M: Tue Dec 22 12:31:48 CET 2009 root@pcXX.xxxx.de:/usr/obj/usr/home/prog/svnsys/src_7stable/sys/BW7Dev i386 >Description: pmcstat utility crashes with a segmentation fault. I've analyzed the problem that resides in the libpmc library. For INTEL CORE architecture (PMC_CPU_INTEL_CORE), initialization of the pmc_class_table[] array of lib/libpmc/libpmc.c is not completed and this causes the segmentation fault during the use of the pmcstat utility. The CPU I'm using now has the follow level 1 CPUID: cpuid level 0x1: 0x000006ec 0x00010800 0x0000c109 0xafe9fbff that means: Family 0x600 and Model 0x0e >How-To-Repeat: Running pmcstat with an INTEL CORE CPU. The problem appears both in sampling and counting mode. >Fix: I propose a patch to solve this problem: I've tested a bit and seems to work. This patch corrects the set up of the pmc_class_table[] array of lib/libpmc/libpmc.c when a PMC_CPU_INTEL_CORE CPU is recognized. Patch attached with submission follows: --- lib/libpmc/libpmc.c.orig 2010-01-11 16:43:47.000000000 +0100 +++ lib/libpmc/libpmc.c 2010-01-11 16:43:59.000000000 +0100 @@ -2507,6 +2507,7 @@ break; case PMC_CPU_INTEL_CORE: PMC_MDEP_INIT(core); + pmc_class_table[n] = &core_class_table_descr; break; case PMC_CPU_INTEL_CORE2: case PMC_CPU_INTEL_CORE2EXTREME: >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001121101.o0CB174V038763>