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

error dwarf therapist / savegamefolder with kubuntu #12

Closed
Hmpfmg opened this issue Sep 19, 2013 · 14 comments
Closed

error dwarf therapist / savegamefolder with kubuntu #12

Hmpfmg opened this issue Sep 19, 2013 · 14 comments
Milestone

Comments

@Hmpfmg
Copy link

Hmpfmg commented Sep 19, 2013

LNP generates an error when pressing the "open savegame folder" button under kubuntu 12.10 and dwarf therapist can't communicate with df

errormessage:

java.lang.IllegalStateException: Cannot open folder df_linux/data/save!
at nl.dricus.df.action.OpenFolderAction.actionPerformed(OpenFolderAction.java:67)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3312)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:708)
at java.awt.EventQueue$4.run(EventQueue.java:706)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Caused by: java.io.IOException: Failed to show URI:file:/home/pet/DF/df_linux/data/save/
at sun.awt.X11.XDesktopPeer.launch(XDesktopPeer.java:114)
at sun.awt.X11.XDesktopPeer.open(XDesktopPeer.java:77)
at java.awt.Desktop.open(Desktop.java:272)
at nl.dricus.df.action.OpenFolderAction.actionPerformed(OpenFolderAction.java:65)
... 36 more

@andrewd18
Copy link
Owner

I think you're reporting two different issues here.

  1. The "Open Savegames Folder" button in the LNP launcher does not work. This is a known issue with the LNP launcher. See "WARNING" in the LNP launcher thread. http://www.bay12forums.com/smf/index.php?topic=124613
  2. Dwarf Therapist complains that it cannot connect to Dwarf Fortress. Dwarf Therapist requires that you have a region loaded and running. It will not be able to find DF from the main menu screen. Please try loading a game and clicking the connect button in Dwarf Therapist.

@andrewd18
Copy link
Owner

Do you get a message in the command line output from LNP saying "ptrace attach: operation not permitted"?

@Hmpfmg
Copy link
Author

Hmpfmg commented Sep 30, 2013

df error

here's the error message.

@Hmpfmg
Copy link
Author

Hmpfmg commented Sep 30, 2013

oh.. just seen the command line output "ptrace attach: operation not permitted"

@andrewd18
Copy link
Owner

Got it. The "ptrace attach: operation not permitted" is good news, actually, because that means we've found the source of the problem. :)

In recent versions of Ubuntu, the Ubuntu kernel team turned on a kernel feature called "ptrace protection". This prevents an application to connect to another one and read its memory. See https://wiki.ubuntu.com/SecurityTeam/Roadmap/KernelHardening#ptrace%20Protection

Unfortunately, attaching to the memory of another program is exactly what DwarfTherapist does.

You'll need to manually disable ptrace protection on your machine. The following command should do it:

sudo echo 0 > /proc/sys/kernel/yama/ptrace_scope

@Hmpfmg
Copy link
Author

Hmpfmg commented Sep 30, 2013

You got it! You'r the best! :)

echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope

work's fine for me!

@andrewd18
Copy link
Owner

Fantastic. I'm going to add a step in the installer to check for ptrace_scope and I'll reuse your command in the documentation. I'll close this once that check gets added.

Thanks for the report.

@andrewd18
Copy link
Owner

Resolved in 0.3.0 branch as of commit 9cf3a8c.

@aalbaugh
Copy link

aalbaugh commented Oct 1, 2013

Note for anyone running Ubuntu (not sure what versions, i am using 12.10 Quantal). The above solutions will not work, because the /proc/sys/kernel/yama/... folder seems to be protected. I was unable to use sudo to make any changes via a straight echo > 0 ... The second solution, piping output from echo to a sudo-privileged 'tee' did, in fact work. I'm not sure if the change will be permanent, however.

A previous attempt, made by first 'sudo su' -ing to root did not stay.

@andrewd18
Copy link
Owner

The second solution, piping output from echo to a sudo-privileged 'tee' did, in fact work. I'm not sure if the change will be permanent, however.

/proc is managed by the kernel and you'd be able to find out if the option stayed by rebooting.

@aalbaugh
Copy link

aalbaugh commented Oct 1, 2013

yeah, i'll check after class.

@andrewd18
Copy link
Owner

I'd bet it won't persist. On the other hand I bet this will work:

echo "kernel.yama.ptrace_scope = 0" | sudo tee /etc/sysctl.d/10-ptrace.conf

@aalbaugh
Copy link

aalbaugh commented Oct 2, 2013

you're correct, it did not persist.

The change you suggested should work, will get back to you once I know for sure.

@andrewd18
Copy link
Owner

There is now a wiki page talking about this, and 0.3.0 will look for and inform the user if ptrace protection is turned on. Closing the ticket.

https://github.com/andrewd18/df-lnp-installer/wiki/Dwarf-Therapist-Cannot-Connect-to-Dwarf-Fortress

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

3 participants