After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 106164 - system-monitor fails to compile on solaris due to missing functions
system-monitor fails to compile on solaris due to missing functions
Status: RESOLVED FIXED
Product: system-monitor
Classification: Core
Component: general
unspecified
Other Solaris
: Urgent blocker
: ---
Assigned To: System-monitor maintainers
System-monitor maintainers
: 65011 115486 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2003-02-15 15:18 UTC by the_h1ghlander
Modified: 2011-11-11 10:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to allow gnome-system-monitor to complete compilation on Solaris (2.30 KB, patch)
2003-02-17 05:39 UTC, the_h1ghlander
none Details | Review

Description the_h1ghlander 2003-02-15 15:18:51 UTC
Compiling gnome-system-monitor under garnome (after porting 
libgtop to working status on Solaris), I get these errors.
These system calls are not in Solaris.

gcc  -O2 -pipe -falign-functions=4 -fomit-frame-pointer -mfancy-math-387
-mcpu=pentiumpro -g -L/opt/garnome/lib -L/opt/local/lib -L/usr/openwin/lib
-R/opt/garnome/lib -R/opt/local/lib -R/usr/openwin/lib -o
gnome-system-monitor  procman.o interface.o callbacks.o load-graph.o
proctable.o prettytable.o util.o infoview.o procactions.o procdialogs.o
memmaps.o favorites.o -threads -R/usr/openwin/lib -L/opt/garnome/lib
-L/usr/openwin/lib -L/opt/garnome/lib -lgnomeui-2 -lSM -lICE -lbonoboui-2
-lxml2 -lz -lgnomecanvas-2 -lgnome-2 -lart_lgpl_2 -lpangoft2-1.0 -lbonobo-2
-lgnomevfs-2 -lbonobo-activation -lgconf-2 -lORBit-2 -lnsl -lsocket -llinc
-lgthread-2.0 -lgtop-2.0 -lgtop_sysdeps-2.0 -lgtop_common-2.0 -lwnck-1
-lstartup-notification-1 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0
-lgdk_pixbuf-2.0 -lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0 -lgobject-2.0
-lgmodule-2.0 -ldl -lglib-2.0 -lintl -liconv   -liconv
Undefined			first referenced
 symbol  			    in file
getpt                               util.o
asprintf                            util.o
ld: fatal: Symbol referencing errors. No output written to gnome-system-monitor
collect2: ld returned 1 exit status
make[4]: *** [gnome-system-monitor] Error 1
Comment 1 the_h1ghlander 2003-02-17 05:39:10 UTC
Created attachment 14382 [details] [review]
Patch to allow gnome-system-monitor to complete compilation on Solaris
Comment 2 Peter O'Shea 2003-02-18 20:22:35 UTC
The patch works (sparc solaris 8).  Note that this is a dupe of bug 65011.
Comment 3 Kevin Vandersloot 2003-02-18 22:51:20 UTC
Cool! So does the root stuff work on Solaris? If you try to renice a
process not owned by you (or kill), can you enter in the root password
and have it work?
Comment 4 the_h1ghlander 2003-02-18 23:11:28 UTC
Guess some more debugging needs to be done.  That part of the code
doesn't seem to be working.  I'll see what I can do.
Comment 5 the_h1ghlander 2003-02-19 01:41:56 UTC
I'm seeing a couple of issues: 1) GTK+ does not like applications
to be setuid, so gnome-system-monitor won't run as root. This
cascades onto the problem of opening the kernel (kvm_open).  I'm
not sure this is such a serious issue immediately. The real problem
is the code I pinched to supplement asprintf, is failing on the
test of the vsnprintf, and that may well be a solaris implementation
issue. Basically, what happens in util.c is where it's trying to
build the Xauthority environment variable and it never gets any
further.  Obviously, because they are environment variables, 
a working asprintf is really needed, otherwise, security problems
are bound to happen.

vsnprintf should be returning the length of the formatted string,
and 0 as a size tells it's just supposed to return the size.
Will have to address this to Sun.


Comment 6 the_h1ghlander 2003-02-19 12:28:28 UTC
Making progress.  I found a fix to handle Solaris's broken C99
vsnprintf behavior.

In the vasprintf routine, 

If I replace 

  ret = vsnprintf(NULL, 0, format, ap);

with
  char c;
  ret = vsnprintf(&c, 1, format, ap);

vsnprintf returns the right length, and therefore the
XAUTHORITY and ICEAUTHORITY variables can get set in the
environment in the exec_su routine.

The next problem is the format of the su command. 

From the parameters, it's looking for GNU su (specifically
the -m flag), so I'm considering using an #ifdef to do this.
However, the next problem is that the password prompt is coming
out on the tty I started gnome-system-monitor from, instead of
it getting it from the pty.  This should glue all together,
and I'm sure that it works on linux correctly.  I just haven't
figured out why it's not doing the right things on solaris.
Comment 7 Kevin Vandersloot 2003-03-11 21:11:01 UTC
*** Bug 65011 has been marked as a duplicate of this bug. ***
Comment 8 devsk 2003-08-23 16:58:16 UTC
This patch never made it to the main branch? did it?  I still don't
see an implementation of getpt and asprintf in sysdeps/solaris.
Comment 9 Rolf Sponsel 2003-08-29 13:09:15 UTC
And it hasn't made it into gnome-system-monitor-2.3.0 either.
(See: http://bugzilla.gnome.org/show_bug.cgi?id=115486)

I experience the same behaviour on SPARC/Solaris 7 w/ gcc-3.2.2.
Comment 10 Rolf Sponsel 2003-08-29 17:14:08 UTC
Just FYI,

I've gnome-system-monitor running on Solaris 7 w/ Gnome-2.2.2, and I
can confirm the problem with the password prompt coming out on the
tty, as the_h1ghlander@yahoo.com earlier has described, when launching
gnome-system-monitor from a command line.

It actually displays a popup window and asks for the password, after
one has confirmed "End Process" in another popup window first. Once
one has entered the "Root Password and pressed the "End Process"
button the password popup window does not go away, but hangs. Instead
the prompt "Password:" is displayed at the command line. Once I have
supplied the correct password (at the command line) I receive kind of
"login banner", i.e. "Sun Microsystems Inc.   SunOS 5.7   Generic
Month Year" and then "-sh: kill: bad signal" at the command line, and
the hanged popup window resumes, i.e. is hidden (but WITHOUT KILLING
the chosen process) [ Could there be some kind of PAM-issue here? ].


One more observation:

When starting gnome-system-monitor in a terminal window, e.g. Xterm,
etc, the following message is displayed in the terminal window, but
gnome-system-manager continues to run (at least more or less as expected):

"glibtop: kvm_open(): Permission denied"

     until it is stopped, and the following message is displayed:

"glibtop: pid ##### received eof."


Comment 11 Vincent Untz 2003-10-03 09:37:44 UTC
*** Bug 115486 has been marked as a duplicate of this bug. ***
Comment 12 Kevin Vandersloot 2003-10-22 00:24:04 UTC
Applied. Thanks highlander.

THis should be available with gnome-system-monitor and libgtop 2.5.1.