NetBSD Problem Report #54348

From www@netbsd.org  Sat Jul  6 09:57:05 2019
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 390D27A13E
	for <gnats-bugs@gnats.NetBSD.org>; Sat,  6 Jul 2019 09:57:05 +0000 (UTC)
Message-Id: <20190706095703.9B9817A1D2@mollari.NetBSD.org>
Date: Sat,  6 Jul 2019 09:57:03 +0000 (UTC)
From: hiroshi-hakoyama@nagano.ac.jp
Reply-To: hiroshi-hakoyama@nagano.ac.jp
To: gnats-bugs@NetBSD.org
Subject: pkgsrc net/fetch core dumps
X-Send-Pr-Version: www-1.0

>Number:         54348
>Category:       pkg
>Synopsis:       pkgsrc net/fetch core dumps
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    joerg
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 06 10:00:01 +0000 2019
>Closed-Date:    Tue Jul 16 14:51:32 +0000 2019
>Last-Modified:  Tue Jul 16 14:51:32 +0000 2019
>Originator:     Hiroshi Hakoyama
>Release:        pkgsrc current
>Organization:
Nagano University
>Environment:
SunOS ec21 5.10 Generic_147147-26 sun4u sparc SUNW,Sun-Blade-1000
>Description:
fetch dumps core on Solaris 10.

/usr/pkg2/bin/fetch http://ftp.netbsd.org/robots.txt
Bus error (core dumped)

# pstack core 
core 'core' of 28120:   /usr/pkg2/bin/fetch http://ftp.netbsd.org/robots.txt
 000149a0 fetchXGet (34448, ffbff7b4, ffbff7d0, fefefeff, 80808080, 1010101) + 20
 00013f74 ???????? (ffbffbe0, ffbffbf6, ffbffbf5, 33418, 34448, 78)
 000200a8 main     (1, ffbffac8, 20400, 333f4, 33408, 33194) + 6e8
 00012d3c _start   (0, 0, 0, 0, 0, 0) + 5c

# pmap core 
core 'core' of 28120:   /usr/pkg2/bin/fetch http://ftp.netbsd.org/robots.txt
00010000      72K r-x--  /usr/pkg2/bin/fetch
00030000      16K rwx--  /usr/pkg2/bin/fetch
00034000       8K rwx--    [ heap ]
FF080000    1224K r-x--  /lib/libc.so.1
FF1C2000      40K rwx--  /lib/libc.so.1
FF1CC000       8K rwx--  /lib/libc.so.1
FF210000      64K r-x--  /opt/csw/lib/libgcc_s.so.1
FF22E000       8K rwx--  /opt/csw/lib/libgcc_s.so.1
FF240000       8K r-x--  /opt/csw/lib/libssp.so.0.0.0
FF250000       8K rwx--  /opt/csw/lib/libssp.so.0.0.0
FF260000      48K r-x--  /lib/libsocket.so.1
FF270000       8K r-x--  /platform/sun4u-us3/lib/libc_psr.so.1
FF278000       8K rwx-- 
FF27C000       8K rwx--  /lib/libsocket.so.1
FF280000     584K r-x--  /lib/libnsl.so.1
FF322000      40K rwx--  /lib/libnsl.so.1
FF32C000      24K rwx--  /lib/libnsl.so.1
FF340000      24K rwx-- 
FF350000       8K rwx-- 
FF360000       8K r---- 
FF370000       8K rwx-- 
FF380000       8K rw--- 
FF390000       8K rw--- 
FF3A0000     240K r-x--  /lib/ld.so.1
FF3E0000       8K rwx-- 
FF3EC000      16K rwx--  /lib/ld.so.1
FFBFE000       8K rwx--    [ stack ]
 total      2512K

