From nobody@FreeBSD.org  Wed May  6 00:49:19 2009
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 7A7D31065675
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  6 May 2009 00:49:19 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 6816D8FC27
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  6 May 2009 00:49:19 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n460nJgW084313
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 6 May 2009 00:49:19 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n460nJvM084312;
	Wed, 6 May 2009 00:49:19 GMT
	(envelope-from nobody)
Message-Id: <200905060049.n460nJvM084312@www.freebsd.org>
Date: Wed, 6 May 2009 00:49:19 GMT
From: Yuri <yuri@tsoft.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: skype-2.0.0.72 broke with recent kernel changes in 7.2: all skype-out calls disconnect after 1 minute
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         134251
>Category:       kern
>Synopsis:       [linux] skype-2.0.0.72 broke with recent kernel changes in 7.2: all skype-out calls disconnect after 1 minute
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    dchagin
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed May 06 00:50:02 UTC 2009
>Closed-Date:    Mon Jul 05 20:25:38 UTC 2010
>Last-Modified:  Mon Jul 05 20:25:38 UTC 2010
>Originator:     Yuri
>Release:        7.2-PRERELEASE
>Organization:
n/a
>Environment:
>Description:
Looks like outgoing skype calls are broken by some kernel change between Feb 25, 2009 and Arp 25, 2009.

Symptom is that time counter of the call counts seconds with much lower than 1Hz frequency and all outgoing calls disconnect after 1 minute.

On Feb 25 it was 7.1-STABLE. On Apr 25 it's 7.2-PRERELEASE.

This is a very serious usability issue and should be fixed before 7.2 is made STABLE.

It may cause other adverse effects in other Linux apps.

>How-To-Repeat:

>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-net 
Responsible-Changed-By: remko 
Responsible-Changed-When: Wed May 6 05:04:06 UTC 2009 
Responsible-Changed-Why:  
Seems like something networking 

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

From: Chagin Dmitry <dchagin@freebsd.org>
To: Yuri <yuri@tsoft.com>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: kern/134251: skype-2.0.0.72 broke with recent kernel changes
	in 7.2: all skype-out calls disconnect after 1 minute
Date: Wed, 6 May 2009 09:00:32 +0400

 --W/nzBZO5zC0uMSeA
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 On Wed, May 06, 2009 at 12:49:19AM +0000, Yuri wrote:
 >=20
 > >Number:         134251
 > >Category:       kern
 > >Synopsis:       skype-2.0.0.72 broke with recent kernel changes in 7.2: =
 all skype-out calls disconnect after 1 minute
 > >Confidential:   no
 > >Severity:       serious
 > >Priority:       high
 > >Responsible:    freebsd-bugs
 > >State:          open
 > >Quarter:       =20
 > >Keywords:      =20
 > >Date-Required:
 > >Class:          sw-bug
 > >Submitter-Id:   current-users
 > >Arrival-Date:   Wed May 06 00:50:02 UTC 2009
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     Yuri
 > >Release:        7.2-PRERELEASE
 > >Organization:
 > n/a
 > >Environment:
 > >Description:
 > Looks like outgoing skype calls are broken by some kernel change between =
 Feb 25, 2009 and Arp 25, 2009.
 >=20
 > Symptom is that time counter of the call counts seconds with much lower t=
 han 1Hz frequency and all outgoing calls disconnect after 1 minute.
 >=20
 > On Feb 25 it was 7.1-STABLE. On Apr 25 it's 7.2-PRERELEASE.
 >=20
 > This is a very serious usability issue and should be fixed before 7.2 is =
 made STABLE.
 >=20
 > It may cause other adverse effects in other Linux apps.
 >=20
 
 Try kern.hz=3D100 (in /boot/loader.conf) and report any resalts.
 
 --=20
 Have fun!
 chd
 
 --W/nzBZO5zC0uMSeA
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.10 (FreeBSD)
 
 iEYEARECAAYFAkoBGW8ACgkQ0t2Tb3OO/O22UQCfUXT/NePexqXzR2nGKFdV1D6x
 5f0AoK+S8qNNjrIDHAyUpp9ehyqdpY57
 =iJ/Z
 -----END PGP SIGNATURE-----
 
 --W/nzBZO5zC0uMSeA--
