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

Re: locks-test fail when building subversion-1.10.0 from sources under Linux (Ubuntu 16)

From: Philip Martin <philip_at_codematters.co.uk>
Date: Tue, 01 May 2018 13:48:36 +0100

Juan Gabriel Covas <jgcovas_at_softline.es> writes:

> Thanks for your input.
>
> # ./fs-test 14
> PASS: lt-fs-test 14: set/get txn props, commit, validate new rev props
>
>>Does it always fail?
>
> Always Pass when executed individually.

Oops! I gave the wrong executable name. It should be

  ./locks-test 14
  
>>What sort of filesystem are you using? Is it a
>>network filesystem?
>
> No network filesystem:
> # mount | grep sda1
> /dev/sda1 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)
>
>>If you have strace installed you can run:
>> libtool --mode=execute strace ./locks-test 14 2>&1 | grep failure/write-lock
>
> This is what I get:
>
> …/libsvn_fs# libtool --mode=execute strace ./locks-test 14 2>&1 | grep
> failure/write-lock

I got the right executable name here, so the test does fail.

> chmod("test-obtain-write-lock-failure/write-lock", 0444) = 0
> open("test-obtain-write-lock-failure/write-lock", O_RDWR|O_CLOEXEC) = 3

That is the failure. The chmod sets the file to be read-only (the chmod
returns 0) but the open still returns a writeable file descriptor. The
open should fail.

If you have gdb installed you can check whether the 0444 permissions
have made it to the filesystem (-r--r--r--). Something like:

  $ libtool --mode=execute gdb -arg ./locks-test 14
  (gdb) b svn_fs_lock_many
  (gdb) r
  Breakpoint 1
  (gdb) shell ls -l test-obtain-write-lock-failure/write-lock
  -r--r--r-- 1 pm pm 0 May 1 13:17 test-obtain-write-lock-failure/write-lock
  (gdb) b open
  (gdb) c
  Breakpoint 2
  (gdb) shell ls -l test-obtain-write-lock-failure/write-lock
  -r--r--r-- 1 pm pm 0 May 1 13:17 test-obtain-write-lock-failure/write-lock
  (gdb) fin
  (gdb) fin
  Value returned is $1 = 13
  (gdb) p fname_apr
  $2 = 0x7ffff7eea130 "test-obtain-write-lock-failure/write-lock"
  (gdb) shell ls -l test-obtain-write-lock-failure/write-lock
  -r--r--r-- 1 pm pm 0 May 1 13:17 test-obtain-write-lock-failure/write-lock

The second breakpoint is the open that should fail. The two "fin"
commands return to the Subversion code and the value 13 is EPERM showing
the open failed (because the file has permissions -r--r--r--).

In your case I assume the return value is 0 rather than 13 and the file
permissions are not -r--r--r--.

-- 
Philip
Received on 2018-05-01 14:48:43 CEST

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

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