schutzwerk / CANalyzat0r

Security analysis toolkit for proprietary car protocols
https://www.schutzwerk.com/en/43/posts/canalyzat0r/
GNU General Public License v3.0
755 stars 147 forks source link

Installation issue on 18.04 #5

Closed NSkelsey closed 6 years ago

NSkelsey commented 6 years ago

Hey thanks for putting this tool together.

I followed the installation instructions without docker and received this error after the last command

synnick@matrioska:~/projects/canme/CANalyzat0r$ sudo ./CANalyzat0r.sh 

   _________    _   __      __                  __  ____
  / ____/   |  / | / /___ _/ /_  ______  ____ _/ /_/ __ \_____
 / /   / /| | /  |/ / __ `/ / / / /_  / / __ `/ __/ / / / ___/
/ /___/ ___ |/ /|  / /_/ / / /_/ / / /_/ /_/ / /_/ /_/ / /
\____/_/  |_/_/ |_/\__,_/_/\__, / /___/\__,_/\__/\____/_/
                          /____/
INFO: Database.py: CANalyzat0r.Database: connect: 366: Database connection OK
X Error: BadAccess (attempt to access private resource denied) 10
  Extension:    130 (MIT-SHM)
  Minor opcode: 1 (X_ShmAttach)
  Resource id:  0x14c

The application spawns a small window with the title first run shown below

aaa

Then if the window is moved the console throws out the following

X Error: BadShmSeg (invalid shared segment parameter) 128
  Extension:    130 (MIT-SHM)
  Minor opcode: 5 (X_ShmCreatePixmap)
  Resource id:  0x2c00011
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
  Major opcode: 62 (X_CopyArea)
  Resource id:  0x2c00012
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
  Major opcode: 62 (X_CopyArea)
  Resource id:  0x2c00012
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
  Major opcode: 62 (X_CopyArea)
  Resource id:  0x2c00012
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
  Major opcode: 62 (X_CopyArea)
  Resource id:  0x2c00012
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
  Major opcode: 62 (X_CopyArea)
  Resource id:  0x2c00012
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
  Major opcode: 62 (X_CopyArea)
  Resource id:  0x2c00012
X Error: BadPixmap (invalid Pixmap parameter) 4
  Major opcode: 54 (X_FreePixmap)
  Resource id:  0x2c00012
X Error: BadShmSeg (invalid shared segment parameter) 128
  Extension:    130 (MIT-SHM)
  Minor opcode: 2 (X_ShmDetach)
  Resource id:  0x2c00011
X Error: BadAccess (attempt to access private resource denied) 10
  Extension:    130 (MIT-SHM)
  Minor opcode: 1 (X_ShmAttach)
  Resource id:  0x14c
X Error: BadShmSeg (invalid shared segment parameter) 128
  Extension:    130 (MIT-SHM)
  Minor opcode: 5 (X_ShmCreatePixmap)
  Resource id:  0x2c00017
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
  Major opcode: 62 (X_CopyArea)
  Resource id:  0x2c00018
X Error: BadDrawable (invalid Pixmap or Window parameter) 9
  Major opcode: 62 (X_CopyArea)
  Resource id:  0x2c00018
X Error: BadPixmap (invalid Pixmap parameter) 4
  Major opcode: 54 (X_FreePixmap)
  Resource id:  0x2c00018
X Error: BadShmSeg (invalid shared segment parameter) 128
  Extension:    130 (MIT-SHM)
  Minor opcode: 2 (X_ShmDetach)
  Resource id:  0x2c00017

This system is:

> uname -a
Linux matrioska 4.15.0-30-generic #32-Ubuntu SMP Thu Jul 26 17:42:43 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Do you think the issue is related to executing within a VM or just try the docker version?

ps1337 commented 6 years ago

Hello and thanks for your report :)

Can you retry this after setting an environment variable via sudo export QT_X11_NO_MITSHM=1 ?

Currently the Docker version is recommended but maybe the command above will help :)

NSkelsey commented 6 years ago

The above command did not work, but the startup with Docker worked.

For those unfamilar with docker - like me - it be nice to add some text in the README about creating the required directories and specifying full paths on command invocation.

Thanks again.

ps1337 commented 6 years ago

Noted. I'll try to reproduce your issue in a VM and add a note in the readme if possible.

sw-pschmied commented 6 years ago

The last 2 commits (daa7fb3a1f1733f777a3a65422163d7f19376161 and c73a96d4947585e8cd87da42a69ef5ac8f3f223e) should have fixed your issue.

The problem was that the environment variable QT_X11_NO_MITSHM wasnt preserved through the sudo call