[{"id":3677321,"web_url":"http://patchwork.ozlabs.org/comment/3677321/","msgid":"<20260414171512.4014-1-linuxtestproject.agent@gmail.com>","list_archive_url":null,"date":"2026-04-14T17:15:12","subject":"Re: [LTP] semctl: updates for multi worker testing.","submitter":{"id":93132,"url":"http://patchwork.ozlabs.org/api/people/93132/","name":null,"email":"linuxtestproject.agent@gmail.com"},"content":"Hi Stephen,\n\nOn Tue, 14 Apr 2026, Stephen Bertram wrote:\n> semctl: updates for multi worker testing.\n>\n> Changed semctl01, which required updates to\n> reduce interference and provide an allowance\n> for EINVAL and EIDRM failures.\n\nThe body should say *why* multi-worker support is needed — what harness\nor runner exercises this in parallel, or what failure prompted the change.\n\n> -static int sem_id = -1;\n> -static int sem_index;\n> +static __thread int sem_id = -1;\n> +static __thread int sem_index;\n>  static struct semid_ds buf;\n>  static struct seminfo ipc_buf;\n>  static unsigned short array[PSEMS];\n>  static struct sembuf sops;\n>  static int pid_arr[NCHILD];\n\nbuf, ipc_buf, array, sops, pid_arr are still plain globals. Making only\nsem_id/sem_index TLS leaves all the helper functions that read/write\nthese globals unsafe for concurrent use, so the parallelisation is\nincomplete.\n\n[...]\n\n> +\t\tif (sid == -1)\n> +\t\t\tsem_id = sid = SAFE_SEMGET(IPC_PRIVATE, PSEMS,\n> +\t\t\t\t\t\t   IPC_CREAT | IPC_EXCL | SEM_RA);\n\ncleanup() runs in the main thread and only sees the main thread's TLS\nsem_id. Worker threads that hit this path will leak their semaphore sets.\nEither track all allocated IDs in a shared, mutex-protected list, or drop\n__thread and keep the test single-threaded.\n\nAlso note struct tcases::semid is now always NULL and never read; the\nfield can be removed.\n\n---\nNote:\n\nOur agent completed the review of the patch. The full review can be\nfound at: https://patchwork.ozlabs.org/project/ltp/list/?series=499874\n\nThe agent can sometimes produce false positives although often its\nfindings are genuine. If you find issues with the review, please\ncomment this email or ignore the suggestions.","headers":{"Return-Path":"<ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>","X-Original-To":["incoming@patchwork.ozlabs.org","ltp@lists.linux.it"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","ltp@picard.linux.it"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=GT0frdpz;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it\n (client-ip=2001:1418:10:5::2; helo=picard.linux.it;\n envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it;\n receiver=patchwork.ozlabs.org)"],"Received":["from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fw9rp0m72z1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 15 Apr 2026 03:15:22 +1000 (AEST)","from picard.linux.it (localhost [IPv6:::1])\n\tby picard.linux.it (Postfix) with ESMTP id B61293E5DF5\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 19:15:19 +0200 (CEST)","from in-7.smtp.seeweb.it (in-7.smtp.seeweb.it\n [IPv6:2001:4b78:1:20::7])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature ECDSA (secp384r1))\n (No client certificate requested)\n by picard.linux.it (Postfix) with ESMTPS id 522613CDC78\n for <ltp@lists.linux.it>; Tue, 14 Apr 2026 19:15:16 +0200 (CEST)","from mail-qk1-x743.google.com (mail-qk1-x743.google.com\n [IPv6:2607:f8b0:4864:20::743])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by in-7.smtp.seeweb.it (Postfix) with ESMTPS id BBA612009A6\n for <ltp@lists.linux.it>; Tue, 14 Apr 2026 19:15:15 +0200 (CEST)","by mail-qk1-x743.google.com with SMTP id\n af79cd13be357-8d4f78fc9f6so696154385a.3\n for <ltp@lists.linux.it>; Tue, 14 Apr 2026 10:15:15 -0700 (PDT)","from\n runnervm35a4x.ccppip3scqvufedtrt4s1lh33h.bx.internal.cloudapp.net\n ([52.150.30.137]) by smtp.gmail.com with ESMTPSA id\n 6a1803df08f44-8acb371b547sm47092016d6.37.2026.04.14.10.15.13\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 14 Apr 2026 10:15:13 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1776186914; x=1776791714; darn=lists.linux.it;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=JhzLUZp9GsVH2UcRTGWD1JAzYQNOH4z+WhLOllUciLM=;\n b=GT0frdpzqu88zCGRV08T0cM8zpZpc4yj36oYj2wYm+3+NuZuweJjIXzV5D4hzbAvaM\n +oDRIzjZIPy7wl+iDjhUbDMR5sewNW6xaKDBX1LnWhsFDEpW7K8S7Lvv0/v6Ymz3Mllu\n muhdoSGek+o8B/ZSDZEEdKxurh2Lnj0kXoFY/0TnpWHK/ZSgKPRbv5KKYX4xxPfB4rC0\n 3zZlBlbThob0z+W9u+L3G1C3IYqNEifUSEPf3YkwO+h7pwXhwxvbOMkvWf1NUyLtoFCp\n BusnYTfl2wbwxNOiHG6FMBNoKO2hWoRZAHyXnMWgfsoOPqT2/hDi9FNjtj46XxI4x20j\n unjw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776186914; x=1776791714;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=JhzLUZp9GsVH2UcRTGWD1JAzYQNOH4z+WhLOllUciLM=;\n b=R4p0mrJhAAwPR3Vvq840uAXCCIetg9UuobCdkRTPDWpYWsILTyvWoeDkUthRKlYTwI\n 6G+RLgjqKjthEjLJcLCnFCyOh+IIqcM/btqw1B5pIEcFRXOMyJu9EEeEP0PFgCH41NVI\n /C5QK8VIHY6I1l/RIPiLzECUK0VLAdZndk3AduaX5kjY49fr8KdQcLTipxEh//lawbC9\n qghUnyIngspYI1bnXD3lRfInuo/p1wYe8v0BctWQV9W35jZhlLSTOpWt0HTEmJWsITUW\n zsZwPt0nI1Q/a4U/JmIi6phnA087fKhcBlj+V+1OqrUE0slH6JHc9H+pb++36TdDnLGg\n j6tQ==","X-Gm-Message-State":"AOJu0YxhiEQCx0/Pes64cdHmTYRj3C3wqAoF33JxZfAOlcdw2dODSi6F\n 80S3Pm9FeB+F0pt3+8H9UYlAA+zhtAcqThQWSF82Zdkexy6pc5ezIs3o","X-Gm-Gg":"AeBDieuvg6npvv+rSGHD+7f8PVHZqt0ZTKrOt51fLApUdJwvVsWmsQsuv/wf5g5yE5v\n SeLauKmfMxx5TP4vG6qbGrCMINHrr3iU6Pni0Bx/54+VqjfYGpGH0O4jkqoBV7rNIYbqv6m9R1+\n hczHa9XQd9N+TqoIZExRXucfsZ6JeNGQK1tOBsvwjdQ5unPzcxXZNYNAIfqgDXhmi3EDvwxakjk\n VuZ7b42exo95jynOsR5C+PZG1+3bW4eCqIIPONhV0EkBIiCPYoqqRdWoVR8uHuOKpW+hGjJF9SC\n ehJQB1++npily/JLcYcmG5mfp4fi6W60oCHGKRb05IM1VRjp/sS+O0p7326cxYsuCEhM7yzBgiN\n 8Z9WSjVQyJJuCz036PJrb51oNRtMmg6qkKj46C1dJmSGnwnqEzBeimXmUA9j1c5vxVszmoaZYEZ\n YMQ/zpX+OJmPlyyT++8fwIGN/rLZLVzQSwk+FyXE/quYblZHkZ4fk9seP/ecVAgW191itP15wcQ\n tMYB4r/DYb45ewg5rxAfm6+","X-Received":"by 2002:ad4:5e85:0:b0:8ac:bb62:fe52 with SMTP id\n 6a1803df08f44-8acbb630fa4mr79382186d6.4.1776186913733;\n Tue, 14 Apr 2026 10:15:13 -0700 (PDT)","From":"linuxtestproject.agent@gmail.com","To":"Stephen Bertram <sbertram@redhat.com>","Date":"Tue, 14 Apr 2026 17:15:12 +0000","Message-ID":"<20260414171512.4014-1-linuxtestproject.agent@gmail.com>","X-Mailer":"git-send-email 2.53.0","In-Reply-To":"<20260414164927.843200-1-sbertram@redhat.com>","References":"<20260414164927.843200-1-sbertram@redhat.com>","MIME-Version":"1.0","X-Spam-Status":"No, score=1.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID,\n DKIM_VALID_AU,DKIM_VALID_EF,FORGED_GMAIL_RCVD,FREEMAIL_FROM,\n SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=disabled version=4.0.1","X-Spam-Level":"*","X-Spam-Checker-Version":"SpamAssassin 4.0.1 (2024-03-25) on in-7.smtp.seeweb.it","X-Virus-Scanned":"clamav-milter 1.0.9 at in-7.smtp.seeweb.it","X-Virus-Status":"Clean","Subject":"Re: [LTP] semctl: updates for multi worker testing.","X-BeenThere":"ltp@lists.linux.it","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"Linux Test Project <ltp.lists.linux.it>","List-Unsubscribe":"<https://lists.linux.it/options/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=unsubscribe>","List-Archive":"<http://lists.linux.it/pipermail/ltp/>","List-Post":"<mailto:ltp@lists.linux.it>","List-Help":"<mailto:ltp-request@lists.linux.it?subject=help>","List-Subscribe":"<https://lists.linux.it/listinfo/ltp>,\n <mailto:ltp-request@lists.linux.it?subject=subscribe>","Cc":"ltp@lists.linux.it","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it","Sender":"\"ltp\" <ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it>"}}]