Re: mod_log_sql 1.97 with Apache 2 with MySQL on FreeBSD...

Shawn Michael <smichael-icIElDLue0NWk0Htik3J/[email protected]> Mon, 12 Jul 2004 13:08:50 -0600
Newsgroups gmane.comp.apache.mod-log-sql
Organization RightNow Technologies, Inc.
Message-ID <[email protected]>
You may try the attached patch.  I had the same problem on linux apache-2.  The problem has to do with trying to detect 
the character set to write the output in (for backslashifying purposes).


Edward Rudd wrote:
> On Sun, 2004-07-11 at 03:26, Paul Chvostek wrote:
> 
>>Hiya.
>>
>>I've been using mod_log_sql v1.18 with Apache 1.3 for quite some time
>>with great success.  I thought it might be fun to play around with
>>Apache 2, but I've hit a (perhaps small) roadblock.
> 
> 
>>The problem is, Apache is reporting segfaults to its error_log:
>>
>>[Sun Jul 11 03:59:30 2004] [notice] child pid 3866 exit signal Segmentation fault (11)
>>[Sun Jul 11 03:59:35 2004] [notice] child pid 3867 exit signal Segmentation fault (11)
>>
> 
> Can you get me a backtrace??
> download mod_backtrace from
> http://www.apache.org/~trawick/exception_hook.html
> 
> Hopefully the freebsd build of apache 2.0.50 has exception hooks
> enabled.. 
> just use 
> apxs -cai mod_backtrace.c
> then add 
> EnableExceptionHook On
> Backtracelog logs/backtrace.log
> 
> into your configuration file.
> Then mail the contents of the backtrace.log after a crash.
> 
> You can also use GDB and just
> gdb /path/to/httpd pidid
> 
> where the pidid is a child process of apache (use ps ax to list
> processes )
> 
> and then do a bt when apache segfaults
> 
> Also try using the latest mod_log_sql and see if it works.. but I've had
> reports of that version doing the same on some linux systems.
> 
> 
>>FAQ question 2.1 seemed plausable enough until I noticed that PHP5 seems
>>to use the real MySQL libraries rather than rolling its own.
> 
> 
>>Thanks.
>>
>>
>>------------------------------------------------------------------------
>>
>>_______________________________________________
>>Download the latest version at http://www.outoforder.cc/projects/apache/mod_log_sql/
>>
>>To unsubscribe send an e-mail to 
>>mod_log_sql-unsubscribe-7qY7E20V6GW73k+5HYS8LQqVMODqnSLI@public.gmane.org

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Shawn Michael                                   smichael-icIElDLue0NWk0Htik3J/[email protected]
RightNow Technologies                           Hosting Administrator
                                  A Better Way to Serve your Customers

_______________________________________________
Download the latest version at http://www.outoforder.cc/projects/apache/mod_log_sql/

To unsubscribe send an e-mail to 
mod_log_sql-unsubscribe-7qY7E20V6GW73k+5HYS8LQqVMODqnSLI@public.gmane.org
mod_log_sql-1.98.diff (text/x-patch, 741 B)
--- mod_log_sql.c.bak	2004-06-08 12:37:07.000000000 -0600
+++ mod_log_sql.c	2004-06-08 13:02:16.000000000 -0600
@@ -786,6 +786,15 @@
 	const char *hin_tablename = cls->hin_table_name;
 	const char *cookie_tablename = cls->cookie_table_name;
 
+
+	/* This is a hack to get forcepreserve to work properly without core dumping
+	 * The core dump happens in mod_log_sql_mysql.c when it sees db.connected = 1
+	 * and tries to use the database connection that doesn't exist to escape
+	 * the characters.
+	 */
+	if (global_config.forcepreserve)
+		global_config.db.connected = 0;
+
 	/* We handle mass virtual hosting differently.  Dynamically determine the name
 	 * of the table from the virtual server's name, and flag it for creation.
 	 */
smime.p7s (application/x-pkcs7-signature, 3.1 KB) - not displayed