develooper Front page | perl.perl5.porters | Postings from November 2011

Re: race condition in SDBM_File's Makefile

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
November 3, 2011 06:40
Subject:
Re: race condition in SDBM_File's Makefile
Message ID:
20111103134048.GF23881@plum.flirble.org
On Thu, Nov 03, 2011 at 12:45:08PM +0000, Nicholas Clark wrote:
> There's a race condition in SDBM_File's Makefile, in its handling of the
> subdirectory sdbm. It occasionally crops up for me on FreeBSD. Most

> rm -rf libsdbm.a
> /usr/bin/ar cr libsdbm.a sdbm.o  pair.o  hash.o && : libsdbm.a
> rm -rf libsdbm.a
> chmod 755 libsdbm.a
> /usr/bin/ar cr libsdbm.a sdbm.o  pair.o  hash.o && : libsdbm.a
> chmod: libsdbm.a: No such file or directory
> *** Error code 1
> 1 error
> *** Error code 2
> chmod 755 libsdbm.a
> 1 error
> Unsuccessful make(ext/SDBM_File): code=512 at make_ext.pl line 465.


> I *think* that the error is that the top level makefile uses a target
> 'subdirs' that makes no mention that it builds sdbm/libsdbm.a. Hence
> make has no way to know that it should run 'subdirs' to build that
> file. This would mean that the rule and recipe to build subdirs *from*
> sdbm/libsdbm.a,
> 
>     subdirs :: $(MYEXTLIB)
>     	$(NOECHO) $(NOOP)
> 
> is arse-backwards, because it's saying "target subdirs depends on
> sdbm/libsdbm.a. If subdirs is out of date with respect to sdbm/libsdbm.a,
> then you should rebuild it by running this command, $(NOOP)".
> ie it's a bodge to try to stop make doing anything if sdbm/libsdbm.a already
> exists.

> What troubles me about my suggested solution is that I'm contradicting the
> structure used by the perl core "forever" - ie since "patch.0a for perl5.000"
> converted ext/SDBM_File/Makefile.SH into ext/SDBM_File/Makefile.PL
> (commit 42793c05a05499f6)

Not quite accurate. The rule linking subdirs to $(MYEXTLIB) was added by
"This is my patch  patch.1n  for perl5.001.", commit 8e07c86ebc651fe9,

        MakeMaker-5.00.  Supercedes  NETaa13540 (VMS MakeMaker patches).
        (Updates minimod.PL as well.)
        ***This has a couple of minor problems.
        pod2man is run even if it isn't available.
        LD_RUN_PATH gets set to some mysterious values.***


I don't know how to dig further on that one. I've Cc'd the author :-)

[Who, conveniently happens to be the same person as the committer, so
blame transfer protocol isn't going to work. Inconveniently, it's 16 years
and 3 days ago, so he may well have forgotten]

Nicholas Clark

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About