# dbx /usr/pkg2/bin/fetch core
For information about new features see `help changes'
To remove this message, put `dbxenv suppress_startup_message 7.6' in your .dbxrc
Reading fetch
core file header read successfully
Reading ld.so.1
Reading libnsl.so.1
Reading libsocket.so.1
Reading libssp.so.0.0.0
Reading libc.so.1
Reading libgcc_s.so.1
Reading libc_psr.so.1
program terminated by signal BUS (invalid address alignment)
0x000149a0: fetchXGet+0x0020:   std      %g2, [%i1]
(dbx) where                                                                  
=>[1] fetchXGet(0x34448, 0xffbff7b4, 0xffbff7d0, 0xfefefeff, 0x80808080, 0x1010101), at 0x149a0 
  [2] 0x13f74(0xffbffbe0, 0xffbffbf6, 0xffbffbf5, 0x33418, 0x34448, 0x78), at 0x13f74 
  [3] main(0x1, 0xffbffac8, 0x20400, 0x333f4, 0x33408, 0x33194), at 0x200a8 

mk.conf

.ifdef BSD_PKG_MK       # begin pkgsrc settings

ABI=                    32
PKGSRC_COMPILER=        gcc
GCCBASE=                /opt/csw/gcc4

PKG_DBDIR=              /usr/pkg2/pkgdb
LOCALBASE=              /usr/pkg2
VARBASE=                /usr/pkg2/var
PKG_TOOLS_BIN=          /usr/pkg2/sbin
PKGINFODIR=             info
PKGMANDIR=              man

TOOLS_PLATFORM.install?=        /usr/pkg2/bin/bsdinstall
TOOLS_PLATFORM.awk?=            /usr/pkg2/bin/nawk
TOOLS_PLATFORM.sed?=            /usr/pkg2/bin/nbsed
TOOLS_PLATFORM.sh?=             /usr/bin/bash
# CFLAGS+=              -O2
CFLAGS+= -O3 -mcpu=ultrasparc3 -mtune=ultrasparc3
CXXFLAGS+= -O3 -mcpu=ultrasparc3 -mtune=ultrasparc3
DBG=                    # prevent DBG from adding default optimizer flags

X11_TYPE= modular
USE_INET6= no
# FETCH_USING=fetch

.endif                  # end pkgsrc settings
>How-To-Repeat:
# cd /usr/pkgsrc/bootstrap
# ./cleanup

vi bootstrap
#! /bin/sh    ->     #! /usr/bin/bash

# bash
# env CFLAGS=-O2 CC=/opt/csw/gcc4/bin/gcc GCCBASE=/opt/csw/gcc4 ./bootstrap --prefix=/usr/pkg2

# cd /usr/pkgsrc/net/fetch
# /usr/pkg2/bin/bmake install

# fetch http://ftp.netbsd.org/robots.txt
Bus error (core dumped)


>Fix:
unknown

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->joerg
Responsible-Changed-By: wiz@NetBSD.org
Responsible-Changed-When: Sat, 06 Jul 2019 10:03:55 +0000
Responsible-Changed-Why:
Over to maintainer


From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/54348: pkgsrc net/fetch core dumps
Date: Sun, 7 Jul 2019 20:24:42 +0000

 On Sat, Jul 06, 2019 at 10:00:01AM +0000, hiroshi-hakoyama@nagano.ac.jp wrote:
  > /usr/pkg2/bin/fetch http://ftp.netbsd.org/robots.txt
  > Bus error (core dumped)

 The important part here is probably not that it's Solaris but that
 it's sparc, and the code has probably done something either
 endian-dependent or that violates proper integer alignment.

 That said, I can't see anything wrong in the code paths that match the
 stack trace, so I guess one question is: does the libfetch package
 match the fetch package? I could imagine something breaking if, say,
 the libfetch package was built years ago with a different compiler,
 but even that isn't all that likely.

 It would be helpful if you (or someone who can reproduce the problem,
 perhaps on netbsd sparc) could recompile libfetch and fetch with
 debugging information and run them in the debugger to see exactly
 where the crash happens. :-|

 -- 
 David A. Holland
 dholland@netbsd.org

From: Hiroshi Hakoyama <hiroshi-hakoyama@nagano.ac.jp>
To: gnats-bugs@netbsd.org
Cc: joerg@netbsd.org,
 gnats-admin@netbsd.org,
 pkgsrc-bugs@netbsd.org
