Re[16]: [Gc] GC + Windows Mobile + Threads + Patch for WINCE

Ivan Maidanski ivmai at mail.ru
Tue Aug 25 05:00:12 PDT 2009


Hi!

biosli <biosli at hotmail.com> wrote:
> Dear Ivan:
> > Ok. I'll supply the proper patch - replacement for my ivmai119.diff (I no longer use thread handles for WinCE).
> > 
> > It would be good if you also try out various optimizations (before I supply the patch), i.e. test GC with:
> All case: I defined VERY_SMALL_CONFIG, otherwise the test will   out of memory  .
> (25M free memory)

Yes, VERY_SMALL_CONFIG (affects only test.c).

> > 1. remove SMALL_CONFIG and define USE_MUNMAP;
> case 1:
> Test Output:
> Received WM_CLOSE, closing window
> The thread 'GC_win32_start' (0xed0b0ce) has exited with code 0 (0x0).
> Completed 6 tests
> Allocated 802710 collectable objects
> Allocated 1212 uncollectable objects
> Allocated 0 atomic objects
> Allocated 0 stubborn objects
> Finalized 1644/1644 objects - finalization is probably ok
> Total number of bytes allocated is 24005482
> Final heap size is 417792 bytes

Ok. Unmapping works (compare this to "Final heap size is 18325504 bytes" w/o USE_MUNMAP).

> Collector appears to work
>  
>  
> > 2. remove SMALL_CONFIG (remove also GC_GCJ_SUPPORT if defined) and define THREAD_LOCAL_ALLOC;
> Case 2:
> The test program crashed.
> Data Abort: Thread=8e774824 Proc=8c398520 'test_libgcd_Wince.exe'
> AKY=00040001 PC=000181bc(test_libgcd_Wince.exe+0x000081bc) RA=00017c34(test_libgcd_Wince.exe+0x00007c34) BVA=26d8fe60 FSR=00000007
> Unhandled exception at 0x000181bc in test_libgcd_Wince.exe: 0xC0000005: Access violation reading location 0x00d8fe60.
> The thread 'GC_win32_start' (0x4d84af6e) has exited with code -1073741819 (0xc0000005).
> In win32 the test program works well.

Here is some problem. Could you run it under debugger (if that isn't difficult for you) and tell me backtrace where SEGV occurs?

> > 3. remove SMALL_CONFIG and define GC_GCJ_SUPPORT, THREAD_LOCAL_ALLOC, 

If the previous test fails then this is broken too.

> > AO_ASSUME_ARM_ARCH6 and use -Ilibatomic_ops-1.2\src (this also requires my diff109_cvs and diff110 - http://article.gmane.org/gmane.comp.programming.garbage-collection.boehmgc/2954).
> Case 3:
> I merged your code. 
> AO_ASSUME_ARM_ARCH6 seems used no where in the current code.

Yes, really not needed (libatomic_ops is used only to get compiler barrier).

> So the test case is current defined GC_GCJ_SUPPORT, THREAD_LOCAL_ALLOC.
> I got Debugbreak and warning:
> ----------------------
> Small thread creation failed 8
> Small thread wait failed 6
> Small thread creation failed 8
> Small thread wait failed 6
> Small thread creation failed 8
> Small thread wait failed 6
> Small thread creation failed 8
> Small thread wait failed 6
> Small thread creation failed 8
> Small thread wait failed 6
> ----------------------
> I think that because of out of memory. 

Yes, 8 is ERROR_NOT_ENOUGH_MEMORY.

Search for the code in test.c:

    for (i = 0; i < 5; ++i) {
      check_ints(reverse(reverse(ints(1,10))), 1, 10);

And try smaller values, say, 5 -> 3 and 10 -> 4. If it would work I'll set this values for VERY_SMALL_CONFIG case.

> After that the program ran to the end.
> And the test output:
> Received WM_CLOSE, closing window
> The thread 'GC_win32_start' (0x2ef309ca) has exited with code 0 (0x0).
> Completed 6 tests
> Allocated 801806 collectable objects
> Allocated 1212 uncollectable objects
> Allocated 0 atomic objects
> Allocated 0 stubborn objects
> Finalized 1815/1815 objects - finalization is probably ok
> Total number of bytes allocated is 24216074
> Final heap size is 15052800 bytes
> Collector appears to work

This happens to work but shouldn't (since case 2 failed).

Thanks.

>  
> Best wishes,
> GC Beginner
> Zeyi Lee

PS. I've also made PARALLEL_MARK available on WinCE but it requires assembler AO_store() implemetation on ARM for VC++.

Bye.


More information about the Gc mailing list