strange patch bug @ stable/8 ?

Dmitry Morozovsky marck at rinet.ru
Sat Sep 5 11:15:51 UTC 2009


Dear colleagues,

on fresh RELENG_8/amd64 (lang/php5 distfile required):

Script started on Sat Sep  5 15:09:18 2009
marck at hamster:~/ports/patch-bug> tar xjf /usr/ports/distfiles/php-5.2.10.tar.bz2
marck at hamster:~/ports/patch-bug> fetch 'http://php-fpm.org/downloads/php-5.2.10-fpm-0.5.13.diff.gz'

php-5.2.10-fpm-0.5.13.diff.gz                   0% of  197 kB    0  Bps
php-5.2.10-fpm-0.5.13.diff.gz                  22% of  197 kB   52 kBps
php-5.2.10-fpm-0.5.13.diff.gz                 100% of  197 kB  143 kBps
marck at hamster:~/ports/patch-bug> gunzip php-5.2.10-fpm-0.5.13.diff.gz 
marck at hamster:~/ports/patch-bug> patch --suffix .bak.orig -d php-5.2.10 --forward  -E -p1 --suffix .orig <php-5.2.10-fpm-0.5.13.diff 
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|diff -Nru php-5.2.10-vanilla/configure php-5.2.10/configure
|--- php-5.2.10-vanilla/configure	2009-06-17 05:35:22.000000000 -0700
|+++ php-5.2.10/configure	2009-07-05 23:22:46.375955783 -0700
--------------------------
Patching file configure using Plan A...
Hunk #1 succeeded at 1040.
Hunk #2 succeeded at 12434.
Hunk #3 succeeded at 12494.
Hunk #4 succeeded at 12727.
Hunk #5 succeeded at 12793.
Hunk #6 succeeded at 18966.
Hunk #7 succeeded at 109208.
Hunk #8 succeeded at 117469.
Hunk #9 succeeded at 118173.
Hunk #10 succeeded at 118227.
Hmm...Segmentation fault (core dumped)
marck at hamster:~/ports/patch-bug> gdb /usr/bin/patch php-5.2.10/patch.core 
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...
Core was generated by `patch'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libc.so.7...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0  0x00000008007184e0 in strlcpy () from /lib/libc.so.7
(gdb) bt
#0  0x00000008007184e0 in strlcpy () from /lib/libc.so.7
#1  0x0000000000404e9d in pgets (do_indent=-1 'Ъ') at /usr/src/gnu/usr.bin/patch/pch.c:1155
#2  0x0000000000405136 in intuit_diff_type () at /usr/src/gnu/usr.bin/patch/pch.c:251
#3  0x000000000040581f in there_is_another_patch () at /usr/src/gnu/usr.bin/patch/pch.c:161
#4  0x0000000000404354 in main (argc=1, argv=0x7fffffffe600) at /usr/src/gnu/usr.bin/patch/patch.c:224
(gdb) up
#1  0x0000000000404e9d in pgets (do_indent=-1 'Ъ') at /usr/src/gnu/usr.bin/patch/pch.c:1155
1155			Strlcpy(buf, line, len + 1 - skipped);
(gdb) l
1150						indent += 8 - (indent %7);
1151					else
1152						indent++;
1153				}
1154			}
1155			Strlcpy(buf, line, len + 1 - skipped);
1156		}
1157		return len;
1158	}
1159	
(gdb) p buf
$1 = 0x800902000 "diff -Nru php-5.2.10-vanilla/configure.in php-5.2.10/configure.in\n"
(gdb) p line
$2 = 0x80091938a "diff -Nru php-5.2.10-vanilla/configure.in php-5.2.10/configure.in\n--- php-5.2.10-vanilla/configure.in\t2009-06-17 05:22:41.000000000 -0700\n+++ php-5.2.10/configure.in\t2009-07-05 23:22:46.375955783 -070"...
(gdb) p len
$3 = 66
(gdb) p skipped
Variable "skipped" is not available.
(gdb) marck at hamster:~/ports/patch-bug> ^D
Use "exit" to leave tcsh.
marck at hamster:~/ports/patch-bug> x
exit

Script done on Sat Sep  5 15:11:25 2009

Simple patch without all agrs finishes well, so I'm puzzled.

-- 
Sincerely,
D.Marck                                     [DM5020, MCK-RIPE, DM3-RIPN]
[ FreeBSD committer:                                 marck at FreeBSD.org ]
------------------------------------------------------------------------
*** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck at rinet.ru ***
------------------------------------------------------------------------


More information about the freebsd-ports mailing list