Subject: Re: bin/8694: /usr/bin/ar segmentation faults
To: None <simons@cys.de>
From: Chris G. Demetriou <cgd@netbsd.org>
List: netbsd-bugs
Date: 10/27/1999 11:24:45
simons@cys.de writes:
>         simons@peti:/tmp$ rm -f main.c libtest.a
>         simons@peti:/tmp$ touch main.c
>         simons@peti:/tmp$ ar cr libtest.a main.c
>         Segmentation fault
> 
>         I know that this is not correct use of ar(1), but it souldn't
>         crash, nonetheless.

This problem has previously been reported in PRs 8200 and 8573.

The fix is in -current and has been pulled up to the 1.4.x branch, so
future 1.4.x releases will include it.

I suggest you apply the following patch:

Index: gnu/dist/bfd/targets.c
diff -c gnu/dist/bfd/targets.c:1.9 gnusrc/gnu/dist/bfd/targets.c:1.10
*** gnu/dist/bfd/targets.c:1.9	Sat Mar 13 14:20:49 1999
--- gnu/dist/bfd/targets.c	Mon Oct  4 11:47:33 1999
***************
*** 860,866 ****
  /* When there is an ambiguous match, bfd_check_format_matches puts the
     names of the matching targets in an array.  This variable is the maximum
     number of entries that the array could possibly need.  */
! const size_t _bfd_target_vector_entries = sizeof(bfd_target_vector)/sizeof(*bfd_target_vector);
  
  /* This array maps configuration triplets onto BFD vectors.  */
  
--- 860,866 ----
  /* When there is an ambiguous match, bfd_check_format_matches puts the
     names of the matching targets in an array.  This variable is the maximum
     number of entries that the array could possibly need.  */
! const size_t _bfd_target_vector_entries = sizeof(_bfd_target_vector)/sizeof(*_bfd_target_vector);
  
  /* This array maps configuration triplets onto BFD vectors.  */
  
to your sources, and then rebuild and reinstall gnu/lib/libbfd.  I
believe that should solve the problem for you.


When you've done that, please reply to this message (being sure to CC:
gnats-bugs@netbsd.org so the PR gets a copy of your reply appended),
telling of the result.


cgd
-- 
Chris Demetriou - cgd@netbsd.org - http://www.netbsd.org/People/Pages/cgd.html
Disclaimer: Not speaking for NetBSD, just expressing my own opinion.