ports/169519: [net/cvsup] socksify and cvsup cannot be used together

Rudolf Polzer rpolzer at one-it.de
Thu Jun 28 13:40:11 UTC 2012


>Number:         169519
>Category:       ports
>Synopsis:       [net/cvsup] socksify and cvsup cannot be used together
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 28 13:40:10 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Rudolf Polzer
>Release:        7.4-RELEASE
>Organization:
@one IT GmbH
>Environment:
FreeBSD balogin.ba.vftest.net 7.4-RELEASE FreeBSD 7.4-RELEASE #0: Thu Dec 23 18:31:48 CET 2010     root at balogin.tnd.lab.arcor.de:/usr/obj/usr/src/sys/DL380DNS  i386
>Description:
socksify and cvsup cannot be used together. Attempting to do it yields SIGSEGV or SIGILL.

I would probably need further information to track this down better.

When having caught the issue in gdb, "print socksfd" shows sane info, but performing the bzero call or an equivalent memset call crashes. A memset call of 1 bytes at the beginning also crashes, while writing via normal assignments does not crash.
>How-To-Repeat:
balogin# [~] socksify gdb --args cvsup /dat/cvsup/mysupfile @M3novm
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...(no debugging symbols found)...
(gdb) run
Starting program: /usr/local/bin/cvsup /dat/cvsup/mysupfile @M3novm
[New LWP 100357]
[New Thread 0x8122000 (LWP 100357)]
Connected to perseus.tndlab.arcor.de

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x8122000 (LWP 100357)]
udpsetup (s=5, to=0x0, type=1) at ../lib/udp.c:394
394	   bzero(&socksfd, sizeof(socksfd));
(gdb) bt
#0  udpsetup (s=5, to=0x0, type=1) at ../lib/udp.c:394
#1  0x88139f48 in Rsendto (s=5, msg=0x813f00c, len=8, flags=0, _to=0x0, tolen=0) at ../lib/udp.c:92
#2  0x8811b297 in Rsendmsg (s=5, msg=0x81f8cec, flags=0) at ../lib/Rcompat.c:163
#3  0x8811b3c3 in Rsend (s=5, msg=0x813f00c, len=8, flags=0) at ../lib/Rcompat.c:118
#4  0x8811b438 in Rwrite (d=5, buf=0x813f00c, nbytes=8) at ../lib/Rcompat.c:74
#5  0x88117d29 in write (d=5, buf=0x813f00c, nbytes=8) at interposition.c:1721
#6  0x08098153 in fnmatch ()
#7  0x08099473 in fnmatch ()
#8  0x080a4e7e in fnmatch ()
#9  0x0806dfaa in ?? ()
#10 0x0813b404 in ?? ()
#11 0x00004000 in ?? ()
#12 0x081f8f14 in ?? ()
#13 0x00000005 in ?? ()
#14 0x00004000 in ?? ()
#15 0x00000005 in ?? ()
#16 0x081f8f9c in ?? ()
#17 0x0806c30e in ?? ()
#18 0x081426bc in ?? ()
#19 0x00000000 in ?? ()


Here an attempt by me to track it down without much success:


balogin# [~] socksify gdb --args cvsup /dat/cvsup/mysupfile @M3novm
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...(no debugging symbols found)...
(gdb) run
Starting program: /usr/local/bin/cvsup /dat/cvsup/mysupfile @M3novm
[New LWP 100189]
[New Thread 0x8122000 (LWP 100189)]
Connected to perseus.tndlab.arcor.de

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x8122000 (LWP 100189)]
udpsetup (s=5, to=0x0, type=1) at ../lib/udp.c:394
394	   bzero(&socksfd, sizeof(socksfd));
(gdb) break
Breakpoint 1 at 0x88138c5d: file ../lib/udp.c, line 394.
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/local/bin/cvsup /dat/cvsup/mysupfile @M3novm
[New LWP 100121]
[New Thread 0x8122000 (LWP 100121)]
[Switching to Thread 0x8122000 (LWP 100121)]

Breakpoint 1, udpsetup (s=6, to=0xbfbfc76c, type=1) at ../lib/udp.c:394
394	   bzero(&socksfd, sizeof(socksfd));
(gdb) c 12
Will ignore next 11 crossings of breakpoint 1.  Continuing.
Connected to perseus.tndlab.arcor.de

