HTCondor Project List Archives



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Condor-devel] stopping the GLIBC madness



Hello,

On Wed, Jul 25, 2007 at 04:49:59PM -0700, Derek Wright wrote:
> From your YDL port:
> 
> -#if defined(LINUX) && (defined(GLIBC21) || defined(GLIBC22) ||  
> defined(GLIBC23))
> +#if defined(LINUX) && (defined(GLIBC21) || defined(GLIBC22) ||  
> defined(GLIBC23) || defined(GLIBC24))
> 
> Please... can't we stop this madness?  Why not just this:

Yeah, I was looking at that while doing it and figuring out the autoconf
rules I'd need to fix that up the right way. I was going to fix it
later since I wanted to keep the code change and time to finish the
task reasonable.

> #if HAVE_RLIM_T_DEFINE
> #  undef rlim_t
> #elsif !HAVE_RLIM_T
>    typedef long rlim_t;
> #endif
> 
> And of course, the roughly 2 line change to configure.ac to check if  
> rlim_t is a defined preprocessor symbol at configure time or what...

Sadly, you've stumbled into a mine field with that particular example. :(

Here is the relevant part of a linux system header file:

/* Type for resource quantity measurement.  */
#ifndef __USE_FILE_OFFSET64
typedef __rlim_t rlim_t;
#else
typedef __rlim64_t rlim_t;
#endif
#ifdef __USE_LARGEFILE64
typedef __rlim64_t rlim64_t;
#endif

The above means that rlim_t can be a 64 bit quantity instead of a 32
bit quantity if _FILE_OFFSET_BITS is defined to be 64.  "So what?",
you say? Because the Condor libraries use the 32 bit version of rlim_t
while stork, which compiles with _FILE_OFFSET_BITS=64, uses the 64 bit
size of the rlim_t.

This means if stork tries to call a Condor library function passing an
rlim_t, you will get a compiler error because the rlim_t of the caller
(compiled with the 64 bit file offset changes to the header files)
is of different width than the rlim_t of the callee (compiled with the
default 32 bit file offset to the header files).

A simple autoconf check to see if rlim_t is defined doesn't work in this
case since rlim_t is in fact defined with or without _FILE_OFFSET_BITS=64,
but they are in actuality different widths. Most solutions to this
problem are ugly and probably time intensive to test.

This is why sometimes I don't do seemingly obvious incremental changes--I
discover crap like the above and it becomes a rathole. In the other
case you brought up, I think that there is a special autoconf rule which
already figures out if a signal handler takes a type or not and I think
I just have to use it. Until I actually do the change, however, I'm not
sure if it won't propogate beyond that.

Later,
-pete