Bug 220462 - ar(1): while building emulators/virtualbox-ose ar(1) coredumps
Summary: ar(1): while building emulators/virtualbox-ose ar(1) coredumps
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL: https://github.com/libarchive/libarch...
Keywords: patch
Depends on:
Blocks:
 
Reported: 2017-07-04 06:39 UTC by igorr
Modified: 2017-08-14 18:06 UTC (History)
4 users (show)

See Also:
emaste: mfc-stable11?
emaste: mfc-stable10?


Attachments
ar(1) script (66.74 KB, text/plain)
2017-07-04 06:39 UTC, igorr
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description igorr 2017-07-04 06:39:02 UTC
Created attachment 184048 [details]
ar(1) script

while building virtualbox I get:

kmk: *** Waiting for unfinished jobs....                   
kmk: *** [/usr/build/usr/ports/emulators/virtualbox-ose/work/VirtualBox-5.1.22/out/freebsd.amd64/release/obj/RuntimeR3/RuntimeR3.a] Segmentation fault (core dumped)              
The failing command:         
@/usr/local/bin/kmk_redirect -rti /usr/build/usr/ports/emulators/virtualbox-ose/work/VirtualBox-5.1.22/out/freebsd.amd64/release/obj/RuntimeR3/RuntimeR3.a.ar-script -- ar -M 

igorr:~>lldb -c ar.core /usr/bin/ar                        
(lldb) target create "/usr/bin/ar" --core "ar.core"        
Core file '/usr/home/igorr/ar.core' (x86_64) was loaded.   
(lldb) bt                    
* thread #1, name = 'ar', stop reason = signal SIGSEGV     
  * frame #0: 0x00000000004a9d90 ar`memchr + 16            
    frame #1: 0x0000000000445959 ar`strstr + 1081          
    frame #2: 0x000000000040662b ar`archive_write_ar_header + 2075                                                     
    frame #3: 0x0000000000409a13 ar`_archive_write_header + 259                                                        
    frame #4: ar`write_archive [inlined] write_objs(bsdar=<unavailable>) at write.c:717                                
    frame #5: ar`write_archive(bsdar=0x00007fffffffe7f0, mode=<unavailable>) at write.c:535                            
    frame #6: ar`yyparse [inlined] arscp_addmod(list=0x0000000800d65010) at acpyacc.y:382                              
    frame #7: ar`yyparse at acpyacc.y:170                  
    frame #8: ar`ar_mode_script(ar=<unavailable>) at acpyacc.y:653                                                     
    frame #9: ar`main(argc=0, argv=0x00007fffffffe920) at ar.c:310                                                     
    frame #10: 0x000000000040035f ar`_start + 383          
(lldb)                       

I have attached RuntimeBldProg.a.ar-script
Comment 1 igorr 2017-07-04 06:40:21 UTC
Additional info: 
FreeBSD igorr 12.0-CURRENT FreeBSD 12.0-CURRENT #0 d1caaa93000(master): Mon Jul  3 19:54:58 MSK 2017     igorr@igorr:/usr/obj/usr/src/sys/IGORR  amd64
Comment 2 igorr 2017-07-04 09:47:45 UTC
ar(1) from 11-STABLE allowed me build virtualbox-ose
Comment 3 Steve Wills freebsd_committer freebsd_triage 2017-07-04 22:12:37 UTC
Just as another data point, I'm seeing this as well, on r320472.
Comment 4 Ed Maste freebsd_committer freebsd_triage 2017-07-21 11:53:54 UTC
Proposed fix in https://reviews.freebsd.org/D11687
Comment 5 igorr 2017-07-26 06:33:13 UTC
With patch I can build VirtualBox without errors.
Comment 6 Ed Maste freebsd_committer freebsd_triage 2017-08-03 10:12:44 UTC
Fix committed in r321674
https://reviews.freebsd.org/rS321674
Comment 7 commit-hook freebsd_committer freebsd_triage 2017-08-04 23:35:32 UTC
A commit references this bug:

Author: mm
Date: Fri Aug  4 23:34:25 UTC 2017
New revision: 322071
URL: https://svnweb.freebsd.org/changeset/base/322071

Log:
  MFH r321674:
  Sync libarchive with vendor.

  Relevant vendor changes:
    PR #926: ensure ar strtab is null terminated

  PR:	220462

Changes:
_U  stable/11/
  stable/11/contrib/libarchive/libarchive/archive_cryptor_private.h
  stable/11/contrib/libarchive/libarchive/archive_write_set_format_ar.c
Comment 8 commit-hook freebsd_committer freebsd_triage 2017-08-04 23:35:43 UTC
A commit references this bug:

Author: mm
Date: Fri Aug  4 23:34:40 UTC 2017
New revision: 322072
URL: https://svnweb.freebsd.org/changeset/base/322072

Log:
  MFH r321674:
  Sync libarchive with vendor.

  Relevant vendor changes:
    PR #926: ensure ar strtab is null terminated

  PR:	220462

Changes:
_U  stable/10/
  stable/10/contrib/libarchive/libarchive/archive_cryptor_private.h
  stable/10/contrib/libarchive/libarchive/archive_write_set_format_ar.c
Comment 9 Ed Maste freebsd_committer freebsd_triage 2017-08-14 18:06:19 UTC
Fixed in r321674 and has now been merged to stable/11 and stable/10 (although the bug would not be experienced on other than -current).