From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8AF373858C74; Mon, 26 Sep 2022 11:21:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8AF373858C74 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664191310; bh=5+z74kD8eIXjSk4QYJLvl2uqeSWFQHGADfQPkakCspI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=HmCC/cjjg1T8w3WzBf0EQIKBzDS1r+13KZ3aT62dsuw5hfw6U+D6tlMFUNPBwaaAH 2kwewsjds2Glf7hTQlEeYFWG23dG2wWvf/uk3yz9Zu8m5YbEc6sJUE6EwGblREgQis lySGnyR0e9vtVNAF8rlOKtnz0a24qauYamnXE0xg= From: "fweimer at redhat dot com" To: glibc-bugs@sourceware.org Subject: [Bug libc/29585] sched_getcpu returns invalid results Date: Mon, 26 Sep 2022 11:21:37 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: 2.35 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: fweimer at redhat dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: security- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29585 --- Comment #9 from Florian Weimer --- (In reply to Mischa Baars from comment #8) > (In reply to Florian Weimer from comment #7) > > You cannot call glibc function after creating a bare thread using clone= , you > > need to use direct system calls. The bare thread does not have a proper > > thread control block set up for glibc. >=20 > Ok, no problem. I can use syscalls to retrieve the processor the process = is > running on, but shouldn't glibc check for the existence of this thread > control block and return a -1 when it does not exist instead of a incorre= ct > processor number? There is no efficient way to check if the TCB is safe to use from the curre= nt thread. > I think that a small note in the manual page about pthreads vs fork / clo= ne > would be in order. For example, if the existence of both pthread_yield and > sched_yield makes you think that sched_yield is not specifically intended > for use with pthreads, then why would sched_getcpu be? sched_getcpu is not related to pthreads any more than the rest of glibc. --=20 You are receiving this mail because: You are on the CC list for the bug.=