Re: Segfault on CVS HEAD - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Segfault on CVS HEAD
Date
Msg-id 200901060226.n062Q9I10451@momjian.us
Whole thread Raw
In response to Re: Segfault on CVS HEAD  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
> Alvaro Herrera <alvherre@commandprompt.com> writes:
> > Bruce Momjian wrote:
> >> gmake: *** [install] Segmentation fault
>
> > Your make is buggy?
>
> I'm not totally sure, but I think this is make reporting that install
> crashed.  Perhaps a corrupted install executable?

Turns out the cause was a buggy gmake that segment fauled on this:

    $(if $(ZIC),$(ZIC),./zic) -d ...

It affects at least gmake 3.78.1 but is fixed in at least version 3.81.
I talked to Peter and it seemed easist to just simplify the gmake rules
and document the issue with a comment, attached.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +
Index: src/timezone/Makefile
===================================================================
RCS file: /cvsroot/pgsql/src/timezone/Makefile,v
retrieving revision 1.30
diff -c -c -r1.30 Makefile
*** src/timezone/Makefile    5 Jan 2009 10:25:59 -0000    1.30
--- src/timezone/Makefile    6 Jan 2009 02:06:26 -0000
***************
*** 38,49 ****
  all: submake-libpgport zic
  endif

  zic: $(ZICOBJS)
      $(CC) $(CFLAGS) $(ZICOBJS) $(LDFLAGS) $(LIBS) -o $@$(X)

  install: all installdirs
  ifeq (,$(with_system_tzdata))
!     $(if $(ZIC),$(ZIC),./zic) -d '$(DESTDIR)$(datadir)/timezone' -p '$(POSIXRULES)' $(TZDATAFILES)
  endif
      $(MAKE) -C tznames $@

--- 38,57 ----
  all: submake-libpgport zic
  endif

+ # We could do this test in the action section:
+ #    $(if $(ZIC),$(ZIC),./zic)
+ # but gmake versions <= 3.78.1 or perhaps later have a bug
+ # that causes a segfault;  gmake 3.81 or later fixes this.
+ ifeq (,$(ZIC))
+ ZIC= ./zic
+ endif
+
  zic: $(ZICOBJS)
      $(CC) $(CFLAGS) $(ZICOBJS) $(LDFLAGS) $(LIBS) -o $@$(X)

  install: all installdirs
  ifeq (,$(with_system_tzdata))
!     $(ZIC) -d '$(DESTDIR)$(datadir)/timezone' -p '$(POSIXRULES)' $(TZDATAFILES)
  endif
      $(MAKE) -C tznames $@


pgsql-hackers by date:

Previous
From: KaiGai Kohei
Date:
Subject: Re: Time to finalize patches for 8.4 beta
Next
From: "Robert Haas"
Date:
Subject: Re: QuickLZ compression algorithm (Re: Inclusion in the PostgreSQL backend for toasting rows)