[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Spuriously failing hook scripts

From: Franz Sirl <Franz.Sirl-kernel_at_lauterbach.com>
Date: 2006-09-12 14:33:36 CEST

Hi,

on a dual-Xeon fully updated SLES10 server I got spuriously failing
pre-commit hook scripts. After some investigation I found a simple
fix. The real bug however maybe in one of the lower layers like
apr/glibc/kernel.

What I got in the logs without the patch applied (1.3.x-branch +
extended printf) looked liked this:

[Mon Sep 04 19:16:02 2006] [error] [client 10.1.0.24] Could not MERGE
resource "/svn/t32/!svn/act/492e69a7-336f-c147-9bec-31bfedb7429d"
into "/svn/t32/trunk/emumci/common". [409, #0]
[Mon Sep 04 19:16:02 2006] [error] [client 10.1.0.24] An error
occurred while committing the transaction. [409, #165001]
[Mon Sep 04 19:16:02 2006] [error] [client 10.1.0.24] 'pre-commit'
hook failed with error output:\n'', exitwhy=1,
exitcode=-2144514808 [409, #165001]

So essentially "exitcode" doesn't get set under some circumstances.

A corresponding strace excerpt for this situation looks like:

...
6834 clone(child_stack=0,
flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD,
child_tidptr=0xb7adbb68) = 15158
6834 close(34) = 0
15158 close(5 <unfinished ...>
6834 close(36 <unfinished ...>
15158 <... close resumed> ) = 0
6834 <... close resumed> ) = 0
15158 close(3 <unfinished ...>
6834 close(32 <unfinished ...>
15158 <... close resumed> ) = 0
6834 <... close resumed> ) = 0
15158 close(6 <unfinished ...>
6834 read(31, <unfinished ...>
15158 <... close resumed> ) = 0
15158 close(4) = 0
15158 close(13) = 0
15158 close(12) = 0
15158 close(11) = 0
15158 close(10) = 0
15158 close(9) = 0
15158 close(8) = 0
15158 close(7) = 0
15158 close(15) = 0
15158 close(17) = 0
15158 close(16) = 0
15158 close(33) = 0
15158 close(32) = 0
15158 close(31) = 0
15158 close(35) = 0
15158 dup2(34, 1) = 1
15158 close(34) = 0
15158 close(37) = 0
15158 dup2(36, 2) = 2
15158 close(36) = 0
15158 rt_sigaction(SIGCHLD, {SIG_DFL}, {0xb78d6300, [CHLD], SA_RESTART}, 8) = 0
15158 chdir(".") = 0
15158 execve("/home/svn/repos/t32/hooks/pre-commit",
["/home/svn/repos/t32/hooks/pre-co"..., "/home/svn/repos/t32",
"4x3"], [/* 0 vars */]) = 0
15158 brk(0) = 0x804a000

...

15158 _llseek(3, 727, [727], SEEK_SET) = 0
15158 _llseek(3, 713, [713], SEEK_SET) = 0
15158 fstat64(1, {st_mode=S_IFCHR|0666, st_rdev=makedev(1, 3), ...}) = 0
15158 fstat64(2, {st_mode=S_IFIFO|0600, st_size=0, ...}) = 0
15158 exit_group(0) = ?
6834 <... read resumed> "", 8192) = 0
6834 --- SIGCHLD (Child exited) @ 0 (0) ---
6834 waitpid(-1, NULL, WNOHANG) = 15158
6834 waitpid(-1, NULL, WNOHANG) = -1 ECHILD (No child processes)
6834 rt_sigaction(SIGCHLD, {0xb78d6300, [CHLD], SA_RESTART},
{0xb78d6300, [CHLD], SA_RESTART}, 8) = 0
6834 sigreturn() = ? (mask now [])
6834 waitpid(15158, 0xbfc1a118, WSTOPPED) = -1 ECHILD (No child processes)
6834 close(31) = 0
6834 close(33) = 0
...

Feel free to contact me for further details. I'm not subscribed, so
please keep me on CC.

Hope this helps,
Franz.

Index: subversion/libsvn_subr/io.c
===================================================================
--- subversion/libsvn_subr/io.c (revision 21374)
+++ subversion/libsvn_subr/io.c (working copy)
@@ -1832,7 +1832,7 @@
 {
   apr_status_t apr_err;
   apr_exit_why_e exitwhy_val;
- int exitcode_val;
+ int exitcode_val = 0;
 
   /* The Win32 apr_proc_wait doesn't set this... */
   exitwhy_val = APR_PROC_EXIT;
Index: subversion/libsvn_repos/hooks.c
===================================================================
--- subversion/libsvn_repos/hooks.c (revision 21374)
+++ subversion/libsvn_repos/hooks.c (working copy)
@@ -125,8 +125,8 @@
                 {
                   err = svn_error_createf
                     (SVN_ERR_REPOS_HOOK_FAILURE, err,
- _("'%s' hook failed with error output:\n%s"),
- name, error->data);
+ _("'%s' hook failed with error output:\n'%s', exitwhy=%i, exitcode=%i"),
+ name, error->data, (int)exitwhy, (int)exitcode);
                 }
               else
                 {

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Sep 12 23:11:04 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.