[Mono-list] mod_mono solaris9 problem

Jonathan Zimmerman tyrius at verizon.net
Tue Jul 11 21:25:19 EDT 2006


Juha,
I, too, had this problem on Solaris 9, and there is another mail thread 
with regards to Solaris 10.  I tracked this down to a problem when 
writing string lengths into the message that is sent from mod_mono to 
xsp.  After applying the following diff to mod_mono.c it worked (I'd say 
perfectly but as I'm running Mono on a 170MHz TurboSparc, slow does not 
equate to perfection).

The patch follows:

--- ./src/mod_mono.c.orig       2006-04-07 13:35:35.000000000 -0700
+++ ./src/mod_mono.c    2006-07-11 18:22:02.919284000 -0700
@@ -1226,7 +1226,7 @@
        buffer += offset;
        tmp = (str != NULL) ? strlen (str) : 0;
        le = LE_FROM_INT (tmp);
-       (*(int32_t *) buffer) = le;
+       memcpy(buffer, &le, sizeof(int32_t));
        if (tmp > 0) {
                buffer += sizeof (int32_t);
                memcpy (buffer, str, tmp);
@@ -1297,7 +1297,7 @@
        } while (t_elt < t_end);

        count = LE_FROM_INT (count);
-       (*(int32_t *) buffer) = count;
+       memcpy(buffer, &count, sizeof(int32_t));
        return (ptr - buffer);
 }

@@ -1351,12 +1351,12 @@
        ptr += write_string_to_buffer (ptr, 0, r->connection->local_ip);
        i = request_get_server_port (r);
        i = LE_FROM_INT (i);
-       (*(int32_t *) ptr) = i;
+       memcpy(ptr, &i, sizeof(int32_t));
        ptr += sizeof (int32_t);
        ptr += write_string_to_buffer (ptr, 0, r->connection->remote_ip);
        i = connection_get_remote_port (r->connection);
        i = LE_FROM_INT (i);
-       (*(int32_t *) ptr) = i;
+       memcpy(ptr, &i, sizeof(int32_t));
        ptr += sizeof (int32_t);
        ptr += write_string_to_buffer (ptr, 0, 
connection_get_remote_name (r));
        ptr += write_table_to_buffer (ptr, r->headers_in);


Juha Pesonen wrote:
> Hi folks!
>
> Please please help me, I really don't know what's wrong. Couldn't find
> anything about this from docs or web.
>
> Platform is solaris 9, mono version 1.1.13.6, xsp version 
> 1.1.15.0, mod_mono version 1.1.14. Apache is version >= 2
>
> Mono itself works fine when executing normal .exe files ie. compiles at
> least simple .cs files and executes them from cmd-line. 
>
> The problem is asp.net and (I guess) mod_mono that does not work. Sites
> work thru xsp when xsp is started from cmd-line so the basic asp.net
> architechture should be ok ?. When called thru apache/mod_mono,
> everything hangs.
>
> Funny (?) thing is that I copied the site and confs from Debian-box
> where it works without any problems, mono versions differ a little
> though.
>
>
>
> Here is apache error log from solaris, at the end are relevant parts of
> httpd.conf.
>
>
>   
>>> path seems ok and so does everything else so far
>>>       
>
> [Mon Jul 03 14:49:11 2006] [warn] PATH after:
> /opt/mono/bin:/opt/mono/lib/xsp/1.0:/opt/mono/bin:/opt/oracle/817/bin:/usr/ccs/bin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/usr/openwin/bin:/usr/ucb:.:/opt/sfw/bin:/usr/local/bin:/opt/mono/bin
> mod-mono-server
> Listening on: /tmp/mod_mono_server_default
> Root directory: /
>
>   
>>> Mono process starts eating up 100% of cpu time and keeps logging this
>>> (does not crash or anything)
>>>       
>
> [Mon Jul 03 14:49:24 2006] [warn] Mono Child Init
> [Mon Jul 03 14:49:24 2006] [warn] Socket file name
> /tmp/mod_mono_server_default
> [Mon Jul 03 14:49:24 2006] [warn] try_connect: 0
> [Mon Jul 03 14:49:24 2006] [warn] connected default
> [Mon Jul 03 14:49:28 2006] [warn] handler: mono
> [Mon Jul 03 14:49:28 2006] [warn] config = 928952
> [Mon Jul 03 14:49:28 2006] [warn] dir_config = 1023176
> [Mon Jul 03 14:49:28 2006] [warn] idx = 1
> [Mon Jul 03 14:49:28 2006] [warn] Socket file name
> /tmp/mod_mono_server_default
> [Mon Jul 03 14:49:28 2006] [warn] try_connect: 0
> [Mon Jul 03 14:49:28 2006] [warn] After setup_socket
> [Mon Jul 03 14:49:28 2006] [warn] Sending init data
> [Mon Jul 03 14:49:28 2006] [warn] Send init1
> [Mon Jul 03 14:49:28 2006] [warn] handler: mono
> [Mon Jul 03 14:49:28 2006] [warn] config = 928952
> [Mon Jul 03 14:49:28 2006] [warn] dir_config = 1023176
> [Mon Jul 03 14:49:28 2006] [warn] idx = 1
> [Mon Jul 03 14:49:28 2006] [warn] Socket file name
> /tmp/mod_mono_server_default
>
>
>   
>>> When we tried to access the site from browser, it sends bus errors, I
>>>       
> think it crashes httpd at this point
>
> [Mon Jul 03 14:49:29 2006] [warn] try_connect: 0
> [Mon Jul 03 14:49:29 2006] [warn] After setup_socket
> [Mon Jul 03 14:49:29 2006] [warn] Sending init data
> [Mon Jul 03 14:49:29 2006] [warn] Send init1
> [Mon Jul 03 14:49:29 2006] [notice] child pid 28364 exit signal Bus
> error (10)
>
>
>
>
>   
>>> httpd.conf
>>>       
>
>
> Alias /sw5 "/opt/spatialweb5/SpatialWeb5"
> AddMonoApplications default "/sw5:/opt/spatialweb5/SpatialWeb5"
> MonoExecutablePath default "/opt/mono/bin/mono"
> MonoServerPath default "/opt/mono/lib/xsp/1.0/mod-mono-server.exe"
> MonoWapidir default "/tmp/.wapi"
> <Location /sw5>
>        MonoSetServerAlias default
>        SetHandler mono
> </Location>
>
>
>
>   
>>> and this included from httpd.conf
>>>       
>
>  
> <IfModule !mod_mono.c>
>     LoadModule mono_module /opt/apache2/modules/mod_mono.so
>  
>     AddType application/x-asp-net .aspx
>     AddType application/x-asp-net .asmx
>     AddType application/x-asp-net .ashx
>     AddType application/x-asp-net .asax
>     AddType application/x-asp-net .ascx
>     AddType application/x-asp-net .soap
>     AddType application/x-asp-net .rem
>     AddType application/x-asp-net .axd
>     AddType application/x-asp-net .cs
>     AddType application/x-asp-net .config
>     AddType application/x-asp-net .Config
>     AddType application/x-asp-net .dll
>     DirectoryIndex index.aspx
>     DirectoryIndex Default.aspx
>     DirectoryIndex default.aspx
> </IfModule>
>
>
> Brs. Juha
>
>
>
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
>   


More information about the Mono-list mailing list