Subject: Re: pkg/54348: pkgsrc net/fetch core dumps
Date: Thu, 11 Jul 2019 20:15:36 +0900

 Dear David,

 Thank you for the reply.

 > does the libfetch package match the fetch package?
 Yes. I build fetch and libfetch after a new bootstrap.

 > The important part here is probably not that it's Solaris but that
 > it's sparc, and the code has probably done something either
 > endian-dependent or that violates proper integer alignment.

 Recently, I changed the IP address of the server from a global one to a =
 local one.
 I may break some configurations in the process.

 Hiroshi





 > 2019/07/08 5:25=E3=80=81David Holland =
 <dholland-pbugs@netbsd.org>=E3=81=AE=E3=83=A1=E3=83=BC=E3=83=AB:
 >=20
 > The following reply was made to PR pkg/54348; it has been noted by =
 GNATS.
 >=20
 > From: David Holland <dholland-pbugs@netbsd.org>
 > To: gnats-bugs@netbsd.org
 > Cc:=20
 > Subject: Re: pkg/54348: pkgsrc net/fetch core dumps
 > Date: Sun, 7 Jul 2019 20:24:42 +0000
 >=20
 > On Sat, Jul 06, 2019 at 10:00:01AM +0000, =
 hiroshi-hakoyama@nagano.ac.jp wrote:
 >> /usr/pkg2/bin/fetch http://ftp.netbsd.org/robots.txt
 >> Bus error (core dumped)
 >=20
 > The important part here is probably not that it's Solaris but that
 > it's sparc, and the code has probably done something either
 > endian-dependent or that violates proper integer alignment.
 >=20
 > That said, I can't see anything wrong in the code paths that match the
 > stack trace, so I guess one question is: does the libfetch package
 > match the fetch package? I could imagine something breaking if, say,
 > the libfetch package was built years ago with a different compiler,
 > but even that isn't all that likely.
 >=20
 > It would be helpful if you (or someone who can reproduce the problem,
 > perhaps on netbsd sparc) could recompile libfetch and fetch with
 > debugging information and run them in the debugger to see exactly
 > where the crash happens. :-|
 >=20
 > --=20
 > David A. Holland
 > dholland@netbsd.org
 >=20

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/54348: pkgsrc net/fetch core dumps
Date: Sat, 13 Jul 2019 21:17:27 +0000

 On Thu, Jul 11, 2019 at 11:20:01AM +0000, Hiroshi Hakoyama wrote:
  >  > does the libfetch package match the fetch package?
  >  Yes. I build fetch and libfetch after a new bootstrap.

 ok, then that's not the problem...

  >  > The important part here is probably not that it's Solaris but that
  >  > it's sparc, and the code has probably done something either
  >  > endian-dependent or that violates proper integer alignment.
  >  
  >  Recently, I changed the IP address of the server from a global one to a =
  >  local one.
  >  I may break some configurations in the process.

 None of the code near the stack trace looks like it should depend on
 that.

 so, for the time being at least, I don't understand... if you can
 build with debug info that's probably the best way to move forward.

 -- 
 David A. Holland
 dholland@netbsd.org

From: Hiroshi Hakoyama <hiroshi-hakoyama@nagano.ac.jp>
To: gnats-bugs@netbsd.org
Cc: joerg@netbsd.org,
 gnats-admin@netbsd.org,
 pkgsrc-bugs@netbsd.org
