Bug 2268 - Wrong frequency setting for ITIMER_PROF
Summary: Wrong frequency setting for ITIMER_PROF
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Dwayne Grant McConnell
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-03 21:22 UTC by H.J. Lu
Modified: 2018-04-19 13:55 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2006-02-03 21:22:21 UTC
sysdeps/posix/profil.c has

  timer.it_value.tv_sec = 0;
  timer.it_value.tv_usec = 1;
  timer.it_interval = timer.it_value;
  return __setitimer (ITIMER_PROF, &timer, otimer_ptr);

That sets ITIMER_PROF with 1 microsecond interval. Kernel will try to deliver a
SIGPROF signal every microsecond. Depending on other factors, a process may
get anywhere from __profile_frequency () to 1000000 SIGPROF signals per second.
Comment 1 Sourceware Commits 2006-02-03 22:28:36 UTC
Subject: Bug 2268

CVSROOT:	/cvs/glibc
Module name:	libc
Changes by:	roland@sources.redhat.com	2006-02-03 22:28:32

Modified files:
	sysdeps/posix  : profil.c 

Log message:
	2006-02-03  Roland McGrath  <roland@redhat.com>
	
	[BZ #2268]
	* sysdeps/posix/profil.c (__profil): Use __profile_frequency to choose
	timer interval, don't assume smallest possible interval is it.

Patches:
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/posix/profil.c.diff?cvsroot=glibc&r1=1.13&r2=1.14

Comment 2 Dwayne Grant McConnell 2006-02-07 18:25:34 UTC
Do you (H.J.) have a small testcase for this? I'm wanting to put one in the
glibc tests.
Comment 3 H.J. Lu 2006-02-07 18:37:53 UTC
I don't have a small testcase. The only thing I have needs icc and MKL.
Comment 4 Ulrich Drepper 2006-05-01 18:35:32 UTC
According to the changelog entry this should be fixed.