From: domingo@... (Domingo Alvarez Duarte) Date: 2002-04-27T05:19:22+09:00 Subject: mod_ruby with mod_ssl segfault the problem and the soluction Recently I've installed mod_ssl in my apache webserver that is runing mod_ruby, before that it was working but after that I've starting geting segfault constantly. Looking in the web I could see that this problem occurs as well with mod_perl and php, I did the modifications that the mod_ssl FAQ indicates but the problem remain there. Reading about how to use the GDB to debug apache and using it I got the origin of the sigfault, it was in libcrypto.so that was called from digest/md5 from ruby. Looking at the source code I realized that the digest/md5 contains all code that it needs to perform the encripted hash generation and should not call libcrypto.so. Looking in the code of openssl that is used by mod_ssl I saw the problem: openssl define the following functions : MD5_Init, MD5_Update, MD5_Final and digest/md5 define then as well and when apache is linked with mod_ssl for some reason digest/md5 is linked against the openssl functions instead of digest/MD5 functions. My soluction: I've edited md5.c, md5.h, md5init.c in digest/md5 and added "rb_" to all functions that start with MD5 so MD5_Init now is rb_MD5_Init and so on. The "rb_" can be any prefix to prevent the name clash with openssl functions. Probably with mod_perl and PHP something like that is the problem as well. Now my apache webserver works fine. I hope that this information can be helpfull to someone trying using mod_ruby and mod_ssl together. The man is condemned to be free (Jean Paul Sartre).