DM-Crypt Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Milan Broz <mbroz@redhat.com>
To: "Thomas Bächler" <thomas@archlinux.org>
Cc: dm-crypt@saout.de
Subject: Re: [dm-crypt] The weird bug again: semid XXXXXX: semop failed for cookie 0xdeadbeef: incorrect semaphore state
Date: Thu, 18 Aug 2011 12:25:47 +0200	[thread overview]
Message-ID: <4E4CE8AB.9050106@redhat.com> (raw)
In-Reply-To: <4E4CE1B4.2070401@archlinux.org>

On 08/18/2011 11:56 AM, Thomas Bächler wrote:
> Am 18.08.2011 10:56, schrieb Milan Broz:
>> I will report that upstream because this is quite unexpected result, easily
>> reproducible with simple clone() and dmsetup.
> 
> 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 <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sched.h>
#include <sys/types.h>
#include <sys/wait.h>

#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 = SIGCHLD | CLONE_NEWNET;

        pid_t pid = clone(clone_start, stack + STACK_MIN, clone_flags, (void *) argv);
        if (pid == -1) {
                printf("clone()\n");
                exit(1);
        }

        printf("waiting for pid: %d ...\n", (int) pid);
        pid = waitpid(pid, &waitpid_status, 0);
        if (pid < 0) {
                printf("waitpid()\n");
                exit(1);
        }

        return 0;
}

  reply	other threads:[~2011-08-18 10:25 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-16 20:45 [dm-crypt] The weird bug again: semid XXXXXX: semop failed for cookie 0xdeadbeef: incorrect semaphore state Thomas Bächler
2011-08-16 21:44 ` Milan Broz
2011-08-16 21:55   ` Thomas Bächler
2011-08-17  7:31     ` Milan Broz
2011-08-17 11:22       ` Alexander Koch
2011-08-17 10:43         ` Yves-Alexis Perez
2011-08-17 10:48           ` Milan Broz
2011-08-17 11:30             ` Milan Broz
2011-08-17 12:17               ` Yves-Alexis Perez
2011-08-18  8:56                 ` Milan Broz
2011-08-18  9:56                   ` Thomas Bächler
2011-08-18 10:25                     ` Milan Broz [this message]
2011-08-22 11:51                       ` Thomas Bächler
2011-08-23 10:01                         ` Thomas Bächler
2011-08-23 11:51                           ` Milan Broz
2011-09-16  6:33                             ` Thomas Bächler
2011-11-03 15:32                             ` Sebastian Steinhuber
2011-11-10 11:28                               ` Milan Broz
2011-08-18 20:49                   ` Yves-Alexis Perez
2011-08-16 22:12   ` Alexander Koch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E4CE8AB.9050106@redhat.com \
    --to=mbroz@redhat.com \
    --cc=dm-crypt@saout.de \
    --cc=thomas@archlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox