Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"monetdb create -p" hangs monetdbd #3603

monetdb-team opened this issue Nov 30, 2020 · 0 comments

"monetdb create -p" hangs monetdbd #3603

monetdb-team opened this issue Nov 30, 2020 · 0 comments


Copy link

@monetdb-team monetdb-team commented Nov 30, 2020

Date: 2014-10-14 17:20:36 +0200
From: Richard Hughes <<richard.monetdb>>
To: Merovingian devs <>
Version: 11.17.21 (Jan2014-SP3)

Last updated: 2014-10-31 14:14:02 +0100

Comment 20290

Date: 2014-10-14 17:20:36 +0200
From: Richard Hughes <<richard.monetdb>>

Build is Oct2014 9d23c00aac8e

To reproduce, start monetdbd then run:
monetdb create -p hunter2 newdb

Expected results:

new database is created with that password

Actual results:

command never completes

monetdbd is hung at:
Thread 2 (Thread 0x7fa7de8c6700 (LWP 26060)):
0 0x00007fa7e4536434 in __libc_wait (stat_loc=0x0)
at ../sysdeps/unix/sysv/linux/wait.c:35
1 0x000000000040f022 in childhandler (sig=,
si=0x7fa7de8c18b0, unused=) at handlers.c:172
3 0x00007fa7e45364c9 in __libc_waitpid (pid=9185, stat_loc=0x0, options=0)
at ../sysdeps/unix/sysv/linux/waitpid.c:40
4 0x000000000040a87a in ctl_handle_client (origin=0x7fa7de8c5e20 "(local)",
msgsock=5, fdin=fdin@entry=0x0, fout=0x0) at controlrunner.c:461
5 0x000000000040c6e9 in controlRunner (d=)
at controlrunner.c:980
6 0x00007fa7e452f0a4 in start_thread (arg=0x7fa7de8c6700)
at pthread_create.c:309
7 0x00007fa7e4264c2d in clone ()
at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

It looks like the waitpid() in ctl_handle_client() is fighting with the wait() in the SIGCHLD handler. waitpid eats the event which means the signal handler hangs forever. Since I can easily imagine that details of this behaviour are kernel-specific, I should mention that I'm running Linux 3.16.3 (Debian Jessie).

P.S. This feature was implemented under bug #3204, which probably ought to be closed now. Unless you're going to back out the feature because it doesn't work.

P.P.S. The man page for monetdb got updated to mention this new flag but "monetdb help create" didn't.

Comment 20293

Date: 2014-10-15 10:02:31 +0200
From: MonetDB Mercurial Repository <>

Changeset 82bf5eb519ea made by Sjoerd Mullender in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=82bf5eb519ea

Changeset description:

Block SIGCHLD signals when forking for create -p.
By blocking SIGCHLD signals when forking and subsequently waiting for
the forked child when handling the create -p command, and by also
ignoring SIGCHLD signals if there is no child ready to be waited for,
we hopefully fix bug #3603.

Comment 20294

Date: 2014-10-15 10:02:34 +0200
From: MonetDB Mercurial Repository <>

Changeset e52fe4e5104f made by Sjoerd Mullender in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=e52fe4e5104f

Changeset description:

Add blurb about -p option in monetdb help create.
See bug #3603.

Comment 20295

Date: 2014-10-15 10:03:34 +0200
From: @sjoerdmullender

Richard, can you check whether my fix solves the problem? I haven't been able to reproduce it on my Fedora 20 system.

Comment 20296

Date: 2014-10-15 12:19:50 +0200
From: Richard Hughes <<richard.monetdb>>

I think it might be necessary to have at least one database actually started in order to reproduce it. Anyway, it looks like your fix works. Thanks.

BTW, just to be pedantic, man sigprocmask says "The use of sigprocmask() is unspecified in a multithreaded process; see pthread_sigmask(3)."

Comment 20351

Date: 2014-10-31 14:14:02 +0100
From: @sjoerdmullender

Oct2014 has been released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant