Tracing GC operations

View: New views
2 Messages — Rating Filter:   Alert me  

Tracing GC operations

by Matt Jones-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi -

I'm trying to hunt down a threading bug in wine that shows up when some of the unit tests from mono are run under wine (so using a windows version of mono). The bug shows up during the GC collect cycle (the function is gc_push or something like that). It's not a bug in mono per se, but being able to trace the operation of the gc would make figuring out what's going on much easier. Is there any good tracing facility for this? I've tried "mono --trace= System.GC", but I don't get anything out.

Also, is there any way to control the operation of the GC (such as forcing a full pass at a pre-determined time etc.). Part of the problem with the bug I'm trying to hunt down is that it occurs very rarely (unsurprising as its likely to do with wine's handling of threading), so coming up with a better way than running the tests until the bug occurs would be awesome.

Thanks,
Matt Jones

_______________________________________________
Mono-gc-list maillist  -  Mono-gc-list@...
http://lists.ximian.com/mailman/listinfo/mono-gc-list

Re: Tracing GC operations

by Paolo Molaro-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 06/08/07 Matt Jones wrote:
> I'm trying to hunt down a threading bug in wine that shows up when some of
> the unit tests from mono are run under wine (so using a windows version of
> mono). The bug shows up during the GC collect cycle (the function is gc_push
> or something like that). It's not a bug in mono per se, but being able to
> trace the operation of the gc would make figuring out what's going on much
> easier. Is there any good tracing facility for this? I've tried "mono
> --trace=System.GC", but I don't get anything out.

That will trace only the calls to the managed methods in the GC class.
Setting the env vars GC_DUMP_REGULARLY and GC_PRINT_STATS will generate
GC logging information, though I'm not sure it would be useful in your
case. Likely getting the crash to happen while under gdb and poking
around can be more useful.

> Also, is there any way to control the operation of the GC (such as forcing a
> full pass at a pre-determined time etc.). Part of the problem with the bug
> I'm trying to hunt down is that it occurs very rarely (unsurprising as its
> likely to do with wine's handling of threading), so coming up with a better
> way than running the tests until the bug occurs would be awesome.

That's not possible without adding specific code to the GC and
recompiling.
You may also want to repost to mono-devel where people that use windows
are more likely to read your email and maybe help more.

lupus

--
-----------------------------------------------------------------
lupus@...                                     debian/rules
lupus@...                             Monkeys do it better
_______________________________________________
Mono-gc-list maillist  -  Mono-gc-list@...
http://lists.ximian.com/mailman/listinfo/mono-gc-list