Re: [Mono-dev] _wapi_connect stuck in poll()
Will this be committed to trunk / 2.4.x LTS branch ? On Sun, May 30, 2010 at 7:48 PM, yoni shalom silve...@gmail.com wrote: Edited the patch to aligned with 2.4.2.3 source code (which I'm compiling from), and attached. Patch seems to fix it, thanks. (sorry for the double-send -g) Yoni Shalom. On Tue, May 25, 2010 at 10:15 PM, Geoff Norton gnor...@novell.com wrote: Can you try this patch? -g On 2010-05-25, at 3:05 PM, yoni shalom wrote: Tested on Mono 2.4.2.3, 2.6.x Both leopard and snow leopard. It seems as though _sometime_ (ranges from 0 to 5 out of 50) threads that are in the middle of performing Socket.Connect() on which Thread.Abort() is called, never exit and cause the thread to leak and be stuck indefinitely. The offending thread is stuck in Socket.Connect()-Connect_internal-_wapi_connect-poll(). I'm attaching a test program - just let it run, wait for 30 seconds and then in gdb display all stacks ( t apply all bt ) and you will see the threads stuck in ves_blabla_Connect_Internal() The code I'm talking about is this (mono/io-layer/sockets.c) : while (poll (fds, 1, -1) == -1 !_wapi_thread_cur_apc_pending ()) { if (errno != EINTR) { errnum = errno_to_WSA (errno, __func__); #ifdef DEBUG g_message (%s: connect poll error: %s, __func__, strerror (errno)); #endif WSASetLastError (errnum); return(SOCKET_ERROR); } } I've been trying to debug this code without much luck understanding what is special to the misbehaving scenario... A change in the first line of code, allowing for a timeout of 3 seconds in the poll syscall (not sure how correct this is), seems to solve the problem for me. int prslt; while(((prslt = poll(fds, 1, 3000)) == 0) || (prslt == -1 !_wapi_thread_cur_apc_pending()) { ... Obviously this is not optimal, and as such - is not a solution proposal but just additional info. BeginConnect.zip___ 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 for environment specific location for .mono folder
Attached is a patch that allows the user (or an embedded application) to set MONO_USER_CONFIG to specify a directory location for the .mono folder, similar to the MONO_CONFIG environment variable for mono configuration folder. We have an app which embeds Mono and we'd like to be certain that other Mono apps won't be tinkering with our configuration. This also allows us to make sure that the .mono folder can be created/updated as certain users don't have write access to their home folder, but do have access to sub-folders. We'd prefer not to have to ask for elevated permissions just to create a hidden config folder. Finally, this allows our application not to scatter configuration information throughout the file system as we can put all our configuration under an application specific folder. This patch is MIT/X11 licensed. Index: mono-config.c === --- mono-config.c (revision 158291) +++ mono-config.c (working copy) @@ -560,7 +560,9 @@ g_free (mono_cfg); #ifndef TARGET_WIN32 - home = g_get_home_dir (); + home = g_getenv (MONO_USER_CONFIG); + if (home == NULL) + home = g_get_home_dir (); user_cfg = g_strconcat (home, G_DIR_SEPARATOR_S, .mono/config, NULL); mono_config_parse_file (user_cfg); g_free (user_cfg); Thanks, Tom ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] Patch for environment specific location for .mono folder
After digging a little bit further, it seems there are more issues with this patch: First, the AOT-Runtimes assumes that .mono is under g_get_home_dir() Secondly, System.Environment.SpecialFolder.Personal returns internalGetHome which is g_get_home_dir() Does it make sense to change this to a MONO_USER_HOME environment variable that takes precedence over g_get_home_dir(), and then update references to g_get_home_dir() to check MONO_USER_HOME first? This would be really useful for use, and possibly others I'd expect. Tom On Jun 1, 2010, at 9:44 AM, Tom Philpot wrote: Attached is a patch that allows the user (or an embedded application) to set MONO_USER_CONFIG to specify a directory location for the .mono folder, similar to the MONO_CONFIG environment variable for mono configuration folder. We have an app which embeds Mono and we'd like to be certain that other Mono apps won't be tinkering with our configuration. This also allows us to make sure that the .mono folder can be created/updated as certain users don't have write access to their home folder, but do have access to sub-folders. We'd prefer not to have to ask for elevated permissions just to create a hidden config folder. Finally, this allows our application not to scatter configuration information throughout the file system as we can put all our configuration under an application specific folder. This patch is MIT/X11 licensed. Index: mono-config.c === --- mono-config.c (revision 158291) +++ mono-config.c (working copy) @@ -560,7 +560,9 @@ g_free (mono_cfg); #ifndef TARGET_WIN32 - home = g_get_home_dir (); + home = g_getenv (MONO_USER_CONFIG); + if (home == NULL) + home = g_get_home_dir (); user_cfg = g_strconcat (home, G_DIR_SEPARATOR_S, .mono/config, NULL); mono_config_parse_file (user_cfg); g_free (user_cfg); Thanks, Tom ___ 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] Patch for environment specific location for .mono folder
Hi, The relevant code in aot-runtime.c is just some experimental code, its not used by anyone, so you can ignore it. Zoltan On Tue, Jun 1, 2010 at 7:42 PM, Tom Philpot tom.phil...@logos.com wrote: After digging a little bit further, it seems there are more issues with this patch: First, the AOT-Runtimes assumes that .mono is under g_get_home_dir() Secondly, System.Environment.SpecialFolder.Personal returns internalGetHome which is g_get_home_dir() Does it make sense to change this to a MONO_USER_HOME environment variable that takes precedence over g_get_home_dir(), and then update references to g_get_home_dir() to check MONO_USER_HOME first? This would be really useful for use, and possibly others I'd expect. Tom On Jun 1, 2010, at 9:44 AM, Tom Philpot wrote: Attached is a patch that allows the user (or an embedded application) to set MONO_USER_CONFIG to specify a directory location for the .mono folder, similar to the MONO_CONFIG environment variable for mono configuration folder. We have an app which embeds Mono and we'd like to be certain that other Mono apps won't be tinkering with our configuration. This also allows us to make sure that the .mono folder can be created/updated as certain users don't have write access to their home folder, but do have access to sub-folders. We'd prefer not to have to ask for elevated permissions just to create a hidden config folder. Finally, this allows our application not to scatter configuration information throughout the file system as we can put all our configuration under an application specific folder. This patch is MIT/X11 licensed. Index: mono-config.c === --- mono-config.c (revision 158291) +++ mono-config.c (working copy) @@ -560,7 +560,9 @@ g_free (mono_cfg); #ifndef TARGET_WIN32 - home = g_get_home_dir (); + home = g_getenv (MONO_USER_CONFIG); + if (home == NULL) + home = g_get_home_dir (); user_cfg = g_strconcat (home, G_DIR_SEPARATOR_S, .mono/config, NULL); mono_config_parse_file (user_cfg); g_free (user_cfg); Thanks, Tom ___ 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-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] gstreamer-sharp problems
On Mon, May 31, 2010 at 5:28 PM, rasive ras...@gmail.com wrote: Could someone at least point me in the right direction? A working example would be sufficient, i have tried a lot of ways, but none seems to work. What version are you using? There was an unfinished gstreamer-sharp floating around for several years, and only relatively recently was the effort resumed. I would recommend building the latest from source and trying the included samples. http://gstreamer.freedesktop.org/modules/gstreamer-sharp.html -- Michael Hutchinson http://mjhutchinson.com ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] Patch for environment specific location for .mono folder
On third thought, the patch below may not be that necessary for our case as the XDG_DATA_HOME, XDG_CONFIG_HOME and MONO_SHARED_DIR can all be remapped based on environment variables. The Registry code UnixRegistryApi.cs assumes that .mono will live under the folder returned by g_get_home_dir() and several of the Makefiles that deal with the Registry assume this value is $HOME, but for our app, it's easier to just make sure we don't use the Registry than to hack Mono to that level. I suppose one could just add a MONO_USER_REGISTRY_PATH environment variable, but that just increases the proliferation of environment variables that one has to account for. Remapping internalGetHome() to something other than the value of g_get_home_dir() is just a fantastically bad idea. Tom On Jun 1, 2010, at 10:47 AM, Zoltan Varga wrote: Hi, The relevant code in aot-runtime.c is just some experimental code, its not used by anyone, so you can ignore it. Zoltan On Tue, Jun 1, 2010 at 7:42 PM, Tom Philpot tom.phil...@logos.commailto:tom.phil...@logos.com wrote: After digging a little bit further, it seems there are more issues with this patch: First, the AOT-Runtimes assumes that .mono is under g_get_home_dir() Secondly, System.Environment.SpecialFolder.Personal returns internalGetHome which is g_get_home_dir() Does it make sense to change this to a MONO_USER_HOME environment variable that takes precedence over g_get_home_dir(), and then update references to g_get_home_dir() to check MONO_USER_HOME first? This would be really useful for use, and possibly others I'd expect. Tom On Jun 1, 2010, at 9:44 AM, Tom Philpot wrote: Attached is a patch that allows the user (or an embedded application) to set MONO_USER_CONFIG to specify a directory location for the .mono folder, similar to the MONO_CONFIG environment variable for mono configuration folder. We have an app which embeds Mono and we'd like to be certain that other Mono apps won't be tinkering with our configuration. This also allows us to make sure that the .mono folder can be created/updated as certain users don't have write access to their home folder, but do have access to sub-folders. We'd prefer not to have to ask for elevated permissions just to create a hidden config folder. Finally, this allows our application not to scatter configuration information throughout the file system as we can put all our configuration under an application specific folder. This patch is MIT/X11 licensed. Index: mono-config.c === --- mono-config.c (revision 158291) +++ mono-config.c (working copy) @@ -560,7 +560,9 @@ g_free (mono_cfg); #ifndef TARGET_WIN32 - home = g_get_home_dir (); + home = g_getenv (MONO_USER_CONFIG); + if (home == NULL) + home = g_get_home_dir (); user_cfg = g_strconcat (home, G_DIR_SEPARATOR_S, .mono/config, NULL); mono_config_parse_file (user_cfg); g_free (user_cfg); Thanks, Tom ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.commailto: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.commailto: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