From owner-freebsd-threads@FreeBSD.ORG Fri Jul 19 12:10:00 2013 Return-Path: Delivered-To: freebsd-threads@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D4944B86 for ; Fri, 19 Jul 2013 12:10:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id A2B3161F for ; Fri, 19 Jul 2013 12:10:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r6JCA00h064413 for ; Fri, 19 Jul 2013 12:10:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r6JCA07G064412; Fri, 19 Jul 2013 12:10:00 GMT (envelope-from gnats) Resent-Date: Fri, 19 Jul 2013 12:10:00 GMT Resent-Message-Id: <201307191210.r6JCA07G064412@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-threads@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Petr Salinger Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 387C8A83 for ; Fri, 19 Jul 2013 12:09:21 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121]) by mx1.freebsd.org (Postfix) with ESMTP id 2B25160A for ; Fri, 19 Jul 2013 12:09:21 +0000 (UTC) Received: from oldred.freebsd.org ([127.0.1.6]) by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r6JC9Kn9001518 for ; Fri, 19 Jul 2013 12:09:20 GMT (envelope-from nobody@oldred.freebsd.org) Received: (from nobody@localhost) by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r6JC9KUQ001513; Fri, 19 Jul 2013 12:09:20 GMT (envelope-from nobody) Message-Id: <201307191209.r6JC9KUQ001513@oldred.freebsd.org> Date: Fri, 19 Jul 2013 12:09:20 GMT From: Petr Salinger To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: threads/180652: compat32 problem in clock_getcpuclockid2 X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Jul 2013 12:10:00 -0000 >Number: 180652 >Category: threads >Synopsis: compat32 problem in clock_getcpuclockid2 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-threads >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Jul 19 12:10:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Petr Salinger >Release: HEAD >Organization: >Environment: GNU/kFreeBSD 10.0-0-amd64 >Description: The prototype is int clock_getcpuclockid2(id_t id, int which, clockid_t *clock_id); In the first argument so far only pid_t and lwpid_t sizes are passed. Accroding to sys/_types.h: typedef __int64_t __id_t; typedef __int32_t __lwpid_t; typedef __int32_t __pid_t; typedef __int32_t __clockid_t; There is no freebsd32_clock_getcpuclockid2 at all. The 64-bit argument is misplaced in compat32. >How-To-Repeat: >Fix: The PID/TID is encoded in lower 30 bits of clockid. I.e. whole id_t space cannot be used anyway. Please either change signature of syscall to int clock_getcpuclockid2(long id, int which, clockid_t *clock_id); or provide real freebsd32_clock_getcpuclockid2 (); >Release-Note: >Audit-Trail: >Unformatted: