From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.saout.de ([127.0.0.1]) by localhost (mail.saout.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RTdv8n4BOYov for ; Thu, 18 Aug 2011 12:25:54 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mail.saout.de (Postfix) with ESMTP for ; Thu, 18 Aug 2011 12:25:53 +0200 (CEST) Message-ID: <4E4CE8AB.9050106@redhat.com> Date: Thu, 18 Aug 2011 12:25:47 +0200 From: Milan Broz MIME-Version: 1.0 References: <4E4AD6F2.8020800@archlinux.org> <4E4AE4DB.30205@redhat.com> <4E4AE740.9020800@archlinux.org> <4E4B6E61.4020301@redhat.com> <4E4BA46F.5010809@alexanderkoch.net> <1313577794.6534.12.camel@oban> <4E4B9C78.70504@redhat.com> <4E4BA673.9060000@redhat.com> <1313583460.6534.14.camel@oban> <4E4CD3CF.5050803@redhat.com> <4E4CE1B4.2070401@archlinux.org> In-Reply-To: <4E4CE1B4.2070401@archlinux.org> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: Re: [dm-crypt] The weird bug again: semid XXXXXX: semop failed for cookie 0xdeadbeef: incorrect semaphore state List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-1?Q?Thomas_B=E4chler?= Cc: dm-crypt@saout.de On 08/18/2011 11:56 AM, Thomas B=E4chler wrote: > Am 18.08.2011 10:56, schrieb Milan Broz: >> I will report that upstream because this is quite unexpected result, eas= ily >> reproducible with simple clone() and dmsetup. >=20 > Can you describe the test you are doing in more detail (or give me a few > shell commands or a C program to reproduce)? https://lkml.org/lkml/2011/8/18/112 Run dmsetup create aaa --table "0 100 zero" -vvvv dmsetup remove aaa -vvvv (it should work) Then run e.g. such program in parallel: (uevent fails and dmsetup receive "uevent not sent" taking wrong error path) #include #include #include #include #include #include #define STACK_MIN 4096 int clone_start(void* x) { printf("child running...\n"); sleep(30); return 0; } int main (int argc, char *argv[]) { char stack[STACK_MIN]; int waitpid_status; int clone_flags =3D SIGCHLD | CLONE_NEWNET; pid_t pid =3D clone(clone_start, stack + STACK_MIN, clone_flags, (v= oid *) argv); if (pid =3D=3D -1) { printf("clone()\n"); exit(1); } printf("waiting for pid: %d ...\n", (int) pid); pid =3D waitpid(pid, &waitpid_status, 0); if (pid < 0) { printf("waitpid()\n"); exit(1); } return 0; }