When ever I try to launch an application that is located on an AFP share, the CPU load raises to max and shortly after that the system locks. Why is this? How can I prevent it?
I'm on current Lion, problem persists since Snow Leopard. The AFP share is on a Synology DiskStation with current firmware.
After the GUI stopped working the windowserver.log reads as following. Every other log file is unchanged until the reboot related log entries.
Jan 19 19:35:35 [109] kCGErrorIllegalArgument: CGXGetWindowWorkspace: invalid window id: 49
Jan 19 19:35:35 [109] kCGErrorIllegalArgument: CGXGetWindowWorkspace: invalid window id: 3a
Jan 19 19:35:35 [109] kCGErrorIllegalArgument: CGXGetWindowWorkspace: invalid window id: 32
These entries are reproducible. Trying the same through VMware+Lion I experience no crash thus I conclude that there is no problem on server side.

.DS_storefiles. What then helped was to excecutedefaults write com.apple.desktopservices DSDontWriteNetworkStores true. After that, log out and back in. – gentmatt Jan 20 '12 at 21:22ps auxr | head -6from the Terminal. Post the output here. It will give us a list of the top 5 CPU processes running at the time. – afragen Jan 22 '12 at 21:20