From Bugzilla Helper: User-Agent: Mozilla/4.78 [en] (X11; U; Linux 2.4.17-0.18 i686) Description of problem: Loks like option handling isn't proper Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: $ patch -V test Segmentation fault $ patch -v patch 2.5.4 Expected Results: Not a segfault Additional info:
This boils down to the following test case: a.c: ==> char program_name[] = "patch"; <== b.c: ==> #include <stdio.h> extern char *program_name; int main () { fprintf (stderr, "%s\n", program_name); } <== which also segfaults. Jakub, is there any chance this is a compiler problem?
No, it is a common programming bug. char program_name[] = "patch"; is not equal to char *program_name = "patch"; in C, likewise extern char program_name[]; is not equal to extern char *program_name; The two must agree. in the former case program_name symbol points to 'p' letter in "patch", in the latter case program_name symbol points to a pointer which points to "patch".
Okay, thanks. Fixed package is 2.5.4-12.