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

Failed to initialize instances shared memory: "QSharedMemory::attach (shmctl): permission denied" #2068

Closed
n3rd4i opened this issue May 6, 2017 · 17 comments
Labels

Comments

@n3rd4i
Copy link

n3rd4i commented May 6, 2017

This bug-tracker is monitored by developers and other technical types. We like detail! So please use this form and tell us, concisely but precisely, what's up. Please fill out ALL THE FIELDS!

If you have a feature request, please post to the UserVoice. If you're reporting a BSOD, don't post here! Instead, e-mail "secure@microsoft.com", and if possible attach the minidump from "C:\Windows\minidump".

  • Your Windows build number: (Type ver at a Windows Command Prompt)
    Microsoft Windows [Version 10.0.15063]

  • What you're doing and what's happening: (Copy&paste specific commands and their output, or include screen shots)

  1. I've installed ubuntu desktop from this tutorial, it works nice
  2. I've installed qtcreator, IDE which supports bare metal development
  3. Just starting QT IDE
    Note: direct link to used QT IDE
  • What's wrong / what should be happening instead:
    The QT creator works BUT I expect no warning for accessing shared memory.
    Based on the following comments, shmctl is supported.

  • Strace of the failing command, if applicable: (If <cmd> is failing, then run strace -o strace.txt -ff <cmd>, and post the strace.txt output here)
    `Failed to initialize instances shared memory: "QSharedMemory::attach (shmctl): permission denied"
    strace.out.txt.6342.txt

`

Any help on this issue will be appreciated.

@benhillis
Copy link
Member

@n3rd4i - I'll take a look at this, looks like the permissions check for the shmctl command might be too strict:

shmget(0xe0025764, 0, 0600)             = 0
shmat(0, NULL, 0)                       = 0x7f96cf29e000
shmctl(0, IPC_STAT, 0x7fffebcdcf70)     = -1 EACCES (Permission denied)

@benhillis
Copy link
Member

@n3rd4i - Could you go into a bit more detail with your repro steps, specifically the commands used to install Ubuntu Desktop and to install and launch the QT IDE? I believe I have a fix for the issue but I'm having trouble setting up your repro.

@n3rd4i
Copy link
Author

n3rd4i commented May 11, 2017

@benhillis I'm sorry, by mistake link was wrong, I've edited the links from the original problem post.

  1. It seems the first link was somehow copied wrong, the tutorial page was different.
  2. I've added a new link to the exact version of the QT 5.8

I will post more details in next comment.

@n3rd4i
Copy link
Author

n3rd4i commented May 13, 2017

This is the complete flow followed by me to obtain this error message:

A. installation of Ubuntu desktop:

  1. [LINUX] install ubuntu desktop dependencies
    sudo apt install ubuntu-desktop unity compizconfig-settings-manager -y
  2. [WINDOWS] install the XServer:
    https://sourceforge.net/projects/vcxsrv/files/vcxsrv/1.19.2.0/
  3. [WINDOWS] append XServer bin path to PATH permanently
    System Properties >> Environment Variables >> PATH >> EDIT >> NEW >> <VCXSRV_BIN_PATH>
  4. [LINUX] assuming desktop dependencies are installed now, start [WIN] XServer from linux bash:
    vcxsrv.exe -multiwindow -clipboard -wgl &
    Note: this is the multiwindows mode, for setting-up ccsm
  5. [LINUX] run ccsm:
    ccsm
  6. [LINUX] kill the process from linux bash, of [WIN] XServer
    taskkill.exe /IM vcxsrv.exe /F
  7. [LINUX] start [WIN] XServer from linux bash, this time as full screen:
    vcxsrv.exe -clipboard -wgl -dpi auto &
  8. [OPTIONAL] [WINDOWS] rescale the XServer screen if required/preferred ( from default ):

B. Starting Ubuntu Desktop

  1. [LINUX] start Ubuntu Desktop:
    compiz &

C. Installing QT 5.8:

  1. [LINUX] download the package:
    wget http://download.qt.io/official_releases/qt/5.8/5.8.0/qt-opensource-linux-x64-5.8.0.run
  2. [LINUX] make it executable:
    chmod +x qt-opensource-linux-x64-5.8.0.run
  3. [LINUX] start the installation wizard:
    ./qt-opensource-linux-x64-5.8.0.run &
  4. [OPTIONAL] [LINUX DESKTOP]
    Note: Don't forget, check the tickbox to start the QT Creator, after installation
  5. [OPTIONAL] [LINUX DESKTOP] preserve the icon/shortcut to QT Creator for later use
    Right click on icon on new instance of QT Creator, "Lock to Launcher"

