Re: [racket-dev] SGC as default

2014-08-13 Thread Tobias Hammer

What about ./configure --enable-racket=`which racket` ?
Already needed and used for cross-compilation.

Tobias


On Tue, 12 Aug 2014 18:00:21 +0200, Matthew Flatt mfl...@cs.utah.edu  
wrote:



I'm not sure how difficult it will be. It's tedious enough that the
last time I thought about it, I just left a note next to
no-cgc-needed in racket/src/racket/Makefile.in, but maybe it's
worth pursuing now.

At Tue, 12 Aug 2014 04:39:55 -0700, Sam Tobin-Hochstadt wrote:

How difficult would it be to allow the bootstrap process to use a
preexisting Racket installation? This would alleviate some of the
performance loss, for example in rebuilds by developers or in continuous
integration.

Sam
On Aug 11, 2014 11:16 PM, Matthew Flatt mfl...@cs.utah.edu wrote:

 I've changed the Racket CGC implementation --- which is mostly used
 only to build the normal Racket variant --- to use SGC by default,
 instead of the Boehm GC. The intent of the switch is to make the more
 portable GC the default.

 If you have an existing build in a repo checkout, then `make` is  
likely

 to fail, because the makefile dependencies are not precise enough to
 deal with the switch. You can discard your old build directory, or it
 might work to simply delete

   builddir/racket/libmzgc.a

 If you're using CGC and want to continue using the Boehm GC, then
 provide `--disable-sgc` to `configure`. I've tuned SGC to bring its
 performance closer to the Boehm GC, but it's still slower.

 _
   Racket Developers list:
   http://lists.racket-lang.org/dev


_
  Racket Developers list:
  http://lists.racket-lang.org/dev



--
Tobias Hammer
DLR / Robotics and Mechatronics Center (RMC)
Muenchner Str. 20, D-82234 Wessling
Tel.: 08153/28-1487
Mail: tobias.ham...@dlr.de
_
 Racket Developers list:
 http://lists.racket-lang.org/dev


Re: [racket-dev] SGC as default

2014-08-13 Thread Matthew Flatt
Good point!

I assumed (based on earlier conversations?) that Sam knows about
`--enable-racket=...`. I thought that he was commenting on how the
build process would create things that are needed only for `racketcgc`,
even when `racketcgc` itself isn't needed.

I've now pushed changes that should skip all `racketcgc`-specific
pieces when `--enable-racket=...` is provided.

At Wed, 13 Aug 2014 11:08:22 +0200, Tobias Hammer wrote:
 What about ./configure --enable-racket=`which racket` ?
 Already needed and used for cross-compilation.
 
 Tobias
 
 
 On Tue, 12 Aug 2014 18:00:21 +0200, Matthew Flatt mfl...@cs.utah.edu  
 wrote:
 
  I'm not sure how difficult it will be. It's tedious enough that the
  last time I thought about it, I just left a note next to
  no-cgc-needed in racket/src/racket/Makefile.in, but maybe it's
  worth pursuing now.
 
  At Tue, 12 Aug 2014 04:39:55 -0700, Sam Tobin-Hochstadt wrote:
  How difficult would it be to allow the bootstrap process to use a
  preexisting Racket installation? This would alleviate some of the
  performance loss, for example in rebuilds by developers or in continuous
  integration.
 
  Sam
  On Aug 11, 2014 11:16 PM, Matthew Flatt mfl...@cs.utah.edu wrote:
 
   I've changed the Racket CGC implementation --- which is mostly used
   only to build the normal Racket variant --- to use SGC by default,
   instead of the Boehm GC. The intent of the switch is to make the more
   portable GC the default.
  
   If you have an existing build in a repo checkout, then `make` is  
  likely
   to fail, because the makefile dependencies are not precise enough to
   deal with the switch. You can discard your old build directory, or it
   might work to simply delete
  
 builddir/racket/libmzgc.a
  
   If you're using CGC and want to continue using the Boehm GC, then
   provide `--disable-sgc` to `configure`. I've tuned SGC to bring its
   performance closer to the Boehm GC, but it's still slower.
  
   _
 Racket Developers list:
 http://lists.racket-lang.org/dev
  
  _
Racket Developers list:
http://lists.racket-lang.org/dev
 
 
 -- 
 Tobias Hammer
 DLR / Robotics and Mechatronics Center (RMC)
 Muenchner Str. 20, D-82234 Wessling
 Tel.: 08153/28-1487
 Mail: tobias.ham...@dlr.de
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] SGC as default

2014-08-12 Thread Matthew Flatt
Apparently, when gcc 4.9.1 sees

 memcpy(x, y, n);
 if (y)
   

then it believes `y` can be assumed to be NULL --- even if `n` turns
out to be zero --- and so the conditional can be optimized away.

I'm surprised by that rule, but it's easy enough to move the test
before the memcpy().

At Tue, 12 Aug 2014 02:00:04 -0400, Asumu Takikawa wrote:
 On 2014-08-12 06:06:51 +0100, Matthew Flatt wrote:
  What platform are you using?
  
  I imagine that running `./racketcgc` within the racket subdirectory
  of your build directory will similarly crash. Can you get any
  information from running `gdb racketcgc`?
 
 This is on Linux. Running the built executable immediately produces a 
 segfault.
 
 Here's a backtrace from gdb:
   (gdb) bt
   #0  0x005e78db in free_managed (s=s@entry=0x0) at 
 ../../../racket/sgc/sgc.c:1535
   #1  0x005e7f63 in GC_add_roots (start=start@entry=0x881b70 
 collects_path, end=end@entry=0x881b79 run_cmd+1) at 
 ../../../racket/sgc/sgc.c:1657
   #2  0x00576f9a in scheme_register_static (ptr=ptr@entry=0x881b70 
 collects_path, size=size@entry=8) at ../../../racket/src/salloc.c:720
   #3  0x0045b87f in scheme_set_collects_path 
 (p=p@entry=0x77f701a0) 
 at ../../../racket/src/file.c:6841
   #4  0x00436673 in run_from_cmd_line (mk_basic_env=optimized out, 
 cont_run=0x435a10 cont_run, _argv=optimized out, argc=0) at 
 ../../racket/cmdline.inc:1444
   #5  main_after_stack (data=data@entry=0x7fffdc30) at 
 ../../racket/main.c:450
   #6  0x0057694d in do_main_stack_setup (data=0x7fffdc30, 
 _main=0x435a80 main_after_stack, no_auto_statics=1) at 
 ../../../racket/src/salloc.c:198
   #7  scheme_main_stack_setup (no_auto_statics=no_auto_statics@entry=1, 
 _main=_main@entry=0x435a80 main_after_stack, data=data@entry=0x7fffdc30)
   at ../../../racket/src/salloc.c:310
   #8  0x004346ee in main_after_dlls (argv=optimized out, 
 argc=optimized out) at ../../racket/main.c:381
   #9  main (argc=optimized out, argv=optimized out) at 
 ../../racket/main.c:341
 
 Cheers,
 Asumu
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] SGC as default

2014-08-12 Thread Matthew Flatt
The gcc 4.9 release notes warn about this optimization:

 https://gcc.gnu.org/gcc-4.9/porting_to.html

I'm surprised that this change hasn't caused more trouble for us.

At Tue, 12 Aug 2014 08:39:01 +0100, Matthew Flatt wrote:
 Apparently, when gcc 4.9.1 sees
 
  memcpy(x, y, n);
  if (y)

 
 then it believes `y` can be assumed to be NULL --- even if `n` turns
 out to be zero --- and so the conditional can be optimized away.
 
 I'm surprised by that rule, but it's easy enough to move the test
 before the memcpy().
 
 At Tue, 12 Aug 2014 02:00:04 -0400, Asumu Takikawa wrote:
  On 2014-08-12 06:06:51 +0100, Matthew Flatt wrote:
   What platform are you using?
   
   I imagine that running `./racketcgc` within the racket subdirectory
   of your build directory will similarly crash. Can you get any
   information from running `gdb racketcgc`?
  
  This is on Linux. Running the built executable immediately produces a 
 segfault.
  
  Here's a backtrace from gdb:
(gdb) bt
#0  0x005e78db in free_managed (s=s@entry=0x0) at 
  ../../../racket/sgc/sgc.c:1535
#1  0x005e7f63 in GC_add_roots (start=start@entry=0x881b70 
  collects_path, end=end@entry=0x881b79 run_cmd+1) at 
  ../../../racket/sgc/sgc.c:1657
#2  0x00576f9a in scheme_register_static (ptr=ptr@entry=0x881b70 
  collects_path, size=size@entry=8) at ../../../racket/src/salloc.c:720
#3  0x0045b87f in scheme_set_collects_path 
 (p=p@entry=0x77f701a0) 
  at ../../../racket/src/file.c:6841
#4  0x00436673 in run_from_cmd_line (mk_basic_env=optimized 
  out, 
  cont_run=0x435a10 cont_run, _argv=optimized out, argc=0) at 
  ../../racket/cmdline.inc:1444
#5  main_after_stack (data=data@entry=0x7fffdc30) at 
  ../../racket/main.c:450
#6  0x0057694d in do_main_stack_setup (data=0x7fffdc30, 
  _main=0x435a80 main_after_stack, no_auto_statics=1) at 
  ../../../racket/src/salloc.c:198
#7  scheme_main_stack_setup (no_auto_statics=no_auto_statics@entry=1, 
  _main=_main@entry=0x435a80 main_after_stack, 
  data=data@entry=0x7fffdc30)
at ../../../racket/src/salloc.c:310
#8  0x004346ee in main_after_dlls (argv=optimized out, 
  argc=optimized out) at ../../racket/main.c:381
#9  main (argc=optimized out, argv=optimized out) at 
  ../../racket/main.c:341
  
  Cheers,
  Asumu
 _
   Racket Developers list:
   http://lists.racket-lang.org/dev
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] SGC as default

2014-08-12 Thread Sam Tobin-Hochstadt
How difficult would it be to allow the bootstrap process to use a
preexisting Racket installation? This would alleviate some of the
performance loss, for example in rebuilds by developers or in continuous
integration.

Sam
On Aug 11, 2014 11:16 PM, Matthew Flatt mfl...@cs.utah.edu wrote:

 I've changed the Racket CGC implementation --- which is mostly used
 only to build the normal Racket variant --- to use SGC by default,
 instead of the Boehm GC. The intent of the switch is to make the more
 portable GC the default.

 If you have an existing build in a repo checkout, then `make` is likely
 to fail, because the makefile dependencies are not precise enough to
 deal with the switch. You can discard your old build directory, or it
 might work to simply delete

   builddir/racket/libmzgc.a

 If you're using CGC and want to continue using the Boehm GC, then
 provide `--disable-sgc` to `configure`. I've tuned SGC to bring its
 performance closer to the Boehm GC, but it's still slower.

 _
   Racket Developers list:
   http://lists.racket-lang.org/dev

_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] SGC as default

2014-08-12 Thread Matthew Flatt
I'm not sure how difficult it will be. It's tedious enough that the
last time I thought about it, I just left a note next to
no-cgc-needed in racket/src/racket/Makefile.in, but maybe it's
worth pursuing now.

At Tue, 12 Aug 2014 04:39:55 -0700, Sam Tobin-Hochstadt wrote:
 How difficult would it be to allow the bootstrap process to use a
 preexisting Racket installation? This would alleviate some of the
 performance loss, for example in rebuilds by developers or in continuous
 integration.
 
 Sam
 On Aug 11, 2014 11:16 PM, Matthew Flatt mfl...@cs.utah.edu wrote:
 
  I've changed the Racket CGC implementation --- which is mostly used
  only to build the normal Racket variant --- to use SGC by default,
  instead of the Boehm GC. The intent of the switch is to make the more
  portable GC the default.
 
  If you have an existing build in a repo checkout, then `make` is likely
  to fail, because the makefile dependencies are not precise enough to
  deal with the switch. You can discard your old build directory, or it
  might work to simply delete
 
builddir/racket/libmzgc.a
 
  If you're using CGC and want to continue using the Boehm GC, then
  provide `--disable-sgc` to `configure`. I've tuned SGC to bring its
  performance closer to the Boehm GC, but it's still slower.
 
  _
Racket Developers list:
http://lists.racket-lang.org/dev
 
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] SGC as default

2014-08-11 Thread Asumu Takikawa
On 2014-08-12 05:16:21 +0100, Matthew Flatt wrote:
 If you have an existing build in a repo checkout, then `make` is likely
 to fail, because the makefile dependencies are not precise enough to
 deal with the switch. You can discard your old build directory, or it
 might work to simply delete

   builddir/racket/libmzgc.a

The build didn't work for me in an existing checkout, so I tried making a fresh
one and still got this failure:

  make xsrc/precomp.h
  make[7]: Entering directory 
'/home/asumu/plt/racket-fresh/racket/src/build/racket/gc2'
  env XFORM_PRECOMP=yes ../racketcgc -G 
/home/asumu/plt/racket-fresh/build/config -cqu ../../../racket/gc2/xform.rkt 
--setup . --cpp gcc -E -I./.. -I../../../racket/gc2/../include -pthread   
-DUSE_SENORA_GC --keep-lines -o xsrc/precomp.h 
../../../racket/gc2/precomp.c
  Segmentation fault
  Makefile:202: recipe for target 'xsrc/precomp.h' failed
  make[7]: *** [xsrc/precomp.h] Error 139

Anything I should try to debug this?

Cheers,
Asumu
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] SGC as default

2014-08-11 Thread Matthew Flatt
At Tue, 12 Aug 2014 00:43:04 -0400, Asumu Takikawa wrote:
 On 2014-08-12 05:16:21 +0100, Matthew Flatt wrote:
  If you have an existing build in a repo checkout, then `make` is likely
  to fail, because the makefile dependencies are not precise enough to
  deal with the switch. You can discard your old build directory, or it
  might work to simply delete
 
builddir/racket/libmzgc.a
 
 The build didn't work for me in an existing checkout, so I tried making a 
 fresh
 one and still got this failure:
 
   make xsrc/precomp.h
   make[7]: Entering directory 
 '/home/asumu/plt/racket-fresh/racket/src/build/racket/gc2'
   env XFORM_PRECOMP=yes ../racketcgc -G 
 /home/asumu/plt/racket-fresh/build/config -cqu ../../../racket/gc2/xform.rkt 
 --setup . --cpp gcc -E -I./.. -I../../../racket/gc2/../include -pthread   
 -DUSE_SENORA_GC --keep-lines -o xsrc/precomp.h 
 ../../../racket/gc2/precomp.c
   Segmentation fault
   Makefile:202: recipe for target 'xsrc/precomp.h' failed
   make[7]: *** [xsrc/precomp.h] Error 139
 
 Anything I should try to debug this?

What platform are you using?

I imagine that running `./racketcgc` within the racket subdirectory
of your build directory will similarly crash. Can you get any
information from running `gdb racketcgc`?

_
  Racket Developers list:
  http://lists.racket-lang.org/dev