From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x236.google.com (mail-oi1-x236.google.com [IPv6:2607:f8b0:4864:20::236]) by sourceware.org (Postfix) with ESMTPS id 588253858D1E for ; Thu, 22 Dec 2022 18:18:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 588253858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=opello.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=opello.org Received: by mail-oi1-x236.google.com with SMTP id r205so2593818oib.9 for ; Thu, 22 Dec 2022 10:18:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=opello-org.20210112.gappssmtp.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=XkhI/QiQFTQqrGKh2Tta3Ga5x7f2MDg0dsi588sobJE=; b=2O9qvefwaafBZXhiTE1xF2/TQXovY7lft/3WWKKNLBc6p/LLikX17XpVy3msNA0HDm 1he3ZLDG6W/yw4PDMxMhacxjh95OrnYZ02faeTjmWoZBnsLHOUQUfPDqi8GsM4eNbI64 UFa5wvaWbnEuziaN9U96D8yzkAL6VQ1CpF+HU8T22KLfCWhW8mIbmtgI0+jRuy6Hthep LEtp4qYDDGDok3bmUUP8s9wxBaaDqKjHZEsxrXHSw9yL7ISVyqu9vBBa9fphCT9WfETU P9eFbyEWLTrimOcevx74c/V82QSoRlo7k2gjXXaLvnQYpXln/Iv2nGECnf2Izdx4/eTj SuBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=XkhI/QiQFTQqrGKh2Tta3Ga5x7f2MDg0dsi588sobJE=; b=0rgVsTB82P0Mp1Ww5p/V/Tse1XIaxnUYjuZylrpG0y0rUeiprsKX1kPjCkv+3S65CN 2sOlwzW0DZ8Woat+sd7A5Z8iz0cnquGMdMSRjdwwKCv3LD88uG0SbEV9ZOVHUzhE0KHd AGmknjiNhwpAHxAHvDffRdoARoDGuYLKWjgYLaQJ8t7Uzzj4yHaqrU8lT3F99f7vZaRV zX+dsjqQE5bORd39u9XG0P/YFzpt/QlM2tuWwKSOS+xtyuwtKijoE1kZcGMprx428LKN m90Oh8hQPK4AEjUJra4t/NaHRUOhQzkGwlCJUKhjeZpVW/Pk/HRuYkimJM3x/AJqyg2r uo/A== X-Gm-Message-State: AFqh2krlFsKvXA8ZQdto7SqFF5mqFYiPSZgWZ6r4P7X9N6+gHhQ01g4r TnK3sEZWtXWRe3zY4M6cfIYG7fjuOY0CqhGI2a+yTXW06H5Z8yWw X-Google-Smtp-Source: AMrXdXvPZnCtCwuFjcdsOBy5dYHrh33l5vS6VL61PhMC0+z/UFsl14ONfjg/RCNAruK5NXWb9CgGF9jWlqZTvxMPaPs= X-Received: by 2002:aca:1717:0:b0:35e:4c50:a52c with SMTP id j23-20020aca1717000000b0035e4c50a52cmr291346oii.244.1671733099247; Thu, 22 Dec 2022 10:18:19 -0800 (PST) MIME-Version: 1.0 From: Dan Christensen Date: Thu, 22 Dec 2022 12:18:05 -0600 Message-ID: Subject: clock_gettime after 2.31 and reused syscall numbers To: libc-help@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hello, My understanding is that after glibc 2.31 clock_gettime can call clock_gettime64 from a 32-bit process to get a 64-bit time_t if the underlying kernel supports such a thing. The problem I ran into was that a particular Synology kernel version (3.10.77) included their own system calls for whatever product specific purpose they may have wanted, including one at 403 (SYNOArchiveBit) which is where Linux 5.1 added clock_gettime64. This resulted in glibc >= 2.31 trying to call that proprietary function instead of falling back to clock_gettime. Which in a trivial test case saw both struct timespec members be 0. But in the actual application that triggered digging into this issue saw a thread hit 99% CPU usage and not be able to yield due to clock_gettime64 (but really SYNOArchiveBit) returning EINVAL. In glibc <= 2.28 clock_gettime is called and no problem nor loss of time_t precision is realized. I'm curious if glibc should even try to handle this case? Part of why I ask is because [1] seems to suggest that it may have been most appropriate to examine the vDSO for the presence of a clock_gettime64 symbol before trying to go down the path of invoking that function. Or is all of that out of scope because "a vendor deviated from mainline, and such things are impossible to predict or support"? I don't mean to suggest that to be an unreasonable position. Thanks for your time, Dan [1] https://sourceware.org/git/?p=glibc.git;a=commit;h=ec138c67cbda8b5826a0a2a7ba456408117996dc