gcl-devel
[Top][All Lists]
Advanced

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

Re: [Gcl-devel] Re: GCL 2.7.0 t3 progress, and a configure problem


From: Camm Maguire
Subject: Re: [Gcl-devel] Re: GCL 2.7.0 t3 progress, and a configure problem
Date: 22 Jul 2005 23:54:25 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Greetings!  Just a follow up here to enquire if there was any success with
at least 2Gb on 32bit Linux, and how the shared lib load start was
raised so high.

Please note that I will be out of email contact for 1 week.

Take care,

"Warren A. Hunt Jr." <address@hidden> writes:

> Hi David,
> 
> Boyer and I have been trying to figure this out as well.  It would be
> tremendous if you could figure out how to move the start of the shared
> libraries up to 0xB0000000.  Also, the place where "malloc" also needs
> to be move up as the first thing "printf" does is allocate some space.
> 
> Below is a program that will allow you to raise the "brk" up and it is
> for this reason that Camm is looking at making GCL compile with a
> static option.  (Schelter also had a static compile option avaliable
> with AKCL, but over the years it fell out of use -- bit rot occurred
> -- and now it is not possible to successfully compile GCL with the
> "--enable-static" option.)  The other reason is that compiling a
> program that uses shared libraries guarantees that it won't work a
> year from now (at least at UT) because the C-libraries are always
> being changed and things just break.
> 
> Just another small point, even if you create a static image of the
> program below and execute a "printf" before the call to "brk", then a
> one-page block of memory is allocated at 0x40000000 -- wreaking the
> attempt to have a large contiguous memory block.
> 
> Cheers,
> 
> Warren
> ++++++
> 
> /*
> 
> test-sbrk.c                                          Boyer & Hunt
> 
> Attempt to raise "brk" to beyond 0x40000000.
> 
> gcc --static -o test-sbrk test-sbrk.c
> ./test-sbrk
> 
> */
> 
> #include <unistd.h>
> #include <sys/mman.h>
> #include <sys/types.h>
> #include <stdio.h>
> 
> main()
> {
>   int brk_int;
>   //  void *setbrk = (void *) 0xbff80000; // brk limit
>   void *setbrk = (void *) 0xb0000000; // brk limit
> 
>   void *bottom;
>   void *top;
>   void *malloc_ptr;
> 
>   bottom  = (void *) sbrk( 0 );
>   brk_int = (int)     brk( setbrk );
>   top     = (void *) sbrk( 0 );
> 
>   if ( (int) bottom == -1 ) {
>     printf("Statement  \"bottom  = sbrk( 0 );\"  Failed\n");
>     return( 0 );
>   }
> 
>   if ( brk_int == -1 ) {
>     printf("Statement  \"  brk_int = (void *)brk( setbrk );\"  Failed\n");
> 
>     printf( "Initial brk address:  %8x \n", bottom );
>     printf( "  Final brk address:  %8x \n", top );
> 
>     return( 0 );
>   }
> 
>   if ( (int) top == -1 ) {
>     printf("Statement  \"top  = sbrk( 0 );\"  Failed\n");
>     return( 0 );
>   }
> 
>   printf( "Large   brk succeeded! \n" );
>   printf( "       Initial brk address:  %8x \n", bottom );
>   printf( "         Final brk address:  %8x \n", top );
>   printf( "Total contiguous memory is:  %u \n",
>         ((unsigned int) top) - ((unsigned int) bottom) );
>   printf( "Total contiguous memory is:  0x%x \n",
>         ((unsigned int) top) - ((unsigned int) bottom) );
> 
>   malloc_ptr = (void *)malloc( 100 * 1024 * 1024 );
>   
>   if ( malloc_ptr == NULL )
>     printf( "Statement \"  malloc_ptr = malloc( 100 * 1024 * 1024 );\" 
> Failed.\n" );
>   else
>     printf( "Statement \"  malloc_ptr = malloc( 100 * 1024 * 1024 );\" 
> Succeeded.\n" );
> 
>   return( 0 );
> }
> 
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 
>   To: <address@hidden>
>   Cc: address@hidden, address@hidden, address@hidden,
>         address@hidden
>   Subject: Re: [Gcl-devel] Re: GCL 2.7.0 t3 progress, and a configure problem
>   From: Camm Maguire <address@hidden>
>   Date: 15 Jul 2005 16:43:49 -0400
> 
>   Greetings, and thank you so much for bringing up this report!
> 
>   You apparently have the first system I've run across which loads the
>   shared libraries way up just beneath the stack.  
> 
>   > checking for shared library/C stack ceiling to heap... 0xb75eb000
> 
>   This is the 'holy grail' we've been looking for for quite a while, as
>   it allows a contiguous heap up to 2.7Gb on 32bit Linux, even using
>   shared libraries.  I'm separately working on a static compilation
>   option which should produce the same result on 'generic Linux', which
>   you apparently do not have, but you clearly will have the first
>   opportunity to test big heap on 32bit, and avoid all the bugs I'll no
>   doubt introduce in early static linking versions.  It would be most
>   helpful if you could describe in as much detail as possible your
>   system configuration -- even the kernel patches which enable this
>   behavior.  I had heard that some flavor of redhat did this by default,
>   but I don't yet know how.  When I do, I'd like to upload a
>   kernel-patch package into the Debian archive achieving the same, to
>   extend this ability to Debian based users.  If you have a support
>   contract with Redhat and could give them a call requesting a minimal
>   kernel-patch, which must be GPL'el by definition, that would be
>   fantastic!
> 
>   As this is a new and as yet untested configuration which is not
>   accessible to me, let me suggest a patch to try.  Perhaps you can
>   provide feedback and we can converge via email.  Normally I'd test on
>   my own system before suggesting anything.
> 
>   
> =============================================================================
>   Index: configure.in
>   ===================================================================
>   RCS file: /cvsroot/gcl/gcl/configure.in,v
>   retrieving revision 1.190
>   diff -u -r1.190 configure.in
>   --- configure.in    18 Jun 2005 22:09:26 -0000      1.190
>   +++ configure.in    15 Jul 2005 20:31:54 -0000
>   @@ -1355,7 +1355,7 @@
>      j=((unsigned long)$enable_maxpage <<$PAGEWIDTH) + $dbegin;
>      j=$heap_ceiling && j>$heap_ceiling ? $heap_ceiling : j;
>      j-=$dbegin;
>   -  for (i=1;i<=j;i<<=1);
>   +  for (i=1;i<<1 && i<=j;i<<=1);
>      if (i>j) i>>=1;
>      fprintf(fp,"%ld",i>>$PAGEWIDTH);
>      fclose(fp);
>   Index: configure
>   ===================================================================
>   RCS file: /cvsroot/gcl/gcl/configure,v
>   retrieving revision 1.184
>   diff -u -r1.184 configure
>   --- configure       18 Jun 2005 22:09:26 -0000      1.184
>   +++ configure       15 Jul 2005 20:31:55 -0000
>   @@ -4710,7 +4710,7 @@
>      j=((unsigned long)$enable_maxpage <<$PAGEWIDTH) + $dbegin;
>      j=$heap_ceiling && j>$heap_ceiling ? $heap_ceiling : j;
>      j-=$dbegin;
>   -  for (i=1;i<=j;i<<=1);
>   +  for (i=1;i<<1 && i<=j;i<<=1);
>      if (i>j) i>>=1;
>      fprintf(fp,"%ld",i>>$PAGEWIDTH);
>      fclose(fp);
>   
> =============================================================================
> 
>   At first, this should limit the heap to 2Gb, even though you could go
>   higher.  I'll have to rework the constraints on heap size being a
>   power of two separately.
> 
>   Take care,
> 
> 
>   <address@hidden> writes:
> 
>   > Camm Maguire wrote:
>   > > OK, I cannot reproduce with 524288, but can see how there could
>   > > possibly be a problem here.  Perhaps you could post your full
>   > > configure log before the hang.  Here is the program doing the test --
>   > > I need the values of the shell variables prefixed by $ especially:
>   > >
>   > > main()
>   > > {
>   > >   char *b;
>   > >   unsigned long i,j;
>   > >   FILE *fp = fopen("conftest1","w");
>   > >   j=((unsigned long)$enable_maxpage <<$PAGEWIDTH) + $dbegin;
>   > >   j=$heap_ceiling && j>$heap_ceiling ? $heap_ceiling : j;
>   > >   j-=$dbegin;
>   > >   for (i=1;i<=j;i<<=1);
>   > >   if (i>j) i>>=1;
>   > >   fprintf(fp,"%ld",i>>$PAGEWIDTH);
>   > >   fclose(fp);
>   > >   return 0;
>   > > }],tmp_maxpage=`cat conftest1`,tmp_maxpage=0,tmp_maxpage=0)
>   > >
>   > OK, here is the complete output from the failed configure.  I don't have 
> the config.log from that build anymore, but I can
>   > recreate it if need be.
>   > 
>   > ./configure --enable-maxpage=524288
>   > loading cache ./config.cache
>   > checking host system type... i686-pc-linux-gnu
>   > host=i686-pc-linux-gnu
>   > enable_machine=
>   > use=386-linux
>   > checking for gcc... (cached) gcc
>   > checking whether the C compiler (gcc    ) works... yes
>   > checking whether the C compiler (gcc    ) is a cross-compiler... no
>   > checking whether we are using GNU C... (cached) yes
>   > checking whether gcc accepts -g... (cached) yes
>   > checking how to run the C preprocessor... (cached) gcc -E
>   > checking for gawk... (cached) gawk
>   > checking system version (for dynamic loading)... checking for makeinfo... 
> (cached) makeinfo
>   > Linux-2.4.21-4.ELsmp
>   > checking for unistd.h... (cached) yes
>   > checking for sysconf in -lc... (cached) yes
>   > checking for _SC_CLK_TCK... 100
>   > checking for gmp.h... (cached) yes
>   > checking for __gmpz_init in -lgmp... (cached) yes
>   > checking for external gmp version... checking for leading underscore in 
> object symbols... no
>   > checking for GNU ld option -Map... yes
>   > checking for size of gmp limbs... 4
>   > checking _SHORT_LIMB... no
>   > checking _LONG_LONG_LIMB... no
>   > checking for X... (cached) no
>   > checking for main in -lXmu... (cached) no
>   > checking for main in -lXt... (cached) no
>   > checking for main in -lXext... (cached) no
>   > checking for main in -lXaw... (cached) no
>   > checking for main in -lX11... (cached) no
>   > missing x libraries -- cannot compile xgcl
>   > checking for bfd.h... (cached) yes
>   > checking for bfd_init in -lbfd... (cached) yes
>   > checking if need to define CONST for bfd... no
>   > checking for useable bfd_boolean... yes
>   > checking size of long... (cached) 4
>   > checking size of int... (cached) 4
>   > checking size of short... (cached) 2
>   > checking size of char... (cached) 1
>   > checking for number of bits in char... 8
>   > checking for endian.h... (cached) yes
>   > checking endianness... little
>   > checking for sbrk... yes
>   > checking for randomized sbrk... no
>   > checking for required object alignment... 8
>   > checking for C extension variable alignment... __attribute__ ((aligned 
> (8)))
>   > checking TYPE_BITS macro... 0xff09
>   > checking sizeof struct contblock... 8
>   > checking DBEGIN... 0x8000000
>   > checking for pagewidth... 12
>   > checking CSTACK_ADDRESS... 0xbfffffff
>   > checking NEG_CSTACK_ADDRESS... yes
>   > checking finding CSTACK_ALIGNMENT... 16
>   > checking CSTACK_DIRECTION... -1
>   > checking finding default linker script... got it
>   > checking trying to lower heap start... checking linker script... done
>   > checking revised DBEGIN... 0x0
>   > checking for shared library/C stack ceiling to heap... 0xb75eb000
>   > checking for maxpage revision...
>   > Thanks in advance,
>   > David Hardin
>   > _______________________________________________
>   > Gcl-devel mailing list
>   > address@hidden
>   > http://lists.gnu.org/mailman/listinfo/gcl-devel
> 
>   -- 
>   Camm Maguire                                                address@hidden
>   ==========================================================================
>   "The earth is but one country, and mankind its citizens."  --  Baha'u'llah
> 
> 
> 
> 

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah




reply via email to

[Prev in Thread] Current Thread [Next in Thread]