Subject: Re: pkg/54348: pkgsrc net/fetch core dumps
Date: Sun, 14 Jul 2019 21:09:12 +0900

 Dear David,

 > so, for the time being at least, I don't understand... if you can
 > build with debug info that's probably the best way to move forward.

 I build fetch with -g -O0.
 Please see the following gdb output. If you request me to type some =
 additional commands, I will do.

 Hiroshi


 # gdb fetch
 GNU gdb (GDB) 7.7
 Copyright (C) 2014 Free Software Foundation, Inc.
 License GPLv3+: GNU GPL version 3 or later =
 <http://gnu.org/licenses/gpl.html>
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.  Type "show =
 copying"
 and "show warranty" for details.
 This GDB was configured as "sparc-sun-solaris2.10".
 Type "show configuration" for configuration details.
 For bug reporting instructions, please see:
 <http://www.gnu.org/software/gdb/bugs/>.
 Find the GDB manual and other documentation resources online at:
 <http://www.gnu.org/software/gdb/documentation/>.
 For help, type "help".
 Type "apropos word" to search for commands related to "word"...
 Reading symbols from fetch...(no debugging symbols found)=E2=80=A6done.

 (gdb) run =
 https://ftp.netbsd.org/pub/pkgsrc/distfiles/libunistring-0.9.10.tar.gz
 Starting program: /usr/pkg/bin/fetch =
 https://ftp.netbsd.org/pub/pkgsrc/distfiles/libunistring-0.9.10.tar.gz
 [Thread debugging using libthread_db enabled]
 [New Thread 1 (LWP 1)]

 Program received signal SIGSEGV, Segmentation fault.
 [Switching to Thread 1 (LWP 1)]
 0x0001660c in fetchXGet ()

 (gdb) break main
 Breakpoint 1 at 0x156ec

 (gdb) next
 Single stepping until exit from function fetchXGet,
 which has no line number information.
 procfs: couldn't find pid -1 in procinfo list.



 > 2019/07/14 6:20=E3=80=81David Holland =
 <dholland-pbugs@netbsd.org>=E3=81=AE=E3=83=A1=E3=83=BC=E3=83=AB:
 >=20
 > The following reply was made to PR pkg/54348; it has been noted by =
 GNATS.
 >=20
 > From: David Holland <dholland-pbugs@netbsd.org>
 > To: gnats-bugs@netbsd.org
 > Cc:=20
 > Subject: Re: pkg/54348: pkgsrc net/fetch core dumps
 > Date: Sat, 13 Jul 2019 21:17:27 +0000
 >=20
 > On Thu, Jul 11, 2019 at 11:20:01AM +0000, Hiroshi Hakoyama wrote:
 >>> does the libfetch package match the fetch package?
 >> Yes. I build fetch and libfetch after a new bootstrap.
 >=20
 > ok, then that's not the problem...
 >=20
 >>> The important part here is probably not that it's Solaris but that
 >>> it's sparc, and the code has probably done something either
 >>> endian-dependent or that violates proper integer alignment.
 >>=20
 >> Recently, I changed the IP address of the server from a global one to =
 a =3D
 >> local one.
 >> I may break some configurations in the process.
 >=20
 > None of the code near the stack trace looks like it should depend on
 > that.
 >=20
 > so, for the time being at least, I don't understand... if you can
 > build with debug info that's probably the best way to move forward.
 >=20
 > --=20
 > David A. Holland
 > dholland@netbsd.org
 >=20

From: Joerg Sonnenberger <joerg@bec.de>
To: gnats-bugs@netbsd.org
Cc: joerg@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org,
	hiroshi-hakoyama@nagano.ac.jp
Subject: Re: pkg/54348: pkgsrc net/fetch core dumps
Date: Sun, 14 Jul 2019 23:04:14 +0200

 On Sun, Jul 14, 2019 at 12:10:01PM +0000, Hiroshi Hakoyama wrote:
 >  I build fetch with -g -O0.

 You need to rebuild both fetch and libfetch for it to give useful data.

 Joerg

From: =?utf-8?B?566x5bGx5rSL?= <hiroshi-hakoyama@nagano.ac.jp>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/54348: pkgsrc net/fetch core dumps
Date: Mon, 15 Jul 2019 07:58:50 +0900

 Dear Joerg,

 Yes, I did.

 Hiroshi

 2019/07/15 6:05=E3=80=81Joerg Sonnenberger <joerg@bec.de>=E3=81=AE=E3=83=A1=E3=
 =83=BC=E3=83=AB:

 > The following reply was made to PR pkg/54348; it has been noted by GNATS.
 >=20
 > From: Joerg Sonnenberger <joerg@bec.de>
 > To: gnats-bugs@netbsd.org
 > Cc: joerg@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org,
 >    hiroshi-hakoyama@nagano.ac.jp
 > Subject: Re: pkg/54348: pkgsrc net/fetch core dumps
 > Date: Sun, 14 Jul 2019 23:04:14 +0200
 >=20
 >> On Sun, Jul 14, 2019 at 12:10:01PM +0000, Hiroshi Hakoyama wrote:
 >> I build fetch with -g -O0.
 >=20
 > You need to rebuild both fetch and libfetch for it to give useful data.
 >=20
 > Joerg
 >=20