Program received signal SIGSEGV, Segmentation fault.
udpsetup (s=5, to=0x0, type=1) at ../lib/udp.c:394
394	   bzero(&socksfd, sizeof(socksfd));
(gdb) bt
#0  udpsetup (s=5, to=0x0, type=1) at ../lib/udp.c:394
#1  0x88139f48 in Rsendto (s=5, msg=0x813f00c, len=8, flags=0, _to=0x0, tolen=0) at ../lib/udp.c:92
#2  0x8811b297 in Rsendmsg (s=5, msg=0x81f8cec, flags=0) at ../lib/Rcompat.c:163
#3  0x8811b3c3 in Rsend (s=5, msg=0x813f00c, len=8, flags=0) at ../lib/Rcompat.c:118
#4  0x8811b438 in Rwrite (d=5, buf=0x813f00c, nbytes=8) at ../lib/Rcompat.c:74
#5  0x88117d29 in write (d=5, buf=0x813f00c, nbytes=8) at interposition.c:1721
#6  0x08098153 in fnmatch ()
#7  0x08099473 in fnmatch ()
#8  0x080a4e7e in fnmatch ()
#9  0x0806dfaa in ?? ()
#10 0x0813b404 in ?? ()
#11 0x00004000 in ?? ()
#12 0x081f8f14 in ?? ()
#13 0x00000005 in ?? ()
#14 0x00004000 in ?? ()
#15 0x00000005 in ?? ()
#16 0x081f8f9c in ?? ()
#17 0x0806c30e in ?? ()
#18 0x081426bc in ?? ()
---Type <return> to continue, or q <return> to quit---q
Quit
(gdb) print *(char*)&socksfd = 42
$1 = 42 '*'
(gdb) print ((char*)&socksfd)[sizeof(socksfd)-1] = 42
$2 = 42 '*'
(gdb) print ((char*)&socksfd)[sizeof(socksfd)-1024] = 42
$3 = 42 '*'
(gdb) print socksfd
$4 = {allocated = 42 '*', control = 0, state = {acceptpending = 0, auth = {method = 0, methodv = {0, 0, 0, 0, 0, 0}, methodc = 0, badmethodv = {0, 0, 0, 0, 0, 0}, badmethodc = 0, mdata = {uname = {
          version = 0 '\0', name = '\0' <repeats 255 times>, password = '\0' <repeats 255 times>}, gssapi = {servicename = '\0' <repeats 255 times>, keytab = '\0' <repeats 255 times>, 
          name = '\0' <repeats 255 times>, encryption = {nec = 0 '\0', clear = 0 '\0', integrity = 0 '\0', confidentiality = 0 '\0', permessage = 0 '\0'}, state = {wrap = 0, id = 0x0, maxgssdata = 0, 
            protection = 0}}}}, command = 0, err = 0, gssimportneeded = 0, gssapistate = {length = 0, value = 0x0}, gssapistatemem = '\0' <repeats 1772 times>, "*", '\0' <repeats 226 times>, inprogress = 0, 
    issyscall = 0 '\0', protocol = {tcp = 0 '\0', udp = 0 '\0'}, udpconnect = 0 '\0', syscalldepth = 0, version = 0}, local = {ss_len = 0 '\0', ss_family = 0 '\0', __ss_pad1 = "\000\000\000\000\000", 
    __ss_align = 0, __ss_pad2 = '\0' <repeats 111 times>}, server = {ss_len = 0 '\0', ss_family = 0 '\0', __ss_pad1 = "\000\000\000\000\000", __ss_align = 0, __ss_pad2 = '\0' <repeats 111 times>}, remote = {
    ss_len = 0 '\0', ss_family = 0 '\0', __ss_pad1 = "\000\000\000\000\000", __ss_align = 0, __ss_pad2 = '\0' <repeats 111 times>}, reply = {ss_len = 0 '\0', ss_family = 0 '\0', 
    __ss_pad1 = "\000\000\000\000\000", __ss_align = 0, __ss_pad2 = '\0' <repeats 111 times>}, forus = {accepted = {atype = 0 '\0', addr = {domain = '\0' <repeats 255 times>, 
        urlname = '\0' <repeats 255 times>, ifname = '\0' <repeats 254 times>, ipv4 = {s_addr = 0}, ipv6 = '\0' <repeats 15 times>}, port = 0}, connected = {atype = 0 '\0', addr = {
        domain = '\0' <repeats 255 times>, urlname = '\0' <repeats 255 times>, ifname = '\0' <repeats 254 times>, ipv4 = {s_addr = 0}, ipv6 = '\0' <repeats 15 times>}, port = 0}}, route = 0x2a000000}
(gdb) print bzero(&socksfd, sizeof(socksfd))
Cannot set lwp 100121 registers: Invalid argument

Cannot set lwp 100121 registers: Invalid argument

(gdb) print socksfd
Segmentation fault (core dumped)

>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list