Re: [Mono-dev] DateTimeOffset Test and Patch
On Wed, 2009-11-25 at 15:04 -0800, Tom Philpot wrote: Here's a patch that resolves an issue of adding or subtracting time from a DateTime which crosses the DST boundary. Thanks for the patch, I ran into that issue once then forgot to apply the patch (that is now lost). Looking at yours and committing. Again, there don't appear to be test cases for this in the Mono test suite. your test case will make an unit test. -s Kudos to Martin Potter on our team for figuring this out. This patch is licensed under MIT/X11. ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] [PATCH] MONO_IOMAP reporting option - string allocation locations
Hello everybody, Attached is an update to the original code I posted last week. The update adds support for reporting string allocation locations. It is useful with large code base where strings may be created in one location but used in many others. The code adds a new internal function which does the job of backtrace (3) but supports mono JIT. It's basically a lighter version of mono_jit_walk_stack which was too heavy for this purpose. The code needs to record stack location for each and every string allocated in the application and the runtime only to store it for later use when IOMAP kicks in. Doing that with mono_stack_walk rendered Mono many times slower and made debugging the application virtually impossible. The patch makes execution just slightly slower than usual. The reporting code uses simple heuristics to select the possible string allocation location - it attempts to ignore all methods from assemblies installed in GAC, from corlib and, should the two checks fail, from a list of assemblies and classes to ignore. This is done based on the premise that the Mono runtime and class libraries are case-sensitive and don't have the problem some applications might have (there's actually an instance where that assumption is incorrect - in System.Web we check for existence of web.config, Web.config and Web.Config - but it's intended :)). The results of the selection algorithm might not always be accurate, but they should be close enough to aid the developer to spot the location where string was allocated. Please review and let me know if I can commit. marek diff --git a/mono/metadata/class-internals.h b/mono/metadata/class-internals.h index f18b9b1..4531e50 100644 --- a/mono/metadata/class-internals.h +++ b/mono/metadata/class-internals.h @@ -19,6 +19,7 @@ extern gboolean mono_print_vtable; extern gboolean mono_setup_vtable_in_class_init; typedef void (*MonoStackWalkImpl) (MonoStackWalk func, gboolean do_il_offset, gpointer user_data); +typedef int (*MonoStackBacktraceImpl) (MonoDomain *domain, void **buffer, int size); typedef struct _MonoMethodNormal MonoMethodNormal; typedef struct _MonoMethodWrapper MonoMethodWrapper; @@ -1085,6 +1086,9 @@ mono_method_get_wrapper_data (MonoMethod *method, guint32 id) MONO_INTERNAL; void mono_install_stack_walk (MonoStackWalkImpl func) MONO_INTERNAL; +void +mono_install_stack_backtrace (MonoStackBacktraceImpl func) MONO_INTERNAL; + gboolean mono_metadata_has_generic_params (MonoImage *image, guint32 token) MONO_INTERNAL; diff --git a/mono/metadata/loader.c b/mono/metadata/loader.c index 6293811..bcf0d1f 100644 --- a/mono/metadata/loader.c +++ b/mono/metadata/loader.c @@ -1969,6 +1969,28 @@ mono_install_stack_walk (MonoStackWalkImpl func) stack_walk = func; } +static int +default_mono_stack_backtrace (MonoDomain *domain, void **buffer, int size) +{ + g_warning (stack backtrace not installed); + return 0; +} + +static MonoStackBacktraceImpl stack_backtrace = default_mono_stack_backtrace; + +int +mono_stack_backtrace (MonoDomain *domain, void **buffer, int size) +{ + return stack_backtrace (domain, buffer, size); +} + +void +mono_install_stack_backtrace (MonoStackBacktraceImpl func) +{ + if (func) + stack_backtrace = func; +} + static gboolean last_managed (MonoMethod *m, gint no, gint ilo, gboolean managed, gpointer data) { diff --git a/mono/metadata/loader.h b/mono/metadata/loader.h index 517f8e0..464688b 100644 --- a/mono/metadata/loader.h +++ b/mono/metadata/loader.h @@ -3,6 +3,7 @@ #include mono/metadata/metadata.h #include mono/metadata/image.h +#include mono/utils/mono-compiler.h G_BEGIN_DECLS @@ -87,6 +88,9 @@ mono_stack_walk (MonoStackWalk func, gpointer user_data); void mono_stack_walk_no_il (MonoStackWalk func, gpointer user_data); +int +mono_stack_backtrace (MonoDomain *domain, void **buffer, int size) MONO_INTERNAL; + G_END_DECLS #endif diff --git a/mono/metadata/object.c b/mono/metadata/object.c index c2ecefa..06e3f0e 100644 --- a/mono/metadata/object.c +++ b/mono/metadata/object.c @@ -41,6 +41,7 @@ #include mono/utils/strenc.h #include mono/utils/mono-counters.h #include mono/utils/mono-error-internals.h +#include mono/utils/mono-io-portability.h #include cominterop.h #ifdef HAVE_BOEHM_GC @@ -4555,6 +4556,8 @@ mono_string_new_utf16 (MonoDomain *domain, const guint16 *text, gint32 len) memcpy (mono_string_chars (s), text, len * 2); + if (IS_PORTABILITY_REPORT) + mono_portability_remember_string (s, domain); return s; } diff --git a/mono/metadata/string-icalls.c b/mono/metadata/string-icalls.c index 60675e3..974a9c8 100644 --- a/mono/metadata/string-icalls.c +++ b/mono/metadata/string-icalls.c @@ -22,6 +22,7 @@ #include mono/metadata/object.h #include mono/metadata/exception.h #include mono/metadata/debug-helpers.h +#include mono/utils/mono-io-portability.h /* Internal helper methods */ @@ -207,9 +208,17 @@ string_icall_is_in_array
Re: [Mono-dev] [PATCH] MONO_IOMAP reporting option - string allocation locations
Hi, This patch adds code to the string allocation functions which need to be as fast as possible. I think it might be better to implement this as a profiler module, a profiler can already receive notifications when an object is allocated. Zoltan On Fri, Nov 27, 2009 at 1:08 AM, Marek Habersack gren...@twistedcode.netwrote: Hello everybody, Attached is an update to the original code I posted last week. The update adds support for reporting string allocation locations. It is useful with large code base where strings may be created in one location but used in many others. The code adds a new internal function which does the job of backtrace (3) but supports mono JIT. It's basically a lighter version of mono_jit_walk_stack which was too heavy for this purpose. The code needs to record stack location for each and every string allocated in the application and the runtime only to store it for later use when IOMAP kicks in. Doing that with mono_stack_walk rendered Mono many times slower and made debugging the application virtually impossible. The patch makes execution just slightly slower than usual. The reporting code uses simple heuristics to select the possible string allocation location - it attempts to ignore all methods from assemblies installed in GAC, from corlib and, should the two checks fail, from a list of assemblies and classes to ignore. This is done based on the premise that the Mono runtime and class libraries are case-sensitive and don't have the problem some applications might have (there's actually an instance where that assumption is incorrect - in System.Web we check for existence of web.config, Web.config and Web.Config - but it's intended :)). The results of the selection algorithm might not always be accurate, but they should be close enough to aid the developer to spot the location where string was allocated. Please review and let me know if I can commit. marek ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] [Mono-list] WCF Service
Hello, I'm not sure if you understand both the relevant WCF things and me, but I can say, whatever you say the site cannot say WCF works on mono 2.4, or in case you meant mono project site it does not say mono 2.4 WCF works. Mono trunk or 2.6 preview already has basic ASP.NET support. Atsushi Eno On 2009/11/26 2:11, Stita Fares wrote: Thank you for your reply, I still don't understand if there is anyway to use WCF then, because my aspx page works, webservices, the site says that WCF works Is it pointless to try, or is there anyway to achieve this ? 2009/11/25 Atsushi Eno atsushi...@veritas-vos-liberabit.com mailto:atsushi...@veritas-vos-liberabit.com You are trying to use ASP.NET http://ASP.NET integration while you don't have HTTP handler mapping for .svc (which smells, you are trying to use WCF on 2.4 where ASP.NET http://ASP.NET integration is *not* supported). Atsushi Eno Mono-list maillist - mono-l...@lists.ximian.com mailto:mono-l...@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] [Patch] Report an error if src and dest are the same in Copy
Hey, The attached patch on CopyFile on our io-layer -which is used by System.IO.File.Copy- check if the source and the destination are the same, and in that case, report that the file is currently in use, and proceed to throw an exception. I tried to add this check directly in our C# side, but then moved the check to our io-layer side so we could take advantage of our IOMAP capability. Could anybody with experience in the io-layer review? Thanks! Index: io-layer/io.c === --- io-layer/io.c (revisiĆ³n: 146913) +++ io-layer/io.c (copia de trabajo) @@ -1954,7 +1954,7 @@ { gchar *utf8_src, *utf8_dest; int src_fd, dest_fd; - struct stat st; + struct stat st, dest_st; gboolean ret = TRUE; if(name==NULL) { @@ -2020,6 +2020,20 @@ return(FALSE); } + + /* Before trying to open/create the dest, we need to report a 'file busy' + * error if src and dest are actually the same file. We do the check here to take + * advantage of the IOMAP capability */ + if (!_wapi_stat (utf8_dest, dest_st) st.st_dev == dest_st.st_dev + st.st_ino == dest_st.st_ino) { + + g_free (utf8_src); + g_free (utf8_dest); + close (src_fd); + + SetLastError (ERROR_SHARING_VIOLATION); + return (FALSE); + } if (fail_if_exists) { dest_fd = _wapi_open (utf8_dest, O_WRONLY | O_CREAT | O_EXCL, st.st_mode); ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list