From: coypu@sdf.org
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/54348: pkgsrc net/fetch core dumps
Date: Mon, 15 Jul 2019 05:04:11 +0000

 pkgsrc will normally strip binaries, INSTALL_UNSTRIPPED=yes disables it.

From: Hiroshi Hakoyama <hiroshi-hakoyama@nagano.ac.jp>
To: gnats-bugs@netbsd.org
Cc: joerg@netbsd.org,
 gnats-admin@netbsd.org,
 pkgsrc-bugs@netbsd.org,
 coypu@sdf.org
Subject: Re: pkg/54348: pkgsrc net/fetch core dumps
Date: Tue, 16 Jul 2019 19:47:16 +0900

 Dear coypu,

 I found that OpenCSW provides gcc 5.5 for Solaris 10.=20
 I installed gcc 5.5 (csw) instead of gcc 4.9.4 (pkgsrc) as a pkgsrc =
 compiler; As I reported in previous reports, devel/gdb and lang/gcc5 in =
 pkgsrc fail to build on Solaris 10.=20
 I built libfetch and fetch with CFLAGS+=3D -g -O0 and =
 INSTALL_UNSTRIPPED=3Dyes in mk.conf.

 The /opt/csw/bin/gdb seems to be functional in this case. Please find =
 the following output.


 Hiroshi


 # /opt/csw/bin/gdb /usr/pkg2/bin/fetch
 GNU gdb (GDB) 7.7
 Copyright (C) 2014 Free Software Foundation, Inc.
 License GPLv3+: GNU GPL version 3 or later =
 <http://gnu.org/licenses/gpl.html>
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.  Type "show =
 copying"
 and "show warranty" for details.
 This GDB was configured as "sparc-sun-solaris2.10".
 Type "show configuration" for configuration details.
 For bug reporting instructions, please see:
 <http://www.gnu.org/software/gdb/bugs/>.
 Find the GDB manual and other documentation resources online at:
 <http://www.gnu.org/software/gdb/documentation/>.
 For help, type "help".
 Type "apropos word" to search for commands related to "word"...
 Reading symbols from /usr/pkg2/bin/fetch=E2=80=A6done.

 (gdb) run https://ftp.netbsd.org/robots.txt
 Starting program: /usr/pkg2/bin/fetch https://ftp.netbsd.org/robots.txt
 [Thread debugging using libthread_db enabled]
 [New Thread 1 (LWP 1)]

 Program received signal SIGSEGV, Segmentation fault.
 [Switching to Thread 1 (LWP 1)]
 0x000164a8 in fetchXGet (URL=3D0x3a888, us=3D0xffbff794, =
 flags=3D0xffbff7b0 "")
     at fetch.c:85
 85                      us->size =3D -1;

 (gdb) info threads
   Id   Target Id         Frame=20
 * 2    Thread 1 (LWP 1)  0x000164a8 in fetchXGet (URL=3D0x3a888, =
 us=3D0xffbff794,=20
     flags=3D0xffbff7b0 "") at fetch.c:85
   1    LWP    1          0x000164a8 in fetchXGet (URL=3D0x3a888, =
 us=3D0xffbff794,=20
     flags=3D0xffbff7b0 "") at fetch.c:85

 (gdb) thread apply all backtrace

 Thread 2 (Thread 1 (LWP 1)):
 #0  0x000164a8 in fetchXGet (URL=3D0x3a888, us=3D0xffbff794, =
 flags=3D0xffbff7b0 "")
     at fetch.c:85
 #1  0x00014454 in fetch (URL=3D0xffbffbe0 =
 "https://ftp.netbsd.org/robots.txt",=20
     path=3D0xffbffbf7 "robots.txt") at fetch.c:534
 #2  0x0001616c in main (argc=3D1, argv=3D0xffbffac0) at fetch.c:1046

 Thread 1 (LWP    1        ):
 #0  0x000164a8 in fetchXGet (URL=3D0x3a888, us=3D0xffbff794, =
 flags=3D0xffbff7b0 "")
     at fetch.c:85
 #1  0x00014454 in fetch (URL=3D0xffbffbe0 =
 "https://ftp.netbsd.org/robots.txt",=20
     path=3D0xffbffbf7 "robots.txt") at fetch.c:534
 #2  0x0001616c in main (argc=3D1, argv=3D0xffbffac0) at fetch.c:1046

 (gdb) info registers
 g0             0x0      0
 g1             0xffbff794       -4196460
 g2             0xffffffff       -1
 g3             0xffffffff       -1
 g4             0x0      0
 g5             0x0      0
 g6             0x0      0
 g7             0xff342a00       -13358592
 o0             0x394c0  234688
 o1             0x0      0
 o2             0x0      0
 o3             0x0      0
 o4             0x0      0
 o5             0x0      0
 sp             0xffbff680       0xffbff680
 o7             0xff0a3cd0       -16106288
 l0             0x0      0
 l1             0x0      0
 l2             0x0      0
 l3             0x0      0
 l4             0x0      0
 l5             0x0      0
 l6             0x0      0
 ---Type <return> to continue, or q <return> to quit---=20
 l7             0x0      0
 i0             0x3a888  239752
 i1             0xffbff794       -4196460
 i2             0xffbff7b0       -4196432
 i3             0x73000000       1929379840
 i4             0x80808080       -2139062144
 i5             0x1010101        16843009
 fp             0xffbff6e0       0xffbff6e0
 i7             0x1444c  83020
 y              0x0      0
 psr            0xff000080       [ S #24 #25 #26 #27 #28 #29 #30 #31 ]
 wim            <unavailable>
 tbr            <unavailable>
 pc             0x164a8  0x164a8 <fetchXGet+44>
 npc            0x164ac  0x164ac <fetchXGet+48>
 fsr            0x0      [ ]
 csr            <unavailable>

 (gdb) continue
 Continuing.
 procfs: couldn't find pid -1 in procinfo list.

 (gdb) quit
 A debugging session is active.

         Inferior 1 [process 5792    ] will be killed.

 Quit anyway? (y or n) y





 > 2019/07/15 14:05=E3=80=81coypu@sdf.org=E3=81=AE=E3=83=A1=E3=83=BC=E3=83=AB=
 :
 >=20
 > The following reply was made to PR pkg/54348; it has been noted by =
 GNATS.
 >=20
 > From: coypu@sdf.org
 > To: gnats-bugs@netbsd.org
 > Cc:=20
 > Subject: Re: pkg/54348: pkgsrc net/fetch core dumps
 > Date: Mon, 15 Jul 2019 05:04:11 +0000
 >=20
 > pkgsrc will normally strip binaries, INSTALL_UNSTRIPPED=3Dyes disables =
 it.
 >=20

From: Jonathan Perkin <jperkin@joyent.com>
To: Hiroshi Hakoyama <hiroshi-hakoyama@nagano.ac.jp>
Cc: gnats-bugs@netbsd.org, joerg@netbsd.org, gnats-admin@netbsd.org,
	pkgsrc-bugs@netbsd.org, coypu@sdf.org
Subject: Re: pkg/54348: pkgsrc net/fetch core dumps
Date: Tue, 16 Jul 2019 12:16:59 +0100

 Hi,

 Please could you try the following diff:

 Index: fetch/files/Makefile.in
 ===================================================================
 RCS file: /cvsroot/pkgsrc/net/fetch/files/Makefile.in,v
 retrieving revision 1.2
 diff -u -r1.2 Makefile.in
 --- fetch/files/Makefile.in	5 Dec 2011 22:54:22 -0000	1.2
 +++ fetch/files/Makefile.in	16 Jul 2019 11:15:46 -0000
 @@ -5,5 +5,6 @@
  PROG=		fetch
  LDADD+=		-lfetch @LIBS@
  CPPFLAGS+=	-DHAVE_CONFIG_H
 +CPPFLAGS+=	-D_LARGEFILE_SOURCE -D_LARGE_FILES -D_FILE_OFFSET_BITS=64

  .include <bsd.prog.mk>

 Thanks,

 -- 
 Jonathan Perkin  -  Joyent, Inc.  -  www.joyent.com

From: Hiroshi Hakoyama <hiroshi-hakoyama@nagano.ac.jp>
To: gnats-bugs@netbsd.org,
 Jonathan Perkin <jperkin@joyent.com>
Cc: joerg@netbsd.org,
 gnats-admin@netbsd.org,
 pkgsrc-bugs@netbsd.org
Subject: Re: pkg/54348: pkgsrc net/fetch core dumps
Date: Tue, 16 Jul 2019 21:55:52 +0900

 Dear Jonathan,

 Thank you for your patch.
 The patch fixed the problem!

 # /usr/pkg2/bin/fetch ftp://ftp.netbsd.org/robots.txt=20
 robots.txt                                    100% of   77  B   61 kBps


 Hiroshi


 > 2019/07/16 20:20=E3=80=81Jonathan Perkin =
 <jperkin@joyent.com>=E3=81=AE=E3=83=A1=E3=83=BC=E3=83=AB:
 >=20
 > The following reply was made to PR pkg/54348; it has been noted by =
 GNATS.
 >=20
 > From: Jonathan Perkin <jperkin@joyent.com>
 > To: Hiroshi Hakoyama <hiroshi-hakoyama@nagano.ac.jp>
 > Cc: gnats-bugs@netbsd.org, joerg@netbsd.org, gnats-admin@netbsd.org,
 > 	pkgsrc-bugs@netbsd.org, coypu@sdf.org
 > Subject: Re: pkg/54348: pkgsrc net/fetch core dumps
 > Date: Tue, 16 Jul 2019 12:16:59 +0100
 >=20
 > Hi,
 >=20
 > Please could you try the following diff:
 >=20
 > Index: fetch/files/Makefile.in
 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 > RCS file: /cvsroot/pkgsrc/net/fetch/files/Makefile.in,v
 > retrieving revision 1.2
 > diff -u -r1.2 Makefile.in
 > --- fetch/files/Makefile.in	5 Dec 2011 22:54:22 -0000	1.2
 > +++ fetch/files/Makefile.in	16 Jul 2019 11:15:46 -0000
 > @@ -5,5 +5,6 @@
 >  PROG=3D		fetch
 >  LDADD+=3D		-lfetch @LIBS@
 >  CPPFLAGS+=3D	-DHAVE_CONFIG_H
 > +CPPFLAGS+=3D	-D_LARGEFILE_SOURCE -D_LARGE_FILES =
 -D_FILE_OFFSET_BITS=3D64
 >=20
 >  .include <bsd.prog.mk>
 >=20
 > Thanks,
 >=20
 > --=20
 > Jonathan Perkin  -  Joyent, Inc.  -  www.joyent.com
 >=20

From: "Jonathan Perkin" <jperkin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/54348 CVS commit: pkgsrc/net/fetch
Date: Tue, 16 Jul 2019 14:47:16 +0000

 Module Name:	pkgsrc
 Committed By:	jperkin
 Date:		Tue Jul 16 14:47:16 UTC 2019

 Modified Files:
 	pkgsrc/net/fetch: Makefile
 	pkgsrc/net/fetch/files: Makefile.in

 Log Message:
 fetch: Ensure the same lfcompile(5) flags are used as libfetch.

 Without this off_t can differ between the two, leading to segfaults as
 seen in PR#54348.  Bump PKGREVISION.


 To generate a diff of this commit:
 cvs rdiff -u -r1.19 -r1.20 pkgsrc/net/fetch/Makefile
 cvs rdiff -u -r1.2 -r1.3 pkgsrc/net/fetch/files/Makefile.in

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: jperkin@NetBSD.org
State-Changed-When: Tue, 16 Jul 2019 14:51:32 +0000
State-Changed-Why:
Patch committed, thanks for testing!


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.