D. Detecting the problem:

  1. [LINUX DESKTOP] exit QT Creator if open:
    No instance of QT Creator is running
  2. [LINUX BASH] clear the bash for future messages
    clear
  3. [LINUX DESKTOP] start QT Creator normally:
    click on the created icon
  4. The error message should be there in the bash messages.
    Failed to initialize instances shared memory: "QSharedMemory::attach (shmctl): permission denied"

@benhillis
Copy link
Member

Thank you that's very helpful. I was swamped with //build/ conference stuff this week so I'll give this a shot with my fix.

@benhillis
Copy link
Member

benhillis commented May 17, 2017

I am having a hard time setting this up, I think it's likely because I am using a virtual machine that does not support OpenGL graphics. Question, if you run qtcreator as root do you still see the same error?

@n3rd4i
Copy link
Author

n3rd4i commented May 17, 2017

If I run: sudo qtcreator &
I don't have the same error.

@n3rd4i
Copy link
Author

n3rd4i commented May 17, 2017

The following are my ccsm settings

accesibility
desktop
effects
general settings
image loading
uncategorized
utility
window management

@n3rd4i
Copy link
Author

n3rd4i commented May 17, 2017

There are 2 possible cases which I found:

  1. Open a full desktop view, with the following command, assumed that the above OpenGL is enabled.
    vcxsrv.exe -clipboard -wgl -dpi auto &
  2. Use the workaround described here
    vcxsrv.exe -multiwindow -clipboard -wgl &
    qtcreator -noload Welcome -noload QmlDesigner -noload QmlProfiler &

@therealkenc
Copy link
Collaborator

@benhillis - Simple repro steps if you are still tracking this: Start VcXsrv with XLaunch. Choose multi-window, and then Native opengl unchecked on the "Extra settings page". Then:

$ sudo apt install ubuntu-desktop qtcreator
$ export display=localhost:0
$ qtcreator

I'm not going to do a snippet for the fail here since you think it's already squashed, but if you guys are starting to entertain graphics apps as test cases, those are the steps. And those are always the steps, whether you are running xlogo or google-chrome-unstable.

@benhillis
Copy link
Member

I apologize for the delay, I've submitted a fix for this issue. Look for the fix in a Windows Insider build in a few weeks time.

@benhillis
Copy link
Member

Fixed in 16237.

@fehrin
Copy link

fehrin commented Aug 20, 2017

Hi, will this fix be in the autumn creators update?

@therealkenc
Copy link
Collaborator

@fehrin - anything that made it into 16237 should be in Falls. The Insider Builds are just six months of "Fall Update Pre-Releases". We haven't got any of the post Fall Update pens down stuff yet.

@shabiel
Copy link

shabiel commented Dec 26, 2018

Hello All,

I just got Windows 10 1809 installed TODAY. I was hoping to have had this issue fixed; but apparently it is not fixed:

Error message: %YDB-E-DBFILERR, Error with database file /home/sam/db/VPE/g/mumps.dat,%YDB-I-TEXT, Error with database co
ntrol semctl IPC_STAT1,%SYSTEM-E-ENO13, Permission denied

From strace:

$ strace mumps -r ^%GD <<<"" |& grep semctl
semctl(1, 2, SETVAL, 0x2b)              = 0
semctl(2, 2, IPC_STAT, 0x7fffd250bd60)  = -1 EACCES (Permission denied)
semctl(2, 0, IPC_RMID, NULL)            = 0

@therealkenc
Copy link
Collaborator

Dunno what Ben fixed exactly but whatever it was, it shipped in 16237. Just tried the instant repro steps and qtcreator lit up nicely. For completeness this was on Ubuntu 18.04 userspace, WSL 18305, and qtcreator 4.5.2 based on Qt 5.9.5 -- but that won't matter. The syscall emulation gap this issue represents was closed a year and a half ago. If you've got CLI repro steps for your fail feel free to spin up a new issue following CONTRIBUTING.md and the template.

@shabiel
Copy link

shabiel commented Dec 26, 2018

Thank you. I will create a new issue.

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

No branches or pull requests

5 participants