Responsible-Changed-From-To: freebsd-net->dchagin 
Responsible-Changed-By: dchagin 
Responsible-Changed-When: Wed May 6 05:51:58 UTC 2009 
Responsible-Changed-Why:  
Grab it, bug in Linux emulation layer. linux_times() should use kern.hz 
instead of own constant. I will fix this soon. 


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

From: Yuri <yuri@rawbw.com>
To: Chagin Dmitry <dchagin@freebsd.org>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: kern/134251: skype-2.0.0.72 broke with recent kernel changes
 in 7.2: all skype-out calls disconnect after 1 minute
Date: Wed, 06 May 2009 02:07:33 -0700

 kern.hz=100 fixed the problem.
 
 Yuri
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/134251: commit references a PR
Date: Thu,  7 May 2009 14:25:02 +0000 (UTC)

 Author: dchagin
 Date: Thu May  7 14:24:50 2009
 New Revision: 191883
 URL: http://svn.freebsd.org/changeset/base/191883
 
 Log:
   Linux exports HZ value to user space via AT_CLKTCK auxiliary vector entry,
   which is available for Glibc as sysconf(_SC_CLK_TCK). If AT_CLKTCK entry is
   not exported, Glibc uses 100.
   
   linux_times() shall use the value that is exported to user space.
   
   Pointyhat to:	dchagin
   
   PR:		kern/134251
   Approved by:	kib (mentor)
   MFC after:	2 weeks
 
 Modified:
   head/sys/compat/linux/linux_misc.c
 
 Modified: head/sys/compat/linux/linux_misc.c
 ==============================================================================
 --- head/sys/compat/linux/linux_misc.c	Thu May  7 13:49:48 2009	(r191882)
 +++ head/sys/compat/linux/linux_misc.c	Thu May  7 14:24:50 2009	(r191883)
 @@ -659,9 +659,7 @@ struct l_times_argv {
  	l_clock_t	tms_cstime;
  };
  
 -#define CLK_TCK 100			/* Linux uses 100 */
 -
 -#define CONVTCK(r)	(r.tv_sec * CLK_TCK + r.tv_usec / (1000000 / CLK_TCK))
 +#define CONVTCK(r)	(r.tv_sec * hz + r.tv_usec / (1000000 / hz))
  
  int
  linux_times(struct thread *td, struct linux_times_args *args)
 _______________________________________________
 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"
 
State-Changed-From-To: open->patched 
State-Changed-By: dchagin 
State-Changed-When: Thu May 7 14:46:53 UTC 2009 
State-Changed-Why:  
Fix commited to current. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/134251: commit references a PR
Date: Thu, 28 May 2009 18:26:33 +0000 (UTC)

 Author: dchagin
 Date: Thu May 28 18:26:18 2009
 New Revision: 192987
 URL: http://svn.freebsd.org/changeset/base/192987
 
 Log:
   Merge r191883,191966,191973 from HEAD to stable/7:
   
   Linux exports HZ value to user space via AT_CLKTCK auxiliary vector
   entry since 2.4.0.
   Being exported, AT_CLKTCK is returned by sysconf(_SC_CLK_TCK),
   glibc falls back to the hard-coded CLK_TCK value when aux entry
   is not present.
   
   Glibc versions prior to 2.2.1 always use hard-coded CLK_TCK value.
   
   For older applications/libc's which depends on hard-coded CLK_TCK
   value user should set compat.linux.osrelease less than 2.4.0.
   
   linux_times() shall use the value that is exported to user space.
   
   PR:		kern/134251
   Approved by:	kib (mentor)
 
 Modified:
   stable/7/sys/   (props changed)
   stable/7/sys/amd64/linux32/linux32_sysvec.c
   stable/7/sys/compat/linux/linux_mib.h
   stable/7/sys/compat/linux/linux_misc.c
   stable/7/sys/compat/linux/linux_misc.h
   stable/7/sys/contrib/pf/   (props changed)
   stable/7/sys/dev/ath/ath_hal/   (props changed)
   stable/7/sys/dev/cxgb/   (props changed)
   stable/7/sys/i386/linux/linux_sysvec.c
 
 Modified: stable/7/sys/amd64/linux32/linux32_sysvec.c
 ==============================================================================
 --- stable/7/sys/amd64/linux32/linux32_sysvec.c	Thu May 28 18:11:09 2009	(r192986)
 +++ stable/7/sys/amd64/linux32/linux32_sysvec.c	Thu May 28 18:26:18 2009	(r192987)
 @@ -263,7 +263,17 @@ elf_linux_fixup(register_t **stack_base,
  	pos = base + (imgp->args->argc + imgp->args->envc + 2);
  
  	AUXARGS_ENTRY_32(pos, LINUX_AT_HWCAP, cpu_feature);
 -	AUXARGS_ENTRY_32(pos, LINUX_AT_CLKTCK, hz);
 +
 +	/*
 +	 * Do not export AT_CLKTCK when emulating Linux kernel prior to 2.4.0,
 +	 * as it has appeared in the 2.4.0-rc7 first time.
 +	 * Being exported, AT_CLKTCK is returned by sysconf(_SC_CLK_TCK),
 +	 * glibc falls back to the hard-coded CLK_TCK value when aux entry
 +	 * is not present.
 +	 * Also see linux_times() implementation.
 +	 */
 +	if (linux_kernver(curthread) >= LINUX_KERNVER_2004000)
 +		AUXARGS_ENTRY_32(pos, LINUX_AT_CLKTCK, stclohz);
  	AUXARGS_ENTRY_32(pos, AT_PHDR, args->phdr);
  	AUXARGS_ENTRY_32(pos, AT_PHENT, args->phent);
  	AUXARGS_ENTRY_32(pos, AT_PHNUM, args->phnum);
 @@ -1120,6 +1130,7 @@ linux_elf_modevent(module_t mod, int typ
  			    linux_proc_exec, NULL, 1000);
  			linux_szplatform = roundup(strlen(linux_platform) + 1,
  			    sizeof(char *));
 +			stclohz = (stathz ? stathz : hz);
  			if (bootverbose)
  				printf("Linux ELF exec handler installed\n");
  		} else
 
 Modified: stable/7/sys/compat/linux/linux_mib.h
 ==============================================================================
 --- stable/7/sys/compat/linux/linux_mib.h	Thu May 28 18:11:09 2009	(r192986)
 +++ stable/7/sys/compat/linux/linux_mib.h	Thu May 28 18:26:18 2009	(r192987)
 @@ -42,6 +42,7 @@ int	linux_set_oss_version(struct thread 
  
  int	linux_kernver(struct thread *td);
  
 +#define	LINUX_KERNVER_2004000		2004000
  #define	LINUX_KERNVER_2006000		2006000
  
  #define	linux_use26(t)		(linux_kernver(t) >= LINUX_KERNVER_2006000)
 
 Modified: stable/7/sys/compat/linux/linux_misc.c
 ==============================================================================
 --- stable/7/sys/compat/linux/linux_misc.c	Thu May 28 18:11:09 2009	(r192986)
 +++ stable/7/sys/compat/linux/linux_misc.c	Thu May 28 18:26:18 2009	(r192987)
 @@ -90,6 +90,8 @@ __FBSDID("$FreeBSD$");
  #include <compat/linux/linux_emul.h>
  #include <compat/linux/linux_misc.h>
  
 +int stclohz;				/* Statistics clock frequency */
 +
  #define BSD_TO_LINUX_SIGNAL(sig)	\
  	(((sig) <= LINUX_SIGTBLSZ) ? bsd_to_linux_signal[_SIG_IDX(sig)] : sig)
  
 @@ -661,9 +663,19 @@ struct l_times_argv {
  	l_clock_t	tms_cstime;
  };
  
 -#define CLK_TCK 100			/* Linux uses 100 */
  
 -#define CONVTCK(r)	(r.tv_sec * CLK_TCK + r.tv_usec / (1000000 / CLK_TCK))
 +/*
 + * Glibc versions prior to 2.2.1 always use hard-coded CLK_TCK value.
 + * Since 2.2.1 Glibc uses value exported from kernel via AT_CLKTCK
 + * auxiliary vector entry.
 + */
 +#define	CLK_TCK		100
 +
 +#define	CONVOTCK(r)	(r.tv_sec * CLK_TCK + r.tv_usec / (1000000 / CLK_TCK))
 +#define	CONVNTCK(r)	(r.tv_sec * stclohz + r.tv_usec / (1000000 / stclohz))
 +
 +#define	CONVTCK(r)	(linux_kernver(td) >= LINUX_KERNVER_2004000 ?		\
 +			    CONVNTCK(r) : CONVOTCK(r))
  
  int
  linux_times(struct thread *td, struct linux_times_args *args)
 
 Modified: stable/7/sys/compat/linux/linux_misc.h
 ==============================================================================
 --- stable/7/sys/compat/linux/linux_misc.h	Thu May 28 18:11:09 2009	(r192986)
 +++ stable/7/sys/compat/linux/linux_misc.h	Thu May 28 18:26:18 2009	(r192987)
 @@ -65,4 +65,6 @@ extern const char *linux_platform;
  #define	__LINUX_NPXCW__		0x37f
  #endif
  
 +extern int stclohz;
 +
  #endif	/* _LINUX_MISC_H_ */
 
 Modified: stable/7/sys/i386/linux/linux_sysvec.c
 ==============================================================================
 --- stable/7/sys/i386/linux/linux_sysvec.c	Thu May 28 18:11:09 2009	(r192986)
 +++ stable/7/sys/i386/linux/linux_sysvec.c	Thu May 28 18:26:18 2009	(r192987)
 @@ -257,7 +257,17 @@ elf_linux_fixup(register_t **stack_base,
  	pos = *stack_base + (imgp->args->argc + imgp->args->envc + 2);
  
  	AUXARGS_ENTRY(pos, LINUX_AT_HWCAP, cpu_feature);
 -	AUXARGS_ENTRY(pos, LINUX_AT_CLKTCK, hz);
 +
 +	/*
 +	 * Do not export AT_CLKTCK when emulating Linux kernel prior to 2.4.0,
 +	 * as it has appeared in the 2.4.0-rc7 first time.
 +	 * Being exported, AT_CLKTCK is returned by sysconf(_SC_CLK_TCK),
 +	 * glibc falls back to the hard-coded CLK_TCK value when aux entry
 +	 * is not present.
 +	 * Also see linux_times() implementation.
 +	 */
 +	if (linux_kernver(curthread) >= LINUX_KERNVER_2004000)
 +		AUXARGS_ENTRY(pos, LINUX_AT_CLKTCK, stclohz);
  	AUXARGS_ENTRY(pos, AT_PHDR, args->phdr);
  	AUXARGS_ENTRY(pos, AT_PHENT, args->phent);
  	AUXARGS_ENTRY(pos, AT_PHNUM, args->phnum);
 @@ -1091,6 +1101,7 @@ linux_elf_modevent(module_t mod, int typ
  			linux_get_machine(&linux_platform);
  			linux_szplatform = roundup(strlen(linux_platform) + 1,
  			    sizeof(char *));
 +			stclohz = (stathz ? stathz : hz);
  			if (bootverbose)
  				printf("Linux ELF exec handler installed\n");
  		} else
 _______________________________________________
 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"
 
State-Changed-From-To: patched->closed 
State-Changed-By: dchagin 
State-Changed-When: Mon Jul 5 20:24:31 UTC 2010 
State-Changed-Why:  

Feedback timeout. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=134251 
>Unformatted:
