Bug 217115

Summary: bsdiff stops with SIGBUS in some cases
Product: Base System Reporter: Armin Pirkovitsch <sperber>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Some People CC: allanjude, bapt, cperciva, fnoyanisi
Priority: --- Keywords: regression
Version: 11.1-RELEASE   
Hardware: amd64   
OS: Any   
Description Flags
files that cause the problem none

Description Armin Pirkovitsch freebsd_committer 2017-02-15 15:17:33 UTC
Created attachment 180017 [details]
files that cause the problem

On more recent CURRENT (as far as I can tell at least this year) bsdiff stops with SIGBUS when comparing the attached files by running
> bsdiff d76057a1a25b15b72ca9961d630b295316894d4ac679e54cd471b85eadf694ea acpi_hp.ko.debug outfile

> bsdiff acpi_hp.ko.debug d76057a1a25b15b72ca9961d630b295316894d4ac679e54cd471b85eadf694ea outbl
works fine.

The problem can be reproduced with r313726 and r313041 and can't be reproduced on freefall (r309137).

idwer on #bsdcode was able to reproduce the problem and provided a truss log: http://dpaste.com/2JB0GG2
Comment 1 Allan Jude freebsd_committer 2017-02-15 15:52:54 UTC
The issue is caused when trying to read an invalid pointer in matchlen()

I am still tracking down why the 'oldsize' is -6510615555427011531
Comment 2 Armin Pirkovitsch freebsd_committer 2017-10-26 09:10:13 UTC
Just tested it on 11.1 Release - same problem - 11.0 works fine.