Bug 176805 - [Launcher] startup fails on Solaris 9 (libc.so.1: version `SUNW_1.22' not found)
Summary: [Launcher] startup fails on Solaris 9 (libc.so.1: version `SUNW_1.22' not found)
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Framework (show other bugs)
Version: 3.3   Edit
Hardware: Sun Solaris-GTK
: P3 blocker with 1 vote (vote)
Target Milestone: 3.3 RC1   Edit
Assignee: equinox.framework-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks: 185936
  Show dependency tree
 
Reported: 2007-03-09 05:59 EST by Helmut J. Haigermoser CLA
Modified: 2007-05-10 10:44 EDT (History)
7 users (show)

See Also:
tjwatson: review+


Attachments
Patch to support building on Solaris with gcc (1.56 KB, patch)
2007-05-04 11:33 EDT, Martin Oberhuber CLA
no flags Details | Diff
patch for scandir (3.54 KB, patch)
2007-05-04 15:09 EDT, Andrew Niefer CLA
no flags Details | Diff
binaries compiled with patch (33.28 KB, application/octet-stream)
2007-05-04 15:13 EDT, Andrew Niefer CLA
no flags Details
Patch for gcc, scandir and setenv (6.32 KB, patch)
2007-05-07 06:03 EDT, Martin Oberhuber CLA
no flags Details | Diff
Binaries compiled with gcc on Solaris9 (27.00 KB, application/x-compressed)
2007-05-07 06:13 EDT, Martin Oberhuber CLA
no flags Details
Binaries compiled with cc on Solaris 10 (33.52 KB, application/zip)
2007-05-07 10:41 EDT, Andrew Niefer CLA
no flags Details
libgdk-x11-2.0.so.0.100.0+0x136a0 problematic frame error report (10.67 KB, text/plain)
2007-05-10 09:49 EDT, sun_certified CLA
no flags Details
zip archive with hs_err_pid8204.log + hs_err_pid8204_traceback.txt (6.10 KB, application/octet-stream)
2007-05-10 10:23 EDT, sun_certified CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Helmut J. Haigermoser CLA 2007-03-09 05:59:23 EST
Build ID: I20070209-1006

Steps To Reproduce:
1. run "./eclipse" on solaris 9

More information:
Here is the error:
<verbatim>
ld.so.1: ./eclipse: fatal: libc.so.1: version `SUNW_1.22' not found (required by file ./eclipse)
Killed
</verbatim>
I know, Solaris 9 is not officially supported, but it cannot even be started
on any version of Solaris < 10 :( A solution would IMHO be to compile the
startup exe on solaris 9, some minor modifications would be neccessary in
the c code to achieve this...
Comment 1 Martin Oberhuber CLA 2007-05-04 05:19:34 EDT
This is a blocker for us, could we please get some comment from the Equinox / Launcher team?

Note that the Eclipse Download page lists the SDK as "Solaris 8 (SPARC/GTK 2)", and all SWT libraries are compatible with that, so I'd expect the Launcher to be compiled and run on Solaris 8 / Solaris 9 as well. For instance, see
http://download.eclipse.org/eclipse/downloads/drops/S-3.3M6-200703231616/

I know that according to the Eclipse 3.3 Project Plan, Solaris 10-GTK is the Reference Platform; but the Project Plan also says "Similarly, although untested, the Eclipse SDK should work fine on other OSes that support the same window system". There is no indication that Solaris 8/9, which used to be working fine, would be deprecated now. For reference, see
http://www.eclipse.org/eclipse/development/eclipse_project_plan_3_3.html#TargetOperatingEnvironments

My interpretation of "Reference Platform" is that most testing occurs on it, and bugs are given priority on it, but this doesn't mean that it is not supported any more! For our product based on Eclipse, Solaris 9 is a requirement.

In the future, a concept of "minimum required Platform" should perhaps be introduced in the project plan, based on what platforms are used to compile the natives. I've had a discussion with John Arthorne about that recently.

Also note that this bug is different than bug 172422 and bug 169379 filed against Eclipse 3.2 on Solaris 9. On our Solaris 9 machines, Eclipse 3.2 always ran fine, while this current Launcher problem is a blocker for us.
Comment 2 Andrew Niefer CLA 2007-05-04 10:11:19 EDT
The problem is that the only machine we have to build/test on is Solaris 10.  We  don't have a Solaris 9, and the old Solaris 8 machine we have is not in a good state, I have not been able to build even the 3.2 launchers on it.

We have gained access to a remote machine running Solaris 9 for testing this bug, but I'm not sure that building on it is a long term solution.

I'm hoping we can find a way to build on 10 so that it still works on 9.  Any help you can provide is appreciated.  Makefile and build.sh scripts are in org.eclipse.equinox.executable/library/gtk.
Comment 3 Martin Oberhuber CLA 2007-05-04 11:33:35 EDT
Created attachment 65933 [details]
Patch to support building on Solaris with gcc

I'd love to help but I'm kind of blocked... our only Solaris 9 machine doesn't have /usr/ucb/cc installed, and when I try building with gcc it complains that it cannot find scandir. I searched all the libs, but just cannot figure out where it is declared -- I assume it's part of the optional language pack only.

Anyways, attached is a non-intrusive patch to support building with gcc. On my particular machine, here's the build script I'd have used:

cd org.eclipse.equinox.executable/library/gtk
setenv TOOL_ROOT /Net/szg-rhfs/szg-rhfs3/t5-dev/tools
source $TOOL_ROOT/etc/gcc-3.4.5.csh
setenv CC gcc
build.sh

And here's what it spits out:
Building SunOS launcher. Defaults: -os solaris -arch sparc -ws gtk
gcc -O -s  -DSOLARIS  -fpic  -DDEFAULT_OS="\"solaris\""  -DDEFAULT_OS_ARCH="\"sp
arc\""  -DDEFAULT_WS="\"gtk\""  -I.  -I..  -I/include -I/include/solaris  `pkg-c
onfig --cflags gtk+-2.0` -c ../eclipseMain.c -o eclipseMain.o
[...]
gcc -o eclipse eclipseMain.o eclipseConfig.o eclipseCommon.o eclipseGtkCommon.o
`pkg-config --libs-only-L gtk+-2.0` -lgtk-x11-2.0 -lgdk_pixbuf-2.0 -lgobject-2.0
 -lgdk-x11-2.0 -lglib-2.0 -lthread -ldl -lc
Undefined                       first referenced
 symbol                             in file
scandir                             eclipseCommon.o
ld: fatal: Symbol referencing errors. No output written to eclipse

So if you manage to change the code such that it works without scandir and uses readdir instead, I'd probably be able to help out.
Comment 4 Martin Oberhuber CLA 2007-05-04 11:36:45 EDT
PS perhaps you could hook up with the SWT team for a build machine, or the SWT team could contribute a build on one of their machines?

The build seems simple enough... see my script above. 
Perhaps Carolyn could give it a try?
Comment 5 Helmut J. Haigermoser CLA 2007-05-04 11:39:01 EDT
Missing scandir/alphasort functions on solaris have been a problem
for a long time, here is a sample implementation of scandir to work around
the problem:
http://archives.seul.org/gdis/gdiscuss/Apr-2001/msg00002.html
Comment 6 John Arthorne CLA 2007-05-04 11:46:32 EDT
It looks like scandir is only added to the standard libc in Solaris 10:

http://forum.java.sun.com/thread.jspa?threadID=5074379&messageID=9271104
Comment 7 Andrew Niefer CLA 2007-05-04 12:00:49 EDT
We are working with the SWT team.  They build on Solaris 10 as well, we are using their machine :)

I have managed to get the shared library eclipse_1013.so working ok (according to ldd on Solaris 8) by removing -lc from the link.  However, eclipse executable still has the problem:
libc.so.1 (SUNW_1.22) =>         (version not found)

If I link the eclipse executable as a shared library (cc -G), then it is ok, but it obviously doesn't run then.

So what is the difference between linking as an executable and as a shared library that pulls in the SUNW_1.22 version.

As for scanddir, I don't think it would be a big deal to rewrite that code to use readdir,  we are already doing something different on windows (FindFirstFile/FindNextFile).  We can do this if building on 9 turns out to be the only option.
Comment 8 Andrew Niefer CLA 2007-05-04 12:08:48 EDT
Wait a minute.  If scandir doesn't exist in Solaris 9's libc, then this is likely why we are getting the version requirement.  (I think linking as a shared library may allow unresolved symbols, so my previous comment may have been a red herring).


I will rewrite that piece of code to see if it changes things.
Comment 9 Bogdan Gheorghe CLA 2007-05-04 12:39:58 EDT
BTW, I am able to run the latest Eclipse build on Solaris 9 by using:

java -jar plugins/[org.eclipse.equinox.launcher_1.0.0.v20070319.jar]

where [org.eclipse.equinox.launcher_1.0.0.v20070319.jar] is replaceable by whatever launcher jar you have in the current eclipse...
Comment 10 Andrew Niefer CLA 2007-05-04 15:09:44 EDT
Created attachment 65954 [details]
patch for scandir
Comment 11 Andrew Niefer CLA 2007-05-04 15:13:03 EDT
Created attachment 65955 [details]
binaries compiled with patch

The attached zip contains binaries compiled on Solaris 10.  When I did an ldd on them from Solaris 8, everything resolved.  I have not actually run an eclipse with them on 8 or 9.
Comment 12 Martin Oberhuber CLA 2007-05-04 16:16:59 EDT
Hm... on my machine, the new executable fails with
ld.so.1: ./eclipse: fatal: libc.so.1: open failed: No such file or directory
Segmentation fault (core dumped)

I tried recompiling with gcc on my Solaris 9 machine, and it worked without error this time. But got the same result (open failed, coredump). No idea why... according to ldd, everything looks good, shared libs are resolved either with or without LD_LIBRARY_PATH - pretty weird...

Funny thing is, that both Andrew's attachment and my own build run fine on my Solaris 10 box. I really don't understand why I cannot run the exe built by Solaris 9 gcc on the very same machine...
Comment 13 Martin Oberhuber CLA 2007-05-07 05:23:04 EDT
I debugged this and found out:

* The "libc.so.1 not found" error was there because I had only replaced the
  "eclipse" executable and thought that the sharedlib (eclipse_1014.so) could
  live in the same directory; but I really need to move eclipse_1014.so into
  plugins/org.eclipse.equinox.launcher.gtk.solaris.sparc_1.0.0.v20070426

* When I do that, I get another error: "cannot resolve setenv". It turns out 
  that setenv() is defined on Linux and Solaris 10 only, but not on Solaris 9.
  So for Solaris, we need to write setenv() ourselves, calling the older known
  putenv() function instead.

We'll see what other errors come up once the setenv issue is resolved...
Comment 14 Martin Oberhuber CLA 2007-05-07 06:03:21 EDT
Created attachment 66068 [details]
Patch for gcc, scandir and setenv

Replacing setenv with a self-written function using putenv did the trick!

Attached patch can be compiled on Solaris 9 and actually works. 
When starting Eclipse, I only get font warnings like the following but I guess these are due to my installation of GTK and can be ignored:

** (Eclipse:10614): WARNING **: Couldn't load font "adobe-courier Bold 14" falling back to "Sans Bold 14"
Comment 15 Martin Oberhuber CLA 2007-05-07 06:13:35 EDT
Created attachment 66070 [details]
Binaries compiled with gcc on Solaris9

Attached archive contains the Launcher binaries, compiled with gcc-3.4.5 on Solaris 9 and tested on Solaris 9.
  * extract "eclipse" to the root directory of the installation
  * extract "eclipse_1013.so" to the Launcher plugin - on Eclipse 3.3M7, it's
    plugins/org.eclipse.equinox.launcher.gtk.solaris.sparc_1.0.0.v20070426

Build script I used:
--------------------
cd org.eclipse.equinox.executable/library/gtk
setenv PATH /Net/szg-rhfs/szg-rhfs3/t5-dev/tools/gcc/3.4.5/SunOS/5.7/bin:$PATH
setenv CC gcc
build.sh -java /usr/j2se

Other Build Info
----------------
My gcc was configured and built on Solaris7 with 
   ./configure --with-dwarf-2 --disable-shared

Andrew, if you'd like to commit the patch, recompile on your machine and attach your binaries as a patch I could test them.

If somebody in the community could also test on Solaris 8, it would be great -- we don't have a Solaris 8 machine with GTK installed, unfortunately.

BTW, I notice that a native launcher for Solaris-Motif is missing. It would only part of the Source build, but I think this should be added...
Comment 16 Martin Oberhuber CLA 2007-05-07 06:44:11 EDT
Created bug 185734 to track the missing Launcher for Solaris-Motif.
Comment 17 Andrew Niefer CLA 2007-05-07 10:41:30 EDT
Created attachment 66111 [details]
Binaries compiled with cc on Solaris 10

Thank you Martin.  Attached are binaries compiled with your patch on Solaris 10 with cc.  I was able to run this remotely on a Solaris 9 box that I've gotten access to for testing. (As well as the Solaris 10 box they were compiled on).
I will likely release this today if no problems are found.
Comment 18 Andrew Niefer CLA 2007-05-07 16:49:44 EDT
done.  Please try tomorrow's IBuild
Comment 19 Martin Oberhuber CLA 2007-05-08 04:35:56 EDT
Verified that the launcher works fine on Solaris 9 out of CVS.
Will verify the next I-build when it's available.
Comment 20 sun_certified CLA 2007-05-10 09:49:31 EDT
Created attachment 66670 [details]
libgdk-x11-2.0.so.0.100.0+0x136a0 problematic frame error report

thanks for the solaris 9 launcher patch you provided in <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=176805#c15">comment #15</a>.

however, after downloading and installing eclipse-SDK-3.3M7, i downloaded your patched launcher binaries. i followed the instructions in <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=176805#c15">comment #15</a> to the letter and the patched launcher crashed my jvm (see attached hs_err_pid8204.log) and dumped core. any suggestions?
Comment 21 Andrew Niefer CLA 2007-05-10 10:12:10 EDT
(In reply to comment #20)
> Created an attachment (id=66670) [details]
> libgdk-x11-2.0.so.0.100.0+0x136a0 problematic frame error report

See bug 185936
Comment 22 sun_certified CLA 2007-05-10 10:23:59 EDT
Created attachment 66678 [details]
zip archive with hs_err_pid8204.log + hs_err_pid8204_traceback.txt

i think i used the wrong content type in that first attachment.in case it is of any use, this time i've also included a traceback of the core dump mentioned in comment #20.
Comment 23 sun_certified CLA 2007-05-10 10:32:36 EDT
(In reply to comment #21)
> (In reply to comment #20)
> > Created an attachment (id=66670) [details] [details]
> > libgdk-x11-2.0.so.0.100.0+0x136a0 problematic frame error report
> 
> See bug 185936
> 
thanks andrew. and apologies for not seeing your reply before i resubmitted that last attachment.must have been packing it up and sending it when your reply arrived.