You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by kf...@collab.net on 2004/09/30 21:20:13 UTC
Re: segfaults with subversion 1.1.0 with apache on SuSE 9.1
Moby <mo...@mobsternet.com> writes:
> Following Peter Poeml's suggestion for me when I had the same issue
> with subversion 1.05 (I did not follow the problem with 1.05 since the
> downloaded RPMS worked fine), I ran strace against httpd2-prefork.
Hmm, do you know how to use GDB? If so, the section "Debugging the
server" in http://svn.collab.net/repos/svn/trunk/HACKING gives
instructions on debugging httpd under GDB:
Debugging the ra_dav server
---------------------------
'mod_dav_svn.so' contains the main Subversion server logic; it runs as
a module within mod_dav, which runs as a module within httpd. Since
httpd is probably using dynamic shared modules, you normally won't be
able to set breakpoints in advance when you start Apache in a debugger
such as GDB. Instead, you'll need to start up, then interrupt httpd,
set your breakpoint, and continue:
% gdb httpd
(gdb) run -X
^C
(gdb) break some_func_in_mod_dav_svn
(gdb) continue
The -X switch is equivalent to -DONE_PROCESS and -DNO_DETACH, which
ensure that httpd runs as a single thread and remains attached to the
tty, respectively. As soon as it starts, it sits and waits for
requests; that's when you hit control-C and set your breakpoint.
You'll probably want to watch Apache's run-time logs
/usr/local/apache2/logs/error_log
/usr/local/apache2/logs/access_log
to help determine what might be going wrong and where to set
breakpoints.
I think that's probably the best way to find the cause of the
segfault...
Best,
-Karl
> Here is the output from the end of strace:
>
> time(NULL) = 1096582672
> semop(1900562, 0x4016fe12, 1) = 0
> poll([{fd=12, events=POLLIN, revents=POLLIN}], 1, 300000) = 1
> read(12, "\27\3\1\1\315\177[]\10\353IN\230\351\354\326U\243\241\262"..., 8000) = 466
> gettimeofday({1096582672, 116083}, NULL) = 0
> stat64("/srv/www/htdocs/svn/mob", {st_mode=S_IFDIR|0755, st_size=224, ...}) = 0
> lstat64("/srv", {st_mode=S_IFDIR|0755, st_size=144, ...}) = 0
> lstat64("/srv/www", {st_mode=S_IFDIR|0755, st_size=168, ...}) = 0
> lstat64("/srv/www/htdocs", {st_mode=S_IFDIR|0755, st_size=1488, ...}) = 0
> lstat64("/srv/www/htdocs/svn", {st_mode=S_IFDIR|0755, st_size=192, ...}) = 0
> lstat64("/srv/www/htdocs/svn/mob", {st_mode=S_IFDIR|0755, st_size=224, ...}) = 0
> --- SIGSEGV (Segmentation fault) @ 0 (0) ---
>
>
> Being a relative newbie to Linux, I cannot fathom why the process
> segfaulted. Any help or ideas will be much appreciated.
>
> Thanks in advance for any help,
> --Moby
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: segfaults with subversion 1.1.0 with apache on SuSE 9.1
Posted by Peter Poeml <po...@suse.de>.
On Thu, Sep 30, 2004 at 04:20:13PM -0500, kfogel@collab.net wrote:
> Moby <mo...@mobsternet.com> writes:
> > Following Peter Poeml's suggestion for me when I had the same issue
> > with subversion 1.05 (I did not follow the problem with 1.05 since the
> > downloaded RPMS worked fine), I ran strace against httpd2-prefork.
>
> Hmm, do you know how to use GDB? If so, the section "Debugging the
> server" in http://svn.collab.net/repos/svn/trunk/HACKING gives
> instructions on debugging httpd under GDB:
>
> Debugging the ra_dav server
> ---------------------------
>
> 'mod_dav_svn.so' contains the main Subversion server logic; it runs as
> a module within mod_dav, which runs as a module within httpd. Since
> httpd is probably using dynamic shared modules, you normally won't be
> able to set breakpoints in advance when you start Apache in a debugger
> such as GDB. Instead, you'll need to start up, then interrupt httpd,
> set your breakpoint, and continue:
>
> % gdb httpd
> (gdb) run -X
> ^C
> (gdb) break some_func_in_mod_dav_svn
> (gdb) continue
>
> The -X switch is equivalent to -DONE_PROCESS and -DNO_DETACH, which
> ensure that httpd runs as a single thread and remains attached to the
> tty, respectively. As soon as it starts, it sits and waits for
> requests; that's when you hit control-C and set your breakpoint.
>
> You'll probably want to watch Apache's run-time logs
>
> /usr/local/apache2/logs/error_log
> /usr/local/apache2/logs/access_log
>
> to help determine what might be going wrong and where to set
> breakpoints.
>
> I think that's probably the best way to find the cause of the
> segfault...
Before that step, it can be generally helpful to use the recently added
apache module mod_log_forensic by setting "ForensicLog
/var/log/apache2/forensic_log", to be able to easily see which request
crashed the server and what was sent by the client. [1]
Of course, this might not be needed at all if any request makes the
server crash, which makes it easy to reproduce.
About this particular case: if you see the segfault at each request,
then it would point to a general incompatilibity like compiling one
thing with large file support but not the other. Make sure to use the
same CFLAGS when building subversion that were used to build apache /
libapr0. Apache modules _must_ be compiled with CFLAGS=`apxs2 -q
CFLAGS`.
Peter
[1] http://httpd.apache.org/docs-2.0/mod/mod_log_forensic.html
--
Thought is limitation. Free your mind.