Bug 136197

Summary: [patch] net-p2p/bnbt sha1 implementation broken for amd64 builds
Product: Ports & Packages Reporter: Chris Cowart <ccowart>
Component: Individual Port(s)Assignee: Florent Thoumie <flz>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Chris Cowart 2009-06-30 22:30:02 UTC
I built and deployed bnbt on our dev environment:

FreeBSD dev-aux.rescomp.berkeley.edu 7.1-RELEASE-p5 FreeBSD 7.1-RELEASE-p5 #0: Tue May 19 16:31:23 PDT 2009     root@dev-aux.rescomp.berkeley.edu:/usr/obj/usr/src/sys/AUX_DEV  i386

It would. I went to reproduce in our staging environment:

FreeBSD test-aux.rescomp.berkeley.edu 7.0-RELEASE-p6 FreeBSD 7.0-RELEASE-p6 #4: Tue Dec  9 22:10:55 PST 2008     root@test-aux.rescomp.berkeley.edu:/usr/obj/usr/src/sys/AUX  amd64

and it did not work. After several hours of troubleshooting, I realized that
BNBT was reporting a different info hash on amd64 builds than x86 builds
even though the clients had the same hash regardless of architecture. After
some help from Jonathan Chu <milki@rescomp.berkeley.edu>, we tracked down
the offending file, which assumed the length of longs was 32 bits. This didn't
work when building the software on an amd64 architecture.

The attached patch changes the long declarations to int, regardless of 
architecture, which is tested and working for both x86 and amd64.

Fix: Attached patch.

Patch attached with submission follows:
How-To-Repeat: Build BNBT on an amd64 box and try to load torrents.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2009-06-30 22:30:15 UTC
Responsible Changed
From-To: freebsd-ports-bugs->flz

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Florent Thoumie 2009-07-15 14:17:32 UTC
I will commit the patch, although I would recommend using another
tracker (opentracker seems to be a good candidate) as bnbt hasn't been
maintained for years.

-- 
Florent Thoumie
flz@FreeBSD.org
FreeBSD Committer
Comment 3 dfilter service freebsd_committer freebsd_triage 2009-07-15 14:44:09 UTC
flz         2009-07-15 13:43:54 UTC

  FreeBSD ports repository

  Modified files:
    net-p2p/bnbt         Makefile 
  Added files:
    net-p2p/bnbt/files   patch-sha1.cpp patch-sha1.h 
  Log:
  Fix SHA1 on 64bit architectures.
  
  PR:             ports/136197
  Submitted by:   Chris Cowart <ccowart@rescomp.berkeley.edu>
  
  Revision  Changes    Path
  1.19      +1 -0      ports/net-p2p/bnbt/Makefile
  1.1       +32 -0     ports/net-p2p/bnbt/files/patch-sha1.cpp (new)
  1.1       +31 -0     ports/net-p2p/bnbt/files/patch-sha1.h (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 4 Florent Thoumie freebsd_committer freebsd_triage 2009-07-15 14:44:17 UTC
State Changed
From-To: open->closed

Committed. Thanks!