slaclab / skywalker

Automatic alignment module for LCLS mirror systems
https://pswww.slac.stanford.edu/swdoc/releases/skywalker
Other
2 stars 2 forks source link

GUI seg faults when clicking on lightpath button on some accounts #70

Open APRashedAhmed opened 6 years ago

APRashedAhmed commented 6 years ago

Expected Behavior

Clicking the lightpath button launches the lightpath screen

Current Behavior

Clicking on the lightpath button as myself (apra) and amoopr causes the GUI to seg fault.

The message is as follows:

Traceback (most recent call last):
  File "/reg/g/pcds/pyps/apps/skywalker/gui/modules/dev-activate/pydm/widgets/shell_command.py", line 52, in mouseReleaseEvent
    self.execute_command()
  File "/reg/g/pcds/pyps/apps/skywalker/gui/modules/dev-activate/pydm/widgets/shell_command.py", line 67, in execute_command
    self.process = subprocess.Popen(args)
  File "/reg/g/pcds/pyps/conda/py36/envs/pcds-0.3.0/lib/python3.6/subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "/reg/g/pcds/pyps/conda/py36/envs/pcds-0.3.0/lib/python3.6/subprocess.py", line 1344, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: 'lightpath'
/reg/g/pcds/pyps/apps/skywalker/gui/modules/bin/skywalker: line 9: 20092 Aborted                 (core dumped) "${MODULES}/skywalker/scripts/skywalker" --live

Steps to Reproduce (for bugs)

  1. su amoopr (or have my apra account try it)
  2. ./skywalker
  3. click "lightpath"

Your Environment

This initially happened while I was using the GUI as myself. To see if this was just my account, I tried xcsopr and then amoopr and found that xcsopr worked fine while amoopr did not.

This behavior seems to be account dependent and not machine dependent since I replicated the failure on psbuild-rhel7-02, xcs-console, and amo-console.

APRashedAhmed commented 6 years ago

Just found this happening to cxiopr as well on cxi-console

ZLLentz commented 6 years ago

Might look at this tomorrow

hhslepicka commented 6 years ago

Is there something being added to the environment variables when you change between accounts?

On Wed, Dec 13, 2017 at 9:38 PM Zachary Lentz notifications@github.com wrote:

  • Can these users run lightpath directly from the command line outside the gui?
  • Are the permissions on any of these executables messed up? The exception here is a PermissionError

Might look at this tomorrow

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/slaclab/skywalker/issues/70#issuecomment-351614020, or mute the thread https://github.com/notifications/unsubscribe-auth/AHzmUQt7-pBdH46aevnW_5xKFIlmKLwvks5tALQ4gaJpZM4RBiaK .

ZLLentz commented 6 years ago

This is not a segfault. Don't scare me like that.

Everything works 100% if you do a conda install for skywalker.

The problem is that our dev checkout did not do a formal conda install. Our temporary launch script doesn't do any path modulation, so running the lightpath from the shell command widget doesn't have anything on the path to run. For whatever reason, subprocess.Popen raises a PermissionError instead of something more helpful.

The fast solution was to hotpatch the temporary launch script. No changes are needed to the skywalker repo.

The "real" solution will be to include skywalker in the next environment release, so that lightpath ends up in the conda bin.

Let me know if my fast solution didn't work for you.

I will be making a pydm PR for protecting the subprocess.Popen command with a try/except block.

hhslepicka commented 6 years ago

PR merged at PyDM. Thank you @ZLLentz