Fwd: Re[24]: [Gc] Boehm GC and Iphone

Ivan Maidanski ivmai at mail.ru
Sun Feb 13 11:07:57 PST 2011


Hi,

Resent due to ML post limit.

Sun, 13 Feb 2011 22:03:36 +0300 Ivan Maidanski <ivmai at mail.ru>:
> Hi Damian,
> 
> I've fixed the issue. Now both -strip_dead option and strip(1) don't break the
> executable.
> 
> As for options for max speed, I'm personally using:
> gcc -O2 -fno-common -Wall -DNO_EXECUTE_PERMISSION -DALL_INTERIOR_POINTERS
> -DGC_GCJ_SUPPORT -DNO_DEBUGGING -DGC_THREADS -DTHREAD_LOCAL_ALLOC
> -DPARALLEL_MARK -I include -I libatomic_ops/src -c extra/gc.c
> 
> In fact, the performance heavily depends on how you use the collector. Some
> advices:
> 1. use atomic malloc whenever possible;
> 2. register only the threads that manipulate GC-sensitive pointers;
> 3. turn off all-interior-pointers if possible;
> 4. if you can manually describe your app static roots then GC_set_no_dls(1),
> GC_clear_roots() and add your roots;
> 5. play with GC_free_space_divisor.
> 
> PS. ChangeLog entires (for the patch attached):
> * mark.c (GC_mark_some): Prefix and suffix "asm" and "volatile"
> keywords with double underscore.
> * os_dep.c (GC_unix_get_mem): Reformat the code.
> * os_dep.c (catch_exception_raise, catch_exception_raise_state,
> catch_exception_raise_state_identity): Add GC_API_OSCALL to
> function definition.
> * os_dep.c (catch_exception_raise_state,
> catch_exception_raise_state_identity): Move definition to be
> before GC_ports.
> * os_dep.c (catch_exception_raise): Declare to have the symbol
> defined before GC_ports.
> * os_dep.c (GC_ports): Store references to catch_exception_raise,
> catch_exception_raise_state, catch_exception_raise_state_identity
> (to prevent stripping these symbols as dead).
> * os_dep.c (catch_exception_raise, catch_exception_raise_state,
> catch_exception_raise_state_identity): Mark these symbols as
> "referenced dynamically" via an assembler directive (unless
> NO_DESC_CATCH_EXCEPTION_RAISE).
> * include/private/gc_priv.h (GC_API_OSCALL): New macro (defined
> similar to GC_API but as if GC_DLL is always defined).
> 
> Regards.
> 
> Fri, 11 Feb 2011 12:14:03 -0300 Damian <damian.pop at gmail.com>:
> 
> > Ivan, I will compare the executables in a few weeks, because I'm about 80%
> > of progress with the game I'm developing, and I want to finish it as soon as
> > possible, so will focus on it for now.
> > One more question: what would be all the defines to make libgc have faster
> > collection cycles?. Maybe for my game it's even better to have more
> > collection pauses that lasts less time each.
> > 
> > Thanks for all your help!
> > Damian
> > 
> > On Fri, Feb 11, 2011 at 8:45 AM, Damian <damian.pop at gmail.com> wrote:
> > 
> > > If I export GC_DISABLE_INCREMENTAL=1 before running the test it won't
> > > crash.
> > > I will try to compare the executables and tell you if I find something.
> > >
> > > Damian
> > >
> > > 2011/2/11 Ivan Maidanski <ivmai at mail.ru>
> > >
> > > Hi Damian,
> > >>
> > >> I've discovered this problem a month ago (but postponed figuring out what
> > >> happens due to lack of time). I like to use -s gcc option but apple gcc
> > does
> > >> not have it, so I called strip utility and got a broken executable (on
> > >> iphone).
> > >>
> > >> It would be nice if you continue to investigate the problem - try to
> > >> compare the executables' headers first.
> > >> If you'd run gctest with env GC_DISABLE_INCREMENTAL=1, would it crash or
> > >> not?
> > >>
> > >> Regards.
> > >>
> > >> Fri, 11 Feb 2011 00:03:31 -0300 Damian <damian.pop at gmail.com>:
> > >>
> > >> > Hi Ivan. Yes, I compiled the test file (main.m in fact) in xcode with
> > >> the
> > >> > working libgc.a (builded in the device itself). And it crashed.
> > >> > Then I took the main.o file xcode generated, and linked it in the
> > >> device,
> > >> > and to my surprise, it worked.
> > >> > So the problem was on the linking, and I've just discovered something:
> > >> >
> > >> > I've found out that xcode projects can be compiled on the command line
> > >> with
> > >> > a command like this:
> > >> > xcodebuild -project gc-test.xcodeproj -alltargets
> > >> > So I compiled it and seen all the commands the build process executes,
> > >> and
> > >> > saw the linker call with a -dead_strip param.
> > >> > I've linked in the iphone again with that parameter, and it crashed.
> > >> > You can test it yourself, when linking add -dead_strip.
> > >> >
> > >> > So I disabled the dead strip in xcode for my project and it works. The
> > >> > problem is that the executable size goes from 979 kb to 1311kb.
> > >> >
> > >> > Why the sriping of dead code breaks everything?
> > >> >
> > >> >
> > >> >
> > >> > 2011/2/10 Ivan Maidanski <ivmai at mail.ru>
> > >> >
> > >> > > Hi Damian,
> > >> > >
> > >> > > Am I right that you tried to compile tests/test.c and link it against
> > >> > > working libgc.a with xcode?
> > >> > >
> > >> > > The first question is whether xcode compiles .*c to producing exactly
> > >> the
> > >> > > same *.o as produced by a manually invoked gcc.
> > >> > > (for this, I think it's worth only do preprocessing in both cases
> i.e.
> > >> pass
> > >> > > -E option (I don't know how to do it with xcode)).
> > >> > >
> > >> > > If the preprocessed code is identical (or the object files are the
> > >> same
> > >> > > (although they may differ due to presence of timestamps, if any),
> > >> > > then compare the headers of the executables.
> > >> > >
> > >> > > Regards.
> > >> > >
> > >> > > Thu, 10 Feb 2011 03:24:21 -0300 Damian <damian.pop at gmail.com>:
> > >> > >
> > >> > > > Just to add more info:
> > >> > > > From what I saw, xcode executes the following call to gcc:
> > >> > > >
> > >> > > > setenv LANG en_US.US-ASCII
> > >> > > > setenv PATH
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
> > >> > > >
> > >> > > > /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -x
> > >> > > > objective-c -arch armv7 -fmessage-length=0 -pipe -std=c99
> > >> -Wno-trigraphs
> > >> > > > -fpascal-strings -Os -mdynamic-no-pic -Wreturn-type
> > >> -Wunused-variable
> > >> > > > -isysroot
> > >> > > >
> > >> /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.1.sdk
> > >> > > > -fvisibility=hidden -gdwarf-2 -miphoneos-version-min=4.1 -iquote
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> /Users/damian/Desktop/gc-test/build/gc-test.build/Release-iphoneos/gc-test.build/gc-test-generated-files.hmap
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> -I/Users/damian/Desktop/gc-test/build/gc-test.build/Release-iphoneos/gc-test.build/gc-test-own-target-headers.hmap
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> -I/Users/damian/Desktop/gc-test/build/gc-test.build/Release-iphoneos/gc-test.build/gc-test-all-target-headers.hmap
> > >> > > > -iquote
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> /Users/damian/Desktop/gc-test/build/gc-test.build/Release-iphoneos/gc-test.build/gc-test-project-headers.hmap
> > >> > > > -F/Users/damian/Desktop/gc-test/build/Release-iphoneos
> > >> > > > -I/Users/damian/Desktop/gc-test/build/Release-iphoneos/include
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> -I/Users/damian/Desktop/gc-test/build/gc-test.build/Release-iphoneos/gc-test.build/DerivedSources/armv7
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> -I/Users/damian/Desktop/gc-test/build/gc-test.build/Release-iphoneos/gc-test.build/DerivedSources
> > >> > > > -DNS_BLOCK_ASSERTIONS=1 -c
> > >> /Users/damian/Desktop/gc-test/Classes/main.m
> > >> > > -o
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> /Users/damian/Desktop/gc-test/build/gc-test.build/Release-iphoneos/gc-test.build/Objects-normal/armv7/main.o
> > >> > > >
> > >> > > > And the executable I get crashes. It prints "Abort trap" to the
> > >> console.
> > >> > > > I compiled the file in the command line, on the mac, using almost
> > >> the
> > >> > > same
> > >> > > > command, just modified so it also links:
> > >> > > >
> > >> > > > /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2
> > >> libgc.a
> > >> > > -x
> > >> > > > objective-c -arch armv7 -fmessage-length=0 -pipe -std=c99
> > >> -Wno-trigraphs
> > >> > > > -fpascal-strings -Os -mdynamic-no-pic -Wreturn-type
> > >> -Wunused-variable
> > >> > > > -isysroot
> > >> > > >
> > >> /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.1.sdk
> > >> > > > -fvisibility=hidden -gdwarf-2 -miphoneos-version-min=4.1 -iquote
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> /Users/damian/Desktop/gc-test/build/gc-test.build/Release-iphoneos/gc-test.build/gc-test-generated-files.hmap
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> -I/Users/damian/Desktop/gc-test/build/gc-test.build/Release-iphoneos/gc-test.build/gc-test-own-target-headers.hmap
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> -I/Users/damian/Desktop/gc-test/build/gc-test.build/Release-iphoneos/gc-test.build/gc-test-all-target-headers.hmap
> > >> > > > -iquote
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> /Users/damian/Desktop/gc-test/build/gc-test.build/Release-iphoneos/gc-test.build/gc-test-project-headers.hmap
> > >> > > > -F/Users/damian/Desktop/gc-test/build/Release-iphoneos
> > >> > > > -I/Users/damian/Desktop/gc-test/build/Release-iphoneos/include
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> -I/Users/damian/Desktop/gc-test/build/gc-test.build/Release-iphoneos/gc-test.build/DerivedSources/armv7
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> -I/Users/damian/Desktop/gc-test/build/gc-test.build/Release-iphoneos/gc-test.build/DerivedSources
> > >> > > > -DNS_BLOCK_ASSERTIONS=1
> /Users/damian/Desktop/gc-test/Classes/main.m
> > >> -o
> > >> > > main
> > >> > > >
> > >> > > > And the executable I get works, no crashes.
> > >> > > > I don't get it. I have no idea what to do now :(
> > >> > > >
> > >> > > > On Thu, Feb 10, 2011 at 12:35 AM, Damian <damian.pop at gmail.com>
> > >> wrote:
> > >> > > >
> > >> > > > > Hi Ivan,
> > >> > > > >
> > >> > > > > I've tried with your attached gc.o and it crashed exactly the
> > >> same, so
> > >> > > I've
> > >> > > > > decided to make a few tests:
> > >> > > > > I've setted up my ipod to be able to compile directly in it and
> > >> > > compiled my
> > >> > > > > simple test and it works, no crashes at all. The same source file
> > >> > > (main.m,
> > >> > > > > I'm attaching it), if I compile it in xcode it crashes, if I
> > >> compile it
> > >> > > in
> > >> > > > > the ipod it works. Using the same preocompiled library libgc.a
> > >> that I
> > >> > > made
> > >> > > > > myself compiling it in the device with the command line you
> wrote.
> > >> > > > >
> > >> > > > > So it's not a problem of the library but something related to the
> > >> final
> > >> > > > > executable, or how it's linked, or I don't know...
> > >> > > > >
> > >> > > > > Do you have any idea of what can be the problem?
> > >> > > > > I'll try to find out what parameters xcode is passing to gcc and
> > >> the
> > >> > > > > linker.
> > >> > > > >
> > >> > > > > Thanks again.
> > >> > > > >
> > >> > > > > 2011/2/9 Ivan Maidanski <ivmai at mail.ru>
> > >> > > > >
> > >> > > > > Hi,
> > >> > > > >>
> > >> > > > >> The attachment contains libgc (gc.o), gctest and your runTest.
> > >> > > > >> My development (i.e. I compiled the app directly on the device
> > >> itself)
> > >> > > and
> > >> > > > >> target system is: iPhone 3GS
> > >> > > > >>
> > >> > > > >> I used the following command to compile libgc:
> > >> > > > >> gcc -O2 -fno-strict-aliasing -Wall -DNO_EXECUTE_PERMISSION
> > >> > > > >> -DALL_INTERIOR_POINTERS -DJAVA_FINALIZATION -DGC_GCJ_SUPPORT
> > >> > > -DNO_DEBUGGING
> > >> > > > >> -DGC_THREADS -DTHREAD_LOCAL_ALLOC -DPARALLEL_MARK -I include -I
> > >> > > > >> libatomic_ops/src -c extra/gc.c
> > >> > > > >>
> > >> > > > >> Regards.
> > >> > > > >>
> > >> > > > >> Tue, 8 Feb 2011 22:06:52 -0300  Damian <damian.pop at gmail.com>:
> > >> > > > >>
> > >> > > > >> > :(
> > >> > > > >> >
> > >> > > > >> > I did what you said, moved GC_INIT(), GC_enable_incremental()
> > >> and
> > >> > > > >> runTest()
> > >> > > > >> > directly to main()
> > >> > > > >> > I also added the 3 defines you are using
> > >> (-DNO_EXECUTE_PERMISSION
> > >> > > > >> > -DALL_INTERIOR_POINTERS -DGC_THREADS)
> > >> > > > >> > I've also tried building for ARMv6 and ARMv7 and both ways it
> > >> > > crashes
> > >> > > > >> the
> > >> > > > >> > same.
> > >> > > > >> >
> > >> > > > >> > I'm not calling gcc directly, I'm calling configure and make.
> I
> > >> send
> > >> > > you
> > >> > > > >> > attached the script I've used to call configure with all the
> > >> > > parameters.
> > >> > > > >> > Because I had to export some variables before calling it so it
> > >> would
> > >> > > > >> build
> > >> > > > >> > for ARM and include iOS headers.
> > >> > > > >> >
> > >> > > > >> > Here is one of the lines is writen to the console, I think
> > >> these are
> > >> > > the
> > >> > > > >> > parameters passed to gcc.
> > >> > > > >> >
> > >> > > > >> > libtool: compile:  gcc -DHAVE_CONFIG_H -I./include -I./include
> > >> > > > >> > -I./libatomic_ops/src -I./libatomic_ops/src -fexceptions -arch
> > >> armv7
> > >> > > > >> > -DNO_EXECUTE_PERMISSION -DALL_INTERIOR_POINTERS -DGC_THREADS
> > >> > > -isysroot
> > >> > > > >> >
> > >> > > /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.1.sdk
> > >> > > > >> -MT
> > >> > > > >> > dyn_load.lo -MD -MP -MF .deps/dyn_load.Tpo -c dyn_load.c -o
> > >> > > dyn_load.o
> > >> > > > >> >
> > >> > > > >> > Ivan, maybe you can send me the compiled gc that is working
> for
> > >> you,
> > >> > > so
> > >> > > > >> I
> > >> > > > >> > can test it on my device to discard that the problem is
> > >> something
> > >> > > > >> related to
> > >> > > > >> > the device version / iOS version or something like that.
> > >> > > > >> >
> > >> > > > >> > Thanks!
> > >> > > > >> > Damian
> > >> > > > >> >
> > >> > > > >> > 2011/2/8 Ivan Maidanski <ivmai at mail.ru>
> > >> > > > >> >
> > >> > > > >> > > Hi Damian,
> > >> > > > >> > >
> > >> > > > >> > > I can't reproduce the bug.
> > >> > > > >> > >
> > >> > > > >> > > Please:
> > >> > > > >> > > 1. show me the exact command-line parameters passed to gcc.
> > >> > > > >> > > 2. Call GC_INIT() and GC_enable_incremental() directly from
> > >> > > main().
> > >> > > > >> > >
> > >> > > > >> > > I called runTest() directly from main(). I compiled GC using
> > >> this
> > >> > > > >> command
> > >> > > > >> > > line:
> > >> > > > >> > > gcc -fno-common -Wall -DNO_EXECUTE_PERMISSION
> > >> > > -DALL_INTERIOR_POINTERS
> > >> > > > >> > > -DGC_THREADS -I include -I libatomic_ops/src -c extra/gc.c
> > >> > > > >> > >
> > >> > > > >> > >
> > >> > > > >> > > PS. At present, I'm modifying iphone-specific part of GC -
> > >> I'll
> > >> > > > >> release it
> > >> > > > >> > > in several days.
> > >> > > > >> > >
> > >> > > > >> > > Regards.
> > >> > > > >> > >
> > >> > > > >> > > Sat, 29 Jan 2011 22:23:03 -0300 Damian <damian.pop at gmail.com
> > >> >:
> > >> > > > >> > >
> > >> > > > >> > > > Hi Ivan, could you find anything about it?
> > >> > > > >> > >
> > >> > > > >> > > > On Fri, Jan 21, 2011 at 12:24 AM, Damian <
> > >> damian.pop at gmail.com>
> > >> > > > >> wrote:
> > >> > > > >> > > > I'm sending you a very small test case attached. It has an
> > >> xcode
> > >> > > > >> project
> > >> > > > >> > > too, with some automatically generated files, but the code
> is
> > >> just
> > >> > > > >> this:
> > >> > > > >> > >
> > >> > > > >> > > > void** trash;
> > >> > > > >> > >
> > >> > > > >> > > > void runTest() {
> > >> > > > >> > > >  GC_INIT();
> > >> > > > >> > > >  GC_enable_incremental(); // REMOVING THIS LINE IT WONT
> > >> CRASH
> > >> > > > >> > > >
> > >> > > > >> > > >  trash = GC_MALLOC(sizeof(void*));
> > >> > > > >> > > >
> > >> > > > >> > > >  while(1){
> > >> > > > >> > > >  *trash = GC_MALLOC(16);
> > >> > > > >> > > >  }
> > >> > > > >> > > > }
> > >> > > > >> > >
> > >> > > > >> > > > To build the GC I'm using the options:
> > >> --host=arm-apple-darwin10
> > >> > > > >> > > --enable-cplusplus=no --enable-shared=no
> > >> --enable-full-debug=no
> > >> > > > >> > > > If it helps, I added the script I'm using to build it,
> it's
> > >> > > named
> > >> > > > >> > > build-iphone.sh
> > >> > > > >> > > > Hope it helps!
> > >> > > > >> > >
> > >> > > > >> > > > Damian
> > >> > > > >> > > > 2011/1/20 Ivan Maidanski <ivmai at mail.ru>
> > >> > > > >> > > >
> > >> > > > >> > >
> > >> > > > >> > > > Hello,
> > >> > > > >> > > >
> > >> > > > >> > > > Send the C/C++ code as an attachment. And specify the
> > >> building
> > >> > > > >> options
> > >> > > > >> > > (or link the makefile as an attachment).
> > >> > > > >> > > >
> > >> > > > >> > > > Regards.
> > >> > > > >> > > >
> > >> > > > >> > > > Thu, 20 Jan 2011 18:23:45 -0300 Damian Troncoso <
> > >> > > > >> damian.pop at gmail.com>:
> > >> > > > >> > > >
> > >> > > > >> > >
> > >> > > > >> > > > > Sure I'll do. I can make an xcode project. Where should
> I
> > >> > > upload
> > >> > > > >> it?
> > >> > > > >> > > > >
> > >> > > > >> > > > > El 20/01/2011, a las 17:54, Ivan Maidanski <
> > >> ivmai at mail.ru>
> > >> > > > >> escribi?:
> > >> > > > >> > > >
> > >> > > > >> > > > >
> > >> > > > >> > > > > > Hi,
> > >> > > > >> > > > > >
> > >> > > > >> > > > > > Would be nice if you provide a test case (as small as
> > >> > > possible).
> > >> > > > >> > > > > >
> > >> > > > >> > > > > > Meanwhile, I'll run my app eating/recycling lots of
> > >> memory
> > >> > > on
> > >> > > > >> iphone
> > >> > > > >> > > with
> > >> > > > >> > > > > enable incremental.
> > >> > > > >> > > > > >
> > >> > > > >> > > > > > Regards.
> > >> > > > >> > > > > >
> > >> > > > >> > > > > > Wed, 19 Jan 2011 20:34:43 -0300 Damian <
> > >> > > damian.pop at gmail.com>:
> > >> > > > >> > > > > >
> > >> > > > >> > > > > >> I tried 3, 5 and 6 and nothing changed.
> > >> > > > >> > > > > >> Yes, I'm getting the abort on the first call to
> > >> exc_server,
> > >> > > and
> > >> > > > >> > > > > >> catch_exception_raise
> > >> > > > >> > > > > >> is never called.
> > >> > > > >> > > > > >>
> > >> > > > >> > > > > >> 2011/1/19 Ivan Maidanski <ivmai at mail.ru>
> > >> > > > >> > > > > >>
> > >> > > > >> > > > > >>> Hi,
> > >> > > > >> > > > > >>>
> > >> > > > >> > > > > >>> 1. Are you getting abort on the first exc_server
> > >> call?
> > >> > > > >> > > > > >>> 2. Is catch_exception_raise called?
> > >> > > > >> > > > > >>> 3. Try BROKEN_EXCEPTION_HANDLING
> > >> > > > >> > > > > >>> 4. msgh_reserved is not set to any value, that's why
> > >> it is
> > >> > > > >> random.
> > >> > > > >> > > > > >>> 5. For ID_STOP, ID_RESUME, it might be not safe to
> > >> use 1,
> > >> > > 2 -
> > >> > > > >> try
> > >> > > > >> > > other
> > >> > > > >> > > > > >>> values.
> > >> > > > >> > > > > >>> 6. Try to increase reply/msg.data size in
> > >> > > GC_mprotect_thread.
> > >> > > > >> > > > > >>>
> > >> > > > >> > > > > >>> Regards.
> > >> > > > >> > > > > >>>
> > >> > > > >> > > > > >>> Wed, 19 Jan 2011 00:23:26 -0300 Damian <
> > >> > > damian.pop at gmail.com
> > >> > > > >> >:
> > >> > > > >> > > > > >>>
> > >> > > > >> > > > > >>>> Well I managed to debug the code.
> > >> > > > >> > > > > >>>> I really don't get why the exception is produced, I
> > >> don't
> > >> > > > >> even
> > >> > > > >> > > know if
> > >> > > > >> > > > > >>> the data passed to exc_server looks good or not.
> > >> > > > >> > > > > >>>> It's always like the following when the exception
> is
> > >> > > thrown,
> > >> > > > >> the
> > >> > > > >> > > only
> > >> > > > >> > > > > >>> value that changes is 'msgh_reserved':
> > >> > > > >> > > > > >>>
> > >> > > > >> > > > > >>>> (gdb) p msg.head</div>
> > >> > > > >> > > > > >>>> $1 = {
> > >> > > > >> > > > > >>>> msgh_bits = 2147488018,
> > >> > > > >> > > > > >>>> msgh_size = 76,
> > >> > > > >> > > > > >>>> msgh_remote_port = 6147,
> > >> > > > >> > > > > >>>> msgh_local_port = 4611,
> > >> > > > >> > > > > >>>> msgh_reserved = 3445996780,
> > >> > > > >> > > > > >>>> msgh_id = 2401
> > >> > > > >> > > > > >>>> }
> > >> > > > >> > > > > >>>
> > >> > > > >> > > > > >>>> The call to exc_server is like this:
> > >> > > > >> > > > > >>>
> > >> > > > >> > > > > >>>>
> > >> > > > >> > > > > >>>> if(!exc_server(&msg.head, &reply.head))
> > >> > > > >> > > > > >>>> ABORT("exc_server failed");
> > >> > > > >> > > > > >>>
> > >> > > > >> > > > > >>>> msg.head is filled with a call to mach_msg, like
> > >> this:
> > >> > > > >> > > > > >>>
> > >> > > > >> > > > > >>>>
> > >> > > > >> > > > > >>>> r = mach_msg(&msg.head, MACH_RCV_MSG |
> > >> MACH_RCV_LARGE |
> > >> > > > >> > > > > >>>> (GC_mprotect_state == GC_MP_DISCARDING ?
> > >> MACH_RCV_TIMEOUT
> > >> > > :
> > >> > > > >> 0),
> > >> > > > >> > > > > >>>> 0, sizeof(msg), GC_ports.exception,
> > >> > > > >> > > > > >>>> GC_mprotect_state == GC_MP_DISCARDING ? 0
> > >> > > > >> > > > > >>>> : MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
> > >> > > > >> > > > > >>>
> > >> > > > >> > > > > >>>> I'm lost :(
> > >> > > > >> > > > > >>>> 2011/1/18 Ivan Maidanski <ivmai at mail.ru>
> > >> > > > >> > > > > >>>> Hi,
> > >> > > > >> > > > > >>>>
> > >> > > > >> > > > > >>>> Tue, 18 Jan 2011 03:24:33 -0300 Damian <
> > >> > > damian.pop at gmail.com
> > >> > > > >> >:
> > >> > > > >> > > > > >>>>
> > >> > > > >> > > > > >>>
> > >> > > > >> > > > > >>>>> Hi Ivan, thanks for helping me with this.
> > >> > > > >> > > > > >>>>> 1. I defined none of those, should I define any?
> (I
> > >> > > tried
> > >> > > > >> both
> > >> > > > >> > > after I
> > >> > > > >> > > > > >>> read
> > >> > > > >> > > > > >>>>> this but I get the same exception)
> > >> > > > >> > > > > >>>>
> > >> > > > >> > > > > >>>> So, the problem is not there.
> > >> > > > >> > > > > >>>>
> > >> > > > >> > > > > >>>
> > >> > > > >> > > > > >>>>> 2. My app only runs on iphone, but I tried it in
> > >> the
> > >> > > iphone
> > >> > > > >> > > simulator
> > >> > > > >> > > > > >>> and it
> > >> > > > >> > > > > >>>>> does not crash. I built the gc just like for the
> > >> > > simulator
> > >> > > > >> but
> > >> > > > >> > > for x86
> > >> > > > >> > > > > >>>>
> > >> > > > >> > > > > >>>>> arch and it seems to work.
> > >> > > > >> > > > > >>>>
> > >> > > > >> > > > > >>>>> 3. How? How do I build the collector with symbols
> > >> on? I
> > >> > > > >> tried
> > >> > > > >> > > adding -g
> > >> > > > >> > > > > >>> to
> > >> > > > >> > > > > >>>>> compiler options and I get a library more than
> > >> twice
> > >> > > bigger
> > >> > > > >> so I
> > >> > > > >> > > thing
> > >> > > > >> > > > > >>> it
> > >> > > > >> > > > > >>>>> has the symbols, but when debugging the stack is
> > >> the
> > >> > > same.
> > >> > > > >> > > > > >>>>
> > >> > > > >> > > > > >>>> I don't know. At least, try to set a break point at
> > >> > > exc_sever
> > >> > > > >> and
> > >> > > > >> > > watch
> > >> > > > >> > > > > >>> what is passed to it.
> > >> > > > >> > > > > >>>>
> > >> > > > >> > > > > >>>> Regards.
> > >> > > > >> > > > > >>>>
> > >> > > > >> > > > > >>>
> > >> > > > >> > > > > >>>>>
> > >> > > > >> > > > > >>>>> Thanks again!
> > >> > > > >> > > > > >>>>> Damian
> > >> > > > >> > > > > >>>>>
> > >> > > > >> > > > > >>>>> 2011/1/17 Ivan Maidanski <ivmai at mail.ru>
> > >> > > > >> > > > > >>>>>
> > >> > > > >> > > > > >>>>>> Hi Damian,
> > >> > > > >> > > > > >>>>>>
> > >> > > > >> > > > > >>>>>> 1. Is the mode is GC_DISCOVER_TASK_THREADS or
> > >> > > > >> > > > > >>> GC_NO_THREADS_DISCOVERY?
> > >> > > > >> > > > > >>>>>> 2. Could you try your app on Mac OS X?
> > >> > > > >> > > > > >>>>>> 3. Could you debug with symbols on and tell us
> the
> > >> > > reason
> > >> > > > >> of
> > >> > > > >> > > abort
> > >> > > > >> > > > > >>> call?
> > >> > > > >> > > > > >>>>>> 4. GC_get_parallel() returns non-zero if 2 or
> more
> > >> > > markers
> > >> > > > >> are
> > >> > > > >> > > > > >>> running.
> > >> > > > >> > > > > >>>>>> 5. Incremental/generation mode is turned on only
> > >> if
> > >> > > either
> > >> > > > >> > > > > >>>>>> GC_enable_incremental() is called (unless
> > >> > > > >> GC_DISABLE_INCREMENTAL
> > >> > > > >> > > env
> > >> > > > >> > > > > >>> var is
> > >> > > > >> > > > > >>>>>> set) or GC_ENABLE_INCREMENTAL env var is set.
> > >> > > > >> > > > > >>>>>>
> > >> > > > >> > > > > >>>>>> Regards.
> > >> > > > >> > > > > >>>>>>
> > >> > > > >> > > > > >>>>>> Sun, 16 Jan 2011 01:18:05 -0300 Damian <
> > >> > > > >> damian.pop at gmail.com>:
> > >> > > > >> > > > > >>>>>>
> > >> > > > >> > > > > >>>>>>> Well, I was not calling gc_enable_incremental()
> > >> so I
> > >> > > think
> > >> > > > >> it
> > >> > > > >> > > was
> > >> > > > >> > > > > >>> not
> > >> > > > >> > > > > >>>>>>> enabled.
> > >> > > > >> > > > > >>>>>>> Now I added the call but the program execution
> is
> > >> > > aborted
> > >> > > > >> with
> > >> > > > >> > > this
> > >> > > > >> > > > > >>> stack
> > >> > > > >> > > > > >>>>>>> trace:
> > >> > > > >> > > > > >>>>>>>
> > >> > > > >> > > > > >>>>>>> #0 0x31cbcffc in __abort ()
> > >> > > > >> > > > > >>>>>>>
> > >> > > > >> > > > > >>>>>>> #1 0x31cbd04c in abort ()
> > >> > > > >> > > > > >>>>>>>
> > >> > > > >> > > > > >>>>>>> #2 0x31c91fcc in internal_catch_exception_raise
> > >> ()
> > >> > > > >> > > > > >>>>>>>
> > >> > > > >> > > > > >>>>>>> #3 0x31c81ea4 in _Xexception_raise ()
> > >> > > > >> > > > > >>>>>>>
> > >> > > > >> > > > > >>>>>>> #4 0x31c81ab0 in exc_server ()
> > >> > > > >> > > > > >>>>>>>
> > >> > > > >> > > > > >>>>>>> #5 0x00060f20 in GC_mprotect_thread ()
> > >> > > > >> > > > > >>>>>>>
> > >> > > > >> > > > > >>>>>>> #6 0x31caa284 in _pthread_start ()
> > >> > > > >> > > > > >>>>>>>
> > >> > > > >> > > > > >>>>>>> #7 0x31c9f2b0 in thread_start ()
> > >> > > > >> > > > > >>>>>>>
> > >> > > > >> > > > > >>>>>>>
> > >> > > > >> > > > > >>>>>>> Any help?
> > >> > > > >> > > > > >>>>>>> Thanks!
> > >> > > > >> > > > > >>>>>>>
> > >> > > > >> > > > > >>>>>>>
> > >> > > > >> > > > > >>>>>>> On Sat, Jan 15, 2011 at 8:14 PM, Damian <
> > >> > > > >> damian.pop at gmail.com>
> > >> > > > >> > > > > >>> wrote:
> > >> > > > >> > > > > >>>>>>>
> > >> > > > >> > > > > >>>>>>>> Hi, I've just built gc7.2 BDWGC for iphone
> > >> device,
> > >> > > and
> > >> > > > >> it's
> > >> > > > >> > > > > >>> working.
> > >> > > > >> > > > > >>>>>>>> How can I make sure that generation mode is on
> > >> and
> > >> > > > >> working?
> > >> > > > >> > > > > >>>>>>>> And, parallel mark doesn't work on single core
> > >> cpus?
> > >> > > > >> > > > > >>>>>>>>
> > >> > > > >> > > > > >>>>>>>> Damian.
> > >> > > > >> > > > > >>>>>>>>
> > >> > > > >> > > > > >>>>>>>> 2011/1/13 Ivan Maidanski <ivmai at mail.ru>
> > >> > > > >> > > > > >>>>>>>>
> > >> > > > >> > > > > >>>>>>>>> Hi,
> > >> > > > >> > > > > >>>>>>>>>
> > >> > > > >> > > > > >>>>>>>>> If the platform is not multi-core then
> > >> parallel-mark
> > >> > > > >> mode
> > >> > > > >> > > should
> > >> > > > >> > > > > >>> be
> > >> > > > >> > > > > >>>>>> off
> > >> > > > >> > > > > >>>>>>>>> (either at compile time or at runtime).
> > >> > > > >> > > > > >>>>>>>>> But turning on generation mode could reduce
> the
> > >> GC
> > >> > > pause
> > >> > > > >> on a
> > >> > > > >> > > > > >>>>>> single-core.
> > >> > > > >> > > > > >>>>>>>>>
> > >> > > > >> > > > > >>>>>>>>> Regards.
> > >> > > > >> > > > > >>>>>>>>>
> > >> > > > >> > > > > >>>>>>>>> Thu, 13 Jan 2011 08:28:55 -0300 Damian <
> > >> > > > >> damian.pop at gmail.com
> > >> > > > >> > > >:
> > >> > > > >> > > > > >>>>>>>>>> None is multicore. Will I get an inprovement
> > >> > > anyway?
> > >> > > > >> > > > > >>>>>>>>>> Ok, I will try to compile gc7.2 BDWGC
> snapshot
> > >> > > tonight.
> > >> > > > >> > > > > >>>>>>>>>> Thanks!
> > >> > > > >> > > > > >>>>>>>>>>
> > >> > > > >> > > > > >>>>>>>>>> 2011/1/13 Ivan Maidanski <ivmai at mail.ru>
> > >> > > > >> > > > > >>>>>>>>>>
> > >> > > > >> > > > > >>>>>>>>>>> Hi,
> > >> > > > >> > > > > >>>>>>>>>>>
> > >> > > > >> > > > > >>>>>>>>>>> 1. Are you going to run it on a multi-core?
> > >> (I
> > >> > > don't
> > >> > > > >> know
> > >> > > > >> > > > > >>> Apples
> > >> > > > >> > > > > >>>>>>>>> devices
> > >> > > > >> > > > > >>>>>>>>>>> internals deeply, so I wonder which of them
> > >> have
> > >> > > > >> multi-core
> > >> > > > >> > > > > >>> CPUs).
> > >> > > > >> > > > > >>>>>>>>>>>
> > >> > > > >> > > > > >>>>>>>>>>> 2. If you start using gc6.8 just because of
> > >> the
> > >> > > reason
> > >> > > > >> you
> > >> > > > >> > > > > >>>>>> mentioned,
> > >> > > > >> > > > > >>>>>>>>> I
> > >> > > > >> > > > > >>>>>>>>>>> recommend you to migrate to gc7.2 (get the
> > >> recent
> > >> > > > >> BDWGC
> > >> > > > >> > > > > >>> snapshot
> > >> > > > >> > > > > >>>>>> which
> > >> > > > >> > > > > >>>>>>>>> now
> > >> > > > >> > > > > >>>>>>>>>>> has generation plus parallel collection
> > >> enabled).
> > >> > > > >> > > > > >>>>>>>>>>>
> > >> > > > >> > > > > >>>>>>>>>>> 3. Incremental/generation collection as well
> > >> as
> > >> > > > >> parallel
> > >> > > > >> > > > > >>> marking
> > >> > > > >> > > > > >>>>>> are
> > >> > > > >> > > > > >>>>>>>>> the GC
> > >> > > > >> > > > > >>>>>>>>>>> improvements aiming collection pause
> > >> reduction.
> > >> > > > >> > > > > >>>>>>>>>>>
> > >> > > > >> > > > > >>>>>>>>>>> Regards.
> > >> > > > >> > > > > >>>>>>>>>>>
> > >> > > > >> > > > > >>>>>>>>>>> Wed, 12 Jan 2011 20:03:02 -0300 Damian <
> > >> > > > >> > > > > >>> damian.pop at gmail.com>:
> > >> > > > >> > > > > >>>>>>>>>>>
> > >> > > > >> > > > > >>>>>>>>>>>> Maybe concurrent + parallel collection does
> > >> not
> > >> > > what
> > >> > > > >> I'm
> > >> > > > >> > > > > >>>>>> expecting.
> > >> > > > >> > > > > >>>>>>>>>>>> What I need to achieve is to reduce the
> > >> > > collection
> > >> > > > >> pause.
> > >> > > > >> > > > > >>>>>>>>>>>> I'm using version 6.8 (because I've found
> > >> > > somewhere
> > >> > > > >> on the
> > >> > > > >> > > > > >>>>>> internet
> > >> > > > >> > > > > >>>>>>>>>>> someone
> > >> > > > >> > > > > >>>>>>>>>>>> has made it work on iphone with some
> > >> changes) and
> > >> > > I'm
> > >> > > > >> > > > > >>> having
> > >> > > > >> > > > > >>>>>>>>> collection
> > >> > > > >> > > > > >>>>>>>>>>>> cycles of about 120ms. I need to reduce
> that
> > >> > > number.
> > >> > > > >> I
> > >> > > > >> > > > > >>> don't
> > >> > > > >> > > > > >>>>>> care if
> > >> > > > >> > > > > >>>>>>>>>>> overall
> > >> > > > >> > > > > >>>>>>>>>>>> collection time increases as long as the
> app
> > >> is
> > >> > > not
> > >> > > > >> > > > > >>> freezed for
> > >> > > > >> > > > > >>>>>> such
> > >> > > > >> > > > > >>>>>>>>> a
> > >> > > > >> > > > > >>>>>>>>>>> long
> > >> > > > >> > > > > >>>>>>>>>>>> time.
> > >> > > > >> > > > > >>>>>>>>>>>> Is that possible?
> > >> > > > >> > > > > >>>>>>>>>>>>
> > >> > > > >> > > > > >>>>>>>>>>>> Thanks.
> > >> > > > >> > > > > >>>>>>>>>>>>
> > >> > > > >> > > > > >>>>>>>>>>>> 2011/1/12 Ivan Maidanski <ivmai at mail.ru>
> > >> > > > >> > > > > >>>>>>>>>>>>
> > >> > > > >> > > > > >>>>>>>>>>>>> Hi,
> > >> > > > >> > > > > >>>>>>>>>>>>>
> > >> > > > >> > > > > >>>>>>>>>>>>> BTW What Apple devices has a multi-core
> CPU
> > >> at
> > >> > > > >> present?
> > >> > > > >> > > > > >>>>>>>>>>>>>
> > >> > > > >> > > > > >>>>>>>>>>>>> I ran GC test on a single-core with
> > >> GC_MARKERS=4
> > >> > > -
> > >> > > > >> > > > > >>> collector
> > >> > > > >> > > > > >>>>>>>>> appears to
> > >> > > > >> > > > > >>>>>>>>>>>>> work...
> > >> > > > >> > > > > >>>>>>>>>>>>>
> > >> > > > >> > > > > >>>>>>>>>>>>> Wed, 12 Jan 2011 10:04:00 -0300 Damian <
> > >> > > > >> > > > > >>> damian.pop at gmail.com
> > >> > > > >> > > > > >>>>>>> :
> > >> > > > >> > > > > >>>>>>>>>>>>>
> > >> > > > >> > > > > >>>>>>>>>>>>>> Hi,
> > >> > > > >> > > > > >>>>>>>>>>>>>> Is it possible to compile boehm gc for
> > >> iphone
> > >> > > > >> enabling
> > >> > > > >> > > > > >>>>>>>>> generational
> > >> > > > >> > > > > >>>>>>>>>>> and
> > >> > > > >> > > > > >>>>>>>>>>>>> parallel collection?
> > >> > > > >> > > > > >>>>>>>>>>>>>
> > >> > > > >> > > > > >>>>>>>>>>>>> See the recent post by Hans.
> > >> > > > >> > > > > >>>>>>>>>>>>>
> > >> > > > >> > > > > >>>>>>>>>>>>> I try to enable generational collection on
> > >> > > > >> multi-cores
> > >> > > > >> > > > > >>>>>> (regardless
> > >> > > > >> > > > > >>>>>>>>>>> whether
> > >> > > > >> > > > > >>>>>>>>>>>>> this slows down the GC in average or not -
> > >> > > anyway it
> > >> > > > >> is
> > >> > > > >> > > > > >>> not on
> > >> > > > >> > > > > >>>>>> by
> > >> > > > >> > > > > >>>>>>>>>>> default).
> > >> > > > >> > > > > >>>>>>>>>>>>> FYI: At present, generational collection
> on
> > >> > > > >> multi-cores
> > >> > > > >> > > > > >>>>>> enabled
> > >> > > > >> > > > > >>>>>>>>> only on
> > >> > > > >> > > > > >>>>>>>>>>>>> Win32.
> > >> > > > >> > > > > >>>>>>>>>>>>>
> > >> > > > >> > > > > >>>>>>>>>>>>> Regards.
> > >> > > > >> > > > > >>>>>>>>>>>>>
> > >> > > > >> > > > > >>>>>>>>>>>>>> I will try to do so; probably I will need
> > >> help,
> > >> > > but
> > >> > > > >> > > > > >>> for now
> > >> > > > >> > > > > >>>>>> al
> > >> > > > >> > > > > >>>>>>>>> least
> > >> > > > >> > > > > >>>>>>>>>>> I
> > >> > > > >> > > > > >>>>>>>>>>>>> want to know it it's possible at all.
> > >> > > > >> > > > > >>>>>>>>>>>>>> Thanks



More information about the Gc mailing list