From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from forward100o.mail.yandex.net (forward100o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::600]) by sourceware.org (Postfix) with ESMTPS id 7A7A23858002 for ; Sun, 14 Feb 2021 20:47:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7A7A23858002 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=yandex.ru Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=hi-angel@yandex.ru Received: from forward103q.mail.yandex.net (forward103q.mail.yandex.net [IPv6:2a02:6b8:c0e:50:0:640:b21c:d009]) by forward100o.mail.yandex.net (Yandex) with ESMTP id 6406B4AC2007; Sun, 14 Feb 2021 23:47:00 +0300 (MSK) Received: from vla1-4834b80a1080.qloud-c.yandex.net (vla1-4834b80a1080.qloud-c.yandex.net [IPv6:2a02:6b8:c0d:1e06:0:640:4834:b80a]) by forward103q.mail.yandex.net (Yandex) with ESMTP id 5F61761E0002; Sun, 14 Feb 2021 23:47:00 +0300 (MSK) Received: from vla4-d1b041059520.qloud-c.yandex.net (vla4-d1b041059520.qloud-c.yandex.net [2a02:6b8:c17:914:0:640:d1b0:4105]) by vla1-4834b80a1080.qloud-c.yandex.net (mxback/Yandex) with ESMTP id IZ2pp6Woks-l0Im7cZR; Sun, 14 Feb 2021 23:47:00 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1613335620; bh=NdtUzug91H1oAEtqfUX7g4uiOzwN/Mqsu1wgnWDQSCc=; h=In-Reply-To:To:From:Subject:Message-ID:References:Date; b=RdaHKfeYDWY8DznciuMHv/+A0gyQN+ThFlh8QsVath9CKw2ROQGGwug1Mez/rZeHO W99lB3Wwnb33RFD4rOLppL6oI8P7he+1f736HH3Uma344mDHCF4uHYWP2OgdaprPFm REJBfc5Qc4ckUjnWdqJ7YSQrdv0yqnk4aw7QVw3g= Authentication-Results: vla1-4834b80a1080.qloud-c.yandex.net; dkim=pass header.i=@yandex.ru Received: by vla4-d1b041059520.qloud-c.yandex.net (smtp/Yandex) with ESMTPSA id V3GJPFaige-kxJ45bqB; Sun, 14 Feb 2021 23:46:59 +0300 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client certificate not present) Message-ID: Subject: Re: (stat(...) == -1 || faccessat(...) == -1) && errno == EINTR ?!?? From: Konstantin Kharlamov To: Tobias Bading , libc-help@sourceware.org Date: Sun, 14 Feb 2021 23:46:59 +0300 In-Reply-To: <955dbfba-b6aa-fa00-9823-0b025baac931@web.de> References: <55281a90e0fd3171fc4ba4b895ddf5650722bc41.camel@yandex.ru> <955dbfba-b6aa-fa00-9823-0b025baac931@web.de> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, PLING_QUERY, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-help@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-help mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2021 20:47:05 -0000 On Sun, 2021-02-14 at 19:58 +0100, Tobias Bading wrote: > Hello Konstantin, > > thanks for trying to reproduce the problem. Could you please try > > void handler (int signum) > { > } > > and > > timer.it_value.tv_usec = timer.it_interval.tv_usec = 1000000 / 10000; > > to increase the rate of SIGALRMs to 10000 (or even higher) per second? > For me this reproduces the error also on shares that looked like they > weren't affected when only 50 signals per second were created. There > seems to be only a very short time window in which some piece of > (probably CIFS-related) kernel code can be thrown of the rails by a > signal, and the length of that time window probably depends on the > performance of client and server, the network connection and whatnot. > Since you're using a local share, your time window to produce the error > is probably much smaller than mine. Thanks, did that, I ran the testcase under `time` utility: λ time ./a ^C ./a 18.98s user 49.15s system 99% cpu 1:08.69 total So, it ran for a minute before I interrupted it with ^C, no fails observed. For the record, here's the code I used (the smb share is mounted under /tmp/mnt, and it's a localhost share). #include #include #include #include #include #include #include #include static const char path[] = "/tmp/mnt/"; void handler (int signum) { } int main () { struct stat st; struct sigaction action; struct itimerval timer; memset (&action, 0, sizeof action); action.sa_handler = handler; action.sa_flags = SA_RESTART; if (sigaction (SIGALRM, &action, NULL)) { perror ("sigaction() failed"); return 1; } timer.it_value.tv_sec = timer.it_interval.tv_sec = 0; timer.it_value.tv_usec = timer.it_interval.tv_usec = 1000000 / 10000; if (setitimer (ITIMER_REAL, &timer, NULL)) { perror ("setitimer() failed"); return 1; } for (;;) { int r = stat (path, &st); if (r) { perror ("stat() failed"); return 1; } r = faccessat (AT_FDCWD, path, R_OK, 0); if (r) { perror ("faccessat() failed"); return 1; } } return 0; } I built it with `gcc dont-interrupt-me.c -o a -g3 -O0`