Community
Participate
Working Groups
3.6 RC3: Trying to open a file using the --launcher.openFile option I am getting following error: > eclipse --launcher.openFile myTextFile ld.so.1: eclipse: fatal: relocation error: file /eclipse/plugins/org.eclipse.equinox.launcher.gtk.solaris.sparc_1.1.0.v20100503/eclipse_1307.so: symbol sem_open: referenced symbol not found
Doing > setenv LD_PRELOAD /lib/librt.so fixes the error, but still no file is opened.
The openFile option is only currently only supported on win32, Linux GTK and Mac.
I think it was intended to work on all GTKs, I'm not sure why it doesn't work for solaris (once the required library is loaded). I'm also surprised there aren't any link messages for this when compiling.
Solaris doesn't like our semaphore name which is "SWT_Window_Eclipse" in my test. I found this buried in the solaris man page: The name argument conforms to the construction rules for a pathname. The first character of name must be a slash (/) character and the remaining characters of name cannot include any slash characters. For maximum portabil- ity, name should include no more than 14 characters, but this limit is not enforced. These restrictions don't seem to exist on linux. I'm not sure if we need to worry about the 14 character limit (we are over it), but we don't have the '/' character.
Once the semaphore name is fixed everything appears to be working fine on the launcher side, but I'm not seeing the file opened in the UI. Perhaps this really isn't supported on Solaris. Silenio, is SWT watching for the "org.eclipse.swt.filePath.message" property change on solaris?
Yes, SWT is watching for the property change on all GTK platforms (solaris and linux). The name of the selection atom has to be "SWT_Window_" + APP_NAME Is that changed as well?
(In reply to comment #6) > Yes, SWT is watching for the property change on all GTK platforms (solaris and > linux). The name of the selection atom has to be > > "SWT_Window_" + APP_NAME > > Is that changed as well? I had to change things around a little to get a '/' mutex name but I was able to keep the "SWT_Window_" atom. We were able to successfully find the window and change the filepath.message property on it. I'll have to try debugging the java side to see what is happening there.
Created attachment 171876 [details] patch Patch does the following so far: 1) link with librt.so 2) handle failure getting the semaphore, eclipse will start and not open the file instead of exiting. 3) Fix the semaphore name to start with '/' With this patch, everything appears to be working correctly in the launcher. However, I am still not seeing files get opened. Something must be wrong on the Java side.
Created attachment 171877 [details] eclipse_1307.so binary Here is a binary compiled with the above patch and an additional debug printf statement. It will print org.eclipse.swt.filePath.message=/path/to/file.txt: to the console when it successfully writes the file path to the property on the SWT window. When this is printed, everything succeeded as far as the launcher is concerned.
Silenio and I found a problem in SWT, I raised bug 316938
We can look at this patch for 3.6.1
+1 for 3.6.1.
patch released to branch