From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25667 invoked by alias); 16 May 2018 02:29:06 -0000 Mailing-List: contact libc-help-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: libc-help-owner@sourceware.org Received: (qmail 25654 invoked by uid 89); 16 May 2018 02:29:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=oddly, leaning, 7.5 X-HELO: mail-ua0-f171.google.com Received: from mail-ua0-f171.google.com (HELO mail-ua0-f171.google.com) (209.85.217.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 16 May 2018 02:29:04 +0000 Received: by mail-ua0-f171.google.com with SMTP id f3-v6so1548719uan.9 for ; Tue, 15 May 2018 19:29:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=O4zbitwNIhmjpx5n2Gy9fP+s/Lce1ODsP2SAQhZZM6g=; b=aycWWOZRnoB1U34NBXZnOygV7sg4SXE9Y12I73+yROoJBwY+nl3v+gqZgLfWzDeA0y eggUxbYxITiqMNfePHZ3pNjK8c0SgbIaIfyRq52Bh2FQmPsXLosCI0rRtWQKigeFKo+F 3DnSHFs4IDTAkBuUJmNzF92CBFX40q0Og9e5W6qvI+icNkD9oC6N3iEIvQNT4KIONtGv z6S+ZNSsqXEyyuI3aqZZM7igz1Q6MryGLzhX3nyC84Ez7ONfEK+WC+Ol9ZhKmJ2eRMdi +WkI0bioFSswBmGMBRM8G68uVgYHta1zxQmXDD2Nxd9/przMhYzEmv9slluub+9A2hZV +5Tg== X-Gm-Message-State: ALKqPwdRZ9iHgPwat3e/mcPjQkgtd+qR6t57xfprcsFxb5hK6biL5Pr3 F0GXbvOTZL9aA3NRw9yGxEbxRvdz1LdbjlGEa4FxdQ== X-Google-Smtp-Source: AB8JxZq8coGkkkwerx9EmxXlMogPUYdE+GGhyCoaji1E+mUARCGzy2T6QokzlvGygjSBDlGR01RfE3+vEOMh1IpGWa8= X-Received: by 2002:ab0:961:: with SMTP id c33-v6mr18742384uah.85.1526437742666; Tue, 15 May 2018 19:29:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.76.205 with HTTP; Tue, 15 May 2018 19:29:02 -0700 (PDT) From: Ed Peschko Date: Wed, 16 May 2018 02:29:00 -0000 Message-ID: Subject: bug in libc with glob and /proc? To: libc-help@sourceware.org Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2018-05/txt/msg00010.txt.bz2 all, i'm getting something very odd with glob and /proc: I am trying to write a quick process check module - one that I want to be exceedingly small and therefore to have the fewest possible dependencies (ie: no libproc) So I was writing calls like this: proc_stat = glob("/proc/[0-9]*/cmdline", 0, NULL, &paths); ... globfree(&paths) Oddly, this only returns results on the very first call - the second returns that no results are to be found (GLOB_NOMATCH). If however, I replace "/proc" with "/tmp" or any other value, it works robustly - the only line of code changing being the call to glob. Hence I really don't think it is a coding error on my part (i'll post the full code if so desired). Therefore, I'm leaning towards thinking it is a glibc bug and will file it as so if necessary. This is on centos 7.5 btw for context. so - what is going on here? weird things are also happing here when I try to popen out and do the same logic against /proc. Is there something about /proc that is special here? Shouldn't glibc be able to handle it transparently? thanks much for any info/help..