Hello community,
here is the log from the commit of package icecream
checked in at Thu Jul 13 11:16:16 CEST 2006.
--------
--- KDE/icecream/icecream.changes 2006-07-12 09:40:57.000000000 +0200
+++ icecream/icecream.changes 2006-07-13 09:50:20.000000000 +0200
@@ -1,0 +2,11 @@
+Thu Jul 13 09:50:04 CEST 2006 - coolo@suse.de
+
+- 0.7.6:
+ - report all daemon error message to the client
+ - fix support for biarch machines that have only one
+ environment installed with another environment with
+ the same name and different architecture being around
+ - work-around a bug in older libstdc++
+ - ensure nobody uses -u root
+
+-------------------------------------------------------------------
@@ -4 +15 @@
-- 0.7.5 (r561480):
+- 0.7.5:
Old:
----
icecc-0.7.5.tar.bz2
New:
----
icecc-0.7.6.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ icecream.spec ++++++
--- /var/tmp/diff_new_pack.3o3qFf/_old 2006-07-13 11:16:10.000000000 +0200
+++ /var/tmp/diff_new_pack.3o3qFf/_new 2006-07-13 11:16:10.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package icecream (Version 0.7.5)
+# spec file for package icecream (Version 0.7.6)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -22,7 +22,7 @@
%endif
Prereq: /usr/sbin/useradd /usr/sbin/groupadd
Requires: gcc-c++
-Version: 0.7.5
+Version: 0.7.6
Release: 1
Source0: ftp://ftp.suse.com/pub/projects/icecream/icecc-%{version}.tar.bz2
Source1: %name-manpages.tar.bz2
@@ -139,8 +139,16 @@
%_libdir/pkgconfig/icecc.pc
%changelog -n icecream
+* Thu Jul 13 2006 - coolo@suse.de
+- 0.7.6:
+- report all daemon error message to the client
+- fix support for biarch machines that have only one
+ environment installed with another environment with
+ the same name and different architecture being around
+- work-around a bug in older libstdc++
+- ensure nobody uses -u root
* Wed Jul 12 2006 - coolo@suse.de
-- 0.7.5 (r561480):
+- 0.7.5:
- Don't block while looking for a scheduler over broadcast search.
- Fix logrotate
- immediately kick broken daemon connections
++++++ icecc-0.7.5.tar.bz2 -> icecc-0.7.6.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/icecream/NEWS new/icecream/NEWS
--- old/icecream/NEWS 2006-07-12 09:07:53.000000000 +0200
+++ new/icecream/NEWS 2006-07-13 09:48:36.000000000 +0200
@@ -1,6 +1,14 @@
+0.7.6 (r561764):
+ - report all daemon error message to the client
+ - fix support for biarch machines that have only one
+ environment installed with another environment with
+ the same name and different architecture being around
+ - work-around a bug in older libstdc++
+ - ensure nobody uses -u root
+
0.7.5 (r561480):
- - Don't block while looking for a scheduler over broadcast search.
- - Fix logrotate
+ - don't block while looking for a scheduler over broadcast search.
+ - fix logrotate
- immediately kick broken daemon connections
0.7.4 (r559927):
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/icecream/client/remote.cpp new/icecream/client/remote.cpp
--- old/icecream/client/remote.cpp 2006-07-05 22:29:39.000000000 +0200
+++ new/icecream/client/remote.cpp 2006-07-12 21:44:31.000000000 +0200
@@ -200,6 +200,15 @@
return usecs;
}
+static void check_for_failure( Msg *msg, MsgChannel *cserver )
+{
+ if ( msg && msg->type == M_STATUS_TEXT)
+ {
+ log_error() << static_cast(msg)->text << " - compiled on " << cserver->name <type != M_COMPILE_RESULT ) {
log_warning() << "waited for compile result, but got " << (char)msg->type << endl;
delete msg;
@@ -414,6 +424,8 @@
throw ( 19 );
}
+ check_for_failure( msg, cserver );
+
if ( msg->type == M_END )
break;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/icecream/configure.in new/icecream/configure.in
--- old/icecream/configure.in 2006-07-12 09:07:53.000000000 +0200
+++ new/icecream/configure.in 2006-07-13 09:48:36.000000000 +0200
@@ -4,7 +4,7 @@
AC_INIT(client/main.cpp)
-AM_INIT_AUTOMAKE(icecc, "0.7.5")
+AM_INIT_AUTOMAKE(icecc, "0.7.6")
AM_CONFIG_HEADER(config.h)
AC_CANONICAL_HOST
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/icecream/daemon/main.cpp new/icecream/daemon/main.cpp
--- old/icecream/daemon/main.cpp 2006-07-11 11:31:53.000000000 +0200
+++ new/icecream/daemon/main.cpp 2006-07-12 20:53:04.000000000 +0200
@@ -1369,6 +1369,9 @@
} else {
d.nobody_uid = pw->pw_uid;
d.nobody_gid = pw->pw_gid;
+ if (!d.nobody_gid || !d.nobody_uid) {
+ usage( "Error: -u <username> must not be root");
+ }
}
} else
usage( "Error: -u requires a valid username" );
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/icecream/daemon/serve.cpp new/icecream/daemon/serve.cpp
--- old/icecream/daemon/serve.cpp 2006-06-19 11:50:09.000000000 +0200
+++ new/icecream/daemon/serve.cpp 2006-07-12 21:34:16.000000000 +0200
@@ -71,6 +71,13 @@
int nice_level = 5;
+static void
+error_client( MsgChannel *client, string error )
+{
+ if ( IS_PROTOCOL_22( client ) )
+ client->send_msg( StatusTextMsg( error ) );
+}
+
/**
* Read a request, run the compiler, and send a response.
**/
@@ -105,6 +112,7 @@
log_info() << "should use " << job->environmentVersion() << "(" << job->targetPlatform() << ") " << job->jobID() << endl;
string dirname = basedir + "/target=" + job->targetPlatform() + "/" + job->environmentVersion();
if ( ::access( string( dirname + "/usr/bin/gcc" ).c_str(), X_OK ) ) {
+ error_client( client, dirname + "/usr/bin/gcc is not exexutable" );
log_error() << "I don't have environment " << job->environmentVersion() << "(" << job->targetPlatform() << ") " << job->jobID() << endl;
throw myexception( EXIT_DISTCC_FAILED ); // the scheduler didn't listen to us!
}
@@ -113,18 +121,22 @@
// without the chdir, the chroot will escape the
// jail right away
if ( chdir( dirname.c_str() ) < 0 ) {
+ error_client( client, string( "chdir to " ) + dirname + "failed" );
log_perror("chdir() failed" );
exit(145);
}
if ( chroot( dirname.c_str() ) < 0 ) {
+ error_client( client, string( "chroot to " ) + dirname + "failed" );
log_perror("chroot() failed" );
exit(144);
}
if ( setgid( nobody_gid ) < 0 ) {
+ error_client( client, "setgid failed" );
log_perror("setgid() failed" );
exit(143);
}
if ( setuid( nobody_uid ) < 0) {
+ error_client( client, "setuid failed" );
log_perror("setuid() failed" );
exit(142);
}
@@ -140,6 +152,7 @@
chdir( "/" );
if ( ::access( _PATH_TMP + 1, W_OK ) ) {
+ error_client( client, "can't write to " _PATH_TMP );
log_error() << "can't write into " << _PATH_TMP << " " << strerror( errno ) << endl;
throw myexception( -1 );
}
@@ -185,6 +198,7 @@
obj_fd = open( obj_file.c_str(), O_RDONLY|O_LARGEFILE );
if ( obj_fd == -1 ) {
log_error() << "open failed\n";
+ error_client( client, "open of object file failed" );
throw myexception( EXIT_DISTCC_FAILED );
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/icecream/daemon/workit.cpp new/icecream/daemon/workit.cpp
--- old/icecream/daemon/workit.cpp 2006-07-02 21:40:13.000000000 +0200
+++ new/icecream/daemon/workit.cpp 2006-07-12 21:34:16.000000000 +0200
@@ -99,6 +99,14 @@
must_reap = true;
}
+
+static void
+error_client( MsgChannel *client, string error )
+{
+ if ( IS_PROTOCOL_23( client ) )
+ client->send_msg( StatusTextMsg( error ) );
+}
+
int work_it( CompileJob &j,
unsigned int& in_compressed, unsigned int& in_uncompressed, MsgChannel* client,
string &str_out, string &str_err,
@@ -193,19 +201,25 @@
fcntl(main_sock[1], F_SETFD, FD_CLOEXEC);
setenv( "PATH", "usr/bin", 1 );
// Safety check
- if (getuid() == 0 || getgid() == 0)
+ if (getuid() == 0 || getgid() == 0) {
+ error_client( client, "UID is 0 - aborting." );
_exit(142);
+ }
#ifdef RLIMIT_AS
struct rlimit rlim;
- if ( getrlimit( RLIMIT_AS, &rlim ) )
+ if ( getrlimit( RLIMIT_AS, &rlim ) ) {
+ error_client( client, "getrlimit failed." );
log_perror( "getrlimit" );
+ }
rlim.rlim_cur = mem_limit*1024*1024;
rlim.rlim_max = mem_limit*1024*1024;
- if ( setrlimit( RLIMIT_AS, &rlim ) )
+ if ( setrlimit( RLIMIT_AS, &rlim ) ) {
+ error_client( client, "setrlimit failed." );
log_perror( "setrlimit" );
+ }
#endif
int argc = list.size();
@@ -270,7 +284,7 @@
for (;;) {
Msg* msg = client->get_msg(60);
- if ( !msg || (msg->type != M_FILE_CHUNK && msg->type != M_END) )
+ if ( !msg || (msg->type != M_FILE_CHUNK && msg->type != M_END) )
{
log_error() << "protocol error while reading preprocessed file\n";
delete msg;
@@ -299,6 +313,33 @@
if ( bytes == -1 ) {
log_perror("write to caching socket failed. ");
+
+ fd_set rfds;
+ FD_ZERO( &rfds );
+ FD_SET( sock_err[0], &rfds );
+
+ struct timeval tv;
+ tv.tv_sec = 1;
+ tv.tv_usec = 0;
+
+ ret = select( sock_err[0]+1, &rfds, 0, 0, &tv );
+
+ if ( ret > 0 && FD_ISSET(sock_err[0], &rfds) ) {
+ ssize_t bytes = read( sock_err[0], buffer, sizeof(buffer)-1 );
+ if ( bytes > 0 ) {
+
+ while ( bytes > 0 && buffer[bytes - 1] == '\n' )
+ bytes--;
+ buffer[bytes] = 0;
+
+ str_err = buffer;
+ }
+ }
+
+ if ( str_err.size() )
+ error_client( client, "compiler failed: " + str_err );
+ else
+ error_client( client, "compiler failed." );
delete msg;
msg = 0;
throw myexception (EXIT_COMPILER_CRASHED);
@@ -336,6 +377,7 @@
while ( waitpid(pid, 0, 0) < 0 && errno == EINTR)
;
unlink( tmp_output );
+ error_client( client, "compiler did not start" );
return EXIT_COMPILER_MISSING; // most likely cause
}
if (n == -1)
@@ -367,16 +409,15 @@
tv.tv_sec = 5;
tv.tv_usec = 0;
- {
- log_block bselect("waiting in select");
- ret = select( max_fd+1, &rfds, 0, 0, &tv );
- }
+ ret = select( max_fd+1, &rfds, 0, 0, &tv );
switch( ret )
{
case -1:
- if ( errno != EINTR ) // this usually means the logic broke
+ if ( errno != EINTR ) { // this usually means the logic broke
+ error_client( client, string( "select returned " ) + strerror( errno ) );
return EXIT_DISTCC_FAILED;
+ }
// fall through; should happen if tvp->tv_sec < 0
case 0:
struct rusage ru;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/icecream/debian/changelog new/icecream/debian/changelog
--- old/icecream/debian/changelog 2006-07-09 10:03:41.000000000 +0200
+++ new/icecream/debian/changelog 2006-07-12 21:30:06.000000000 +0200
@@ -1,3 +1,9 @@
+icecc (0.7.5-1) unstable; urgency=low
+
+ * New upstream version.
+
+ -- Andre Woebbeking Wen, 12 Jul 2006 21:11:42 +0200
+
icecc (0.7.4-1) unstable; urgency=low
* New upstream version.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/icecream/services/comm.h new/icecream/services/comm.h
--- old/icecream/services/comm.h 2006-07-11 11:28:34.000000000 +0200
+++ new/icecream/services/comm.h 2006-07-12 21:34:16.000000000 +0200
@@ -33,7 +33,7 @@
#include "job.h"
// if you increase the PROTOCOL_VERSION, add a macro below and use that
-#define PROTOCOL_VERSION 22
+#define PROTOCOL_VERSION 23
// if you increase the MIN_PROTOCOL_VERSION, comment out macros below and clean up the code
#define MIN_PROTOCOL_VERSION 21
@@ -41,6 +41,7 @@
#define MAX_SCHEDULER_PING 30
#define IS_PROTOCOL_22( c ) ( c->protocol >= 22 )
+#define IS_PROTOCOL_23( c ) ( c->protocol >= 23 )
enum MsgType {
// so far unknown
@@ -248,12 +249,12 @@
uint32_t client_id;
std::string preferred_host;
GetCSMsg () : Msg(M_GET_CS), count( 1 ),arg_flags( 0 ), client_id( 0 ) {}
- GetCSMsg (const Environments &envs, const std::string &f,
- CompileJob::Language _lang, unsigned int _count,
- std::string _target, unsigned int _arg_flags,
+ GetCSMsg (const Environments &envs, const std::string &f,
+ CompileJob::Language _lang, unsigned int _count,
+ std::string _target, unsigned int _arg_flags,
const std::string &host)
- : Msg(M_GET_CS), versions( envs ), filename(f), lang(_lang),
- count( _count ), target( _target ), arg_flags( _arg_flags ),
+ : Msg(M_GET_CS), versions( envs ), filename(f), lang(_lang),
+ count( _count ), target( _target ), arg_flags( _arg_flags ),
client_id( 0 ), preferred_host(host)
{}
virtual void fill_from_channel (MsgChannel * c);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/icecream/services/logging.cpp new/icecream/services/logging.cpp
--- old/icecream/services/logging.cpp 2006-07-10 12:35:48.000000000 +0200
+++ new/icecream/services/logging.cpp 2006-07-12 18:48:36.000000000 +0200
@@ -42,9 +42,11 @@
debug_level = level;
logfile_filename = filename;
- logfile_file.close();
+ if ( logfile_file.is_open() )
+ logfile_file.close();
ostream *output = 0;
if ( filename.length() ) {
+ logfile_file.clear();
logfile_file.open( filename.c_str(), fstream::out | fstream::app );
output = &logfile_file;
} else
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/icecream/services/scheduler.cpp new/icecream/services/scheduler.cpp
--- old/icecream/services/scheduler.cpp 2006-07-12 09:08:15.000000000 +0200
+++ new/icecream/services/scheduler.cpp 2006-07-12 21:34:16.000000000 +0200
@@ -57,6 +57,15 @@
of each other and sometimes take over ownership)
*/
+/* TODO:
+ - iron out differences in code size between architectures
+ + ia64/i686: 1.63
+ + x86_64/i686: 1.48
+ + ppc/i686: 1.22
+ + ppc64/i686: 1.59
+ (missing data for others atm)
+*/
+
/* The typical flow of messages for a remote job should be like this:
prereq: daemon is connected to scheduler
* client does GET_CS
@@ -578,26 +587,45 @@
return false;
}
-static bool
+/* Given a candidate CS and a JOB, check all installed environments
+ on the CS for a match. Return an empty string if none of the required
+ environments for this job is installed. Otherwise return the
+ host platform of the first found installed environment which is among
+ the requested. That can be send to the client, which then completely
+ specifies which environment to use (name, host platform and target
+ platform). */
+static string
envs_match( CS* cs, const Job *job )
{
if ( job->submitter == cs)
- return true; // it will compile itself
+ return cs->host_platform; // it will compile itself
+ /* Check all installed envs on the candidate CS ... */
for ( Environments::const_iterator it = cs->compiler_versions.begin(); it != cs->compiler_versions.end(); ++it )
{
- if ( platforms_compatible( it->first, job->target_platform ) )
+ if ( it->first == job->target_platform )
{
+ /* ... IT now is an installed environment which produces code for
+ the requested target platform. Now look at each env which
+ could be installed from the client (i.e. those coming with the
+ job) if it matches in name and additionally could be run
+ by the candidate CS. */
for ( Environments::const_iterator it2 = job->environments.begin(); it2 != job->environments.end(); ++it2 )
{
if ( it->second == it2->second && platforms_compatible( it2->first, cs->host_platform ) )
- return true;
+ return it2->first;
}
}
}
- return false;
+ return string();
}
+/* Given a candidate CS and a JOB, check if any of the requested
+ environments could be installed on the CS. This is the case if that
+ env can be run there, i.e. if the host platforms of the CS and of the
+ environment are compatible. Return an empty string if none can be
+ installed, otherwise return the platform of the first found
+ environments which can be installed. */
static string
can_install( CS* cs, const Job *job )
{
@@ -749,7 +777,7 @@
{
/* Make all servers compile a job at least once, so we'll get an
idea about their speed. */
- if (envs_match (cs, job))
+ if (!envs_match (cs, job).empty())
{
best = cs;
matches++;
@@ -763,7 +791,7 @@
break;
}
- if ( envs_match( cs, job ) )
+ if (!envs_match (cs, job).empty())
{
if ( !best )
best = cs;
@@ -827,10 +855,10 @@
{
trace() << "send ping " << ( *it )->nodename << endl;
( *it )->max_jobs *= -1; // better not give it away
- if(( *it )->send_msg( PingMsg() ))
+ if(( *it )->send_msg( PingMsg() ))
{
// give it a few seconds to answer a ping
- ( *it )->last_talk = time( 0 ) - MAX_SCHEDULER_PING
+ ( *it )->last_talk = time( 0 ) - MAX_SCHEDULER_PING
+ MIN_SCHEDULER_PING;
++it;
continue;
@@ -843,7 +871,7 @@
handle_end (old, 0);
continue;
}
- else
+ else
min_time = min (min_time, MAX_SCHEDULER_PING - now + ( *it )->last_talk);
#if DEBUG_SCHEDULER > 1
if ((random() % 400) < 0)
@@ -972,8 +1000,16 @@
job->state = Job::WAITINGFORCS;
job->server = cs;
- bool gotit = envs_match( cs, job );
- UseCSMsg m2(can_install( cs, job ), cs->name, cs->remote_port, job->id, gotit, job->local_client_id );
+ string host_platform = envs_match (cs, job);
+ bool gotit = true;
+ if (host_platform.empty ())
+ {
+ gotit = false;
+ host_platform = can_install (cs, job);
+ }
+
+ UseCSMsg m2(host_platform, cs->name, cs->remote_port, job->id,
+ gotit, job->local_client_id );
if (!job->submitter->send_msg (m2))
{
@@ -1430,6 +1466,8 @@
{
#if DEBUG_SCHEDULER > 1
trace() << "Handle_end " << c << " " << m << endl;
+#else
+ ( void )m;
#endif
CS *toremove = static_cast(c);
++++++ icecream-manpages.tar.bz2 ++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...