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

Kernel isn't configured for semaphores #2013

Closed
moosejackson opened this issue Apr 26, 2017 · 15 comments
Closed

Kernel isn't configured for semaphores #2013

moosejackson opened this issue Apr 26, 2017 · 15 comments

Comments

@moosejackson
Copy link

moosejackson commented Apr 26, 2017

Semaphores are still not working in build 15063.11.
Running ipcs in bash:

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status

Kernel not configured for semaphores

Kernel not configured for message queues

According to https://wpdev.uservoice.com semaphores should be working.

@moosejackson
Copy link
Author

The problem was, that I had to update Ubuntu to 16.04 using

do-release-upgrade

Now it seems, that semaphors could work

@fpqc
Copy link

fpqc commented Apr 26, 2017

Semaphores, I think, still don't work in the fakeroot program, which still needs to be recompiled with the tcp flag on an arch userspace.

I was able to generate an strace of it failing here while using makepkg:

https://ptpb.pw/0psK

(I had to use an old version of strace because the latest version fails on an unimplemented ptrace option)

It seems like it's failing when it runs faked, so I straced running that directly:

https://ptpb.pw/jyuQ

@therealkenc
Copy link
Collaborator

#1016

@fpqc
Copy link

fpqc commented Apr 30, 2017

@therealkenc support is now there partially, that's why postgres works I thought

@stehufntdev
Copy link
Collaborator

The Creator's update has support for SysV semaphores and shared memory. Closing this out as fixed in the creator's update, but please let us know if you hit any issues.

@fpqc
Copy link

fpqc commented May 2, 2017

@stehufntdev my strace is from CU. The problem should happen in all versions of fakeroot compiled with the default sysvipc mechanism rather than tcp.

@therealkenc
Copy link
Collaborator

therealkenc commented May 2, 2017

@fpqc - If you post a strace -ff faked [however you do it] 2> faked.strace I'll take a look. The one you posted doesn't have any fails to explain the write(2, "fakeroot, while creating message"..., 68 message. Actually it doesn't even contain a clone() or exec(), which could be an ptrace() thing if you already ran it with -ff. I have seen this before, see for example #1306 (message); although the guy never followed up on Adam's question regarding strace -ff.

So you likely have a mulimode failure here. It is not clear where that "Function not implemented...This may be due to a lack of SYSV IPC support" error is coming from. It could be SysV IPC. It could be a bad guess on faked's part. If you are still splashing around in Arch-land, best thing to do is sit tight until #555 and #1878 (message) to flip to fixedinsiderbuilds. #1878 hasn't even made it to bug yet.

@therealkenc
Copy link
Collaborator

therealkenc commented May 2, 2017

FWIW, the problem with faked does look like plain old unimplemented surface. The bonus is that the syscall fail does not turn up in strace. I have seen this before when I did #1530. For some reason I think we might have lost ENOSYS traces along the way. Anyway, test case below. This is on 16184, stock WSL 16.04.2 userspace. This has nothing to do with Arch or the rest.

#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <sys/msg.h>
#include <string.h>
#include <errno.h>
#include <stdio.h>

int main(int argc, const char * argv[])
{
  char buf[1024];
  int msg_get, msg_key = 42;
  msg_get = msgget(msg_key,IPC_CREAT|0600);
  if (msg_get == -1) {
    strerror_r(errno, buf, sizeof(buf));
    printf("msgget: %s\n", buf);
  }
  return 0;
}

strace:

...usual stuff
munmap(0x7fdc1a8ac000, 147083)          = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
brk(NULL)                               = 0x203e000
brk(0x205f000)                          = 0x205f000
write(1, "msgget: Function not implemented"..., 33) = 33
exit_group(0)                           = ?
+++ exited with 0 +++

@fpqc
Copy link

fpqc commented May 2, 2017

yeah, I tried it on Ubuntu too, thought I mentioned that

@stehufntdev
Copy link
Collaborator

@fpqc, can you please share out your repro? Locally when I run ipcs, I get different output from what you posted above:

root@stehuf-test:/# ipcs

------ Message Queues --------
key msqid owner perms used-bytes messages

------ Shared Memory Segments --------
key shmid owner perms bytes nattch status

------ Semaphore Arrays --------
key semid owner perms nsems

@stehufntdev stehufntdev reopened this May 4, 2017
@fpqc
Copy link

fpqc commented May 4, 2017

@stehufntdev I didn't run ipcs, I ran fakeroot/faked. @moosejackson ran ipcs.

@stehufntdev
Copy link
Collaborator

Sorry for the mix-up there, when I run fakeroot locally I get the failure below which is due to missing msgqueue support not semaphones (i.e. MSGGET, MSGCTL, ...). Are you seeing a different failure?

root@stehuf-test:/# fakeroot
fakeroot, while creating message channels: Function not implemented
This may be due to a lack of SYSV IPC support.
fakeroot: error while starting the `faked' daemon.
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]

@benhillis
Copy link
Member

System V semaphores and shared memory were implemented during Creators Update but message queues were not.

@fpqc
Copy link

fpqc commented May 4, 2017

Ah, there we go. Mystery solved.

@moosejackson
Copy link
Author

When I've tried to run fakeroot, I got the same message as @stehufntdev mentioned. I had some problems with using semaphores in WSL(not sure where was exactly the problem), so I've installed Fedora to virtual machine and did all I needed there.
I had to use semaphores and shared memory for my school project (synchronization of processes) and it is already done :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants