Re: ifconfig segmentation fault

2014-05-19 Thread Giancarlo Razzolini
Em 16-05-2014 18:15, Stuart Henderson escreveu:
 Oh, static stripped binary of course... worth a try with this,
 if you have 5.5-stable sources on the system:

 cd /usr/src/sbin/ifconfig
 make obj
 make clean
 make DEBUG=-g -O0
 gdb obj/ifconfig
 [...]
Stuart,

Today I was able to debug it and here is the result. I hope it
helps. I'm posting it right now, and looking into the lines that trigger
the segfault, hopefully you'll be able to look into it too. As I
mentioned before, this isn't impeding me from using the virtualized
machines at all, it was just something I stumbled upon by accident when
I forgot to put the NONE in the hostname.if file. But, if this leads to
fixing a bug, it would be nice. Follow:

(gdb) set args em4 -inet
(gdb) run
Starting program: /usr/obj/sbin/ifconfig/ifconfig em4 -inet

Program received signal SIGSEGV, Segmentation fault.
strlcpy (dst=0x84e658 , src=0x0, siz=Variable siz is not available.
) at /usr/src/lib/libc/string/strlcpy.c:37
37  if ((*d++ = *s++) == '\0')
(gdb) bt
#0  strlcpy (dst=0x84e658 , src=0x0, siz=Variable siz is not available.
) at /usr/src/lib/libc/string/strlcpy.c:37
#1  0x004139a5 in _fillhostent (h=0x20ab94000, r=0x84e620,
buf=Variable buf is not available.
) at /usr/src/lib/libc/asr/gethostnamadr.c:72
#2  0x00413c35 in gethostbyname2 (name=Variable name is not
available.
) at /usr/src/lib/libc/asr/gethostnamadr.c:124
#3  0x0040ad63 in in_getaddr (s=0x7f7ea9ac -inet, which=1)
at /usr/src/sbin/ifconfig/ifconfig.c:4524
#4  0x00401968 in setifaddr (addr=0x7f7ea9ac -inet,
param=0) at /usr/src/sbin/ifconfig/ifconfig.c:1112
#5  0x00400afd in main (argc=1, argv=0x7f7ea890) at
/usr/src/sbin/ifconfig/ifconfig.c:738

Cheers,

-- 
Giancarlo Razzolini
GPG: 4096R/77B981BC



Re: ifconfig segmentation fault

2014-05-19 Thread Janne Johansson
at /usr/src/lib/libc/asr/gethostnamadr.c:72
#2  0x00413c35 in gethostbyname2 (name=Variable name is not
available.

Wasn't there some fix to the resolver just recently?
This seems like ifconfig as called by you tries to resolve a parameter and
dies due to that bug.



2014-05-19 17:14 GMT+02:00 Giancarlo Razzolini grazzol...@gmail.com:

 Em 16-05-2014 18:15, Stuart Henderson escreveu:
  Oh, static stripped binary of course... worth a try with this,
  if you have 5.5-stable sources on the system:
 
  cd /usr/src/sbin/ifconfig
  make obj
  make clean
  make DEBUG=-g -O0
  gdb obj/ifconfig
  [...]
 Stuart,

 Today I was able to debug it and here is the result. I hope it
 helps. I'm posting it right now, and looking into the lines that trigger
 the segfault, hopefully you'll be able to look into it too. As I
 mentioned before, this isn't impeding me from using the virtualized
 machines at all, it was just something I stumbled upon by accident when
 I forgot to put the NONE in the hostname.if file. But, if this leads to
 fixing a bug, it would be nice. Follow:

 (gdb) set args em4 -inet
 (gdb) run
 Starting program: /usr/obj/sbin/ifconfig/ifconfig em4 -inet

 Program received signal SIGSEGV, Segmentation fault.
 strlcpy (dst=0x84e658 , src=0x0, siz=Variable siz is not available.
 ) at /usr/src/lib/libc/string/strlcpy.c:37
 37  if ((*d++ = *s++) == '\0')
 (gdb) bt
 #0  strlcpy (dst=0x84e658 , src=0x0, siz=Variable siz is not available.
 ) at /usr/src/lib/libc/string/strlcpy.c:37
 #1  0x004139a5 in _fillhostent (h=0x20ab94000, r=0x84e620,
 buf=Variable buf is not available.
 ) at /usr/src/lib/libc/asr/gethostnamadr.c:72
 #2  0x00413c35 in gethostbyname2 (name=Variable name is not
 available.
 ) at /usr/src/lib/libc/asr/gethostnamadr.c:124
 #3  0x0040ad63 in in_getaddr (s=0x7f7ea9ac -inet, which=1)
 at /usr/src/sbin/ifconfig/ifconfig.c:4524
 #4  0x00401968 in setifaddr (addr=0x7f7ea9ac -inet,
 param=0) at /usr/src/sbin/ifconfig/ifconfig.c:1112
 #5  0x00400afd in main (argc=1, argv=0x7f7ea890) at
 /usr/src/sbin/ifconfig/ifconfig.c:738

 Cheers,

 --
 Giancarlo Razzolini
 GPG: 4096R/77B981BC




-- 
May the most significant bit of your life be positive.


Re: ifconfig segmentation fault

2014-05-16 Thread Kenneth Westerback
On 16 May 2014 15:00, Giancarlo Razzolini grazzol...@gmail.com wrote:
 Hi,

 I was configuring one new interface in one of my new machines, and I
 disabled ipv6 with -inet6 as I always do. But I handcrafted the
 hostname.if file and forgot to put a NONE in the broadcast address. This
 caused the ifconfig to segfault when called from the /etc/netstart
 script. For example:

 /etc/hostname.if:
 inet 1.2.3.4 255.255.255.0 -inet6

 result: ifconfig segfault.

 /etc/hostname.if:
 inet 1.2.4.5 255.255.255.0 NONE -inet6

 result: everything work as usual.

I am using 5.5 stable. Can't post the dmesg right now, but will
 do this night. I will also take a look at the core dump, see if I can
 pinpoint where are the bits responsible for the segfault.

 Cheers,

 --
 Giancarlo Razzolini
 GPG: 4096R/77B981BC


Did a quick test on amd64 -current using run0, and got 'bad value: -inet6'.

 Ken



Re: ifconfig segmentation fault

2014-05-16 Thread Giancarlo Razzolini
Em 16-05-2014 16:45, Kenneth Westerback escreveu:
 On 16 May 2014 15:00, Giancarlo Razzolini grazzol...@gmail.com wrote:
 Hi,

 I was configuring one new interface in one of my new machines, and I
 disabled ipv6 with -inet6 as I always do. But I handcrafted the
 hostname.if file and forgot to put a NONE in the broadcast address. This
 caused the ifconfig to segfault when called from the /etc/netstart
 script. For example:

 /etc/hostname.if:
 inet 1.2.3.4 255.255.255.0 -inet6

 result: ifconfig segfault.

 /etc/hostname.if:
 inet 1.2.4.5 255.255.255.0 NONE -inet6

 result: everything work as usual.

I am using 5.5 stable. Can't post the dmesg right now, but will
 do this night. I will also take a look at the core dump, see if I can
 pinpoint where are the bits responsible for the segfault.

 Cheers,

 --
 Giancarlo Razzolini
 GPG: 4096R/77B981BC

 Did a quick test on amd64 -current using run0, and got 'bad value: -inet6'.

  Ken
As I mentioned, I'm running 5.5 stable. So this might got fixed in
current, I'm taking a look at the CVS commits right now to see if it was
fixed. But, funny thing, I've managed to get another segmentation fault,
this time from command line. While trying to replicate the bug in
another machine, I've wrongly typed:

ifconfig em4 -inet

Instead of:

ifconfig em4 -inet6

The first command also caused a segfault. As promised, follows a dmesg
of one of the machines where I reproduced this segfault:

OpenBSD 5.5 (GENERIC) #0: Fri Apr 25 13:07:59 CEST 2014
   
r...@stable-55-amd64.mtier.org:/binpatchng/work-binpatch55-amd64/src/sys/arch/amd64/compile/GENERIC
real mem = 520085504 (495MB)
avail mem = 497729536 (474MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xf09f0 (10 entries)
bios0: vendor Bochs version Bochs date 01/01/2011
bios0: QEMU Standard PC (i440FX + PIIX, 1996)
acpi0 at bios0: rev 0
acpi0: sleep states S3 S4 S5
acpi0: tables DSDT FACP SSDT APIC HPET
acpi0: wakeup devices
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
acpihpet0 at acpi0: 1 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpicpu0 at acpi0
mpbios at bios0 not configured
cpu0 at mainbus0: (uniprocessor)
cpu0: QEMU Virtual CPU version 2.0.0, 2813.47 MHz
cpu0:
FPU,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SSE3,CX16,x2APIC,POPCNT,NXE,LONG,LAHF,SVM,ABM,SSE4A
cpu0: 64KB 64b/line 2-way I-cache, 64KB 64b/line 2-way D-cache, 512KB
64b/line 16-way L2 cache
cpu0: ITLB 255 4KB entries direct-mapped, 255 4MB entries direct-mapped
cpu0: DTLB 255 4KB entries direct-mapped, 255 4MB entries direct-mapped
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 Intel 82441FX rev 0x02
pcib0 at pci0 dev 1 function 0 Intel 82371SB ISA rev 0x00
pciide0 at pci0 dev 1 function 1 Intel 82371SB IDE rev 0x00: DMA,
channel 0 wired to compatibility, channel 1 wired to compatibility
wd0 at pciide0 channel 0 drive 0: QEMU HARDDISK
wd0: 16-sector PIO, LBA48, 30720MB, 62914560 sectors
wd0(pciide0:0:0): using PIO mode 4, DMA mode 2
atapiscsi0 at pciide0 channel 1 drive 0
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0: QEMU, QEMU DVD-ROM, 2.0. ATAPI 5/cdrom
removable
cd0(pciide0:1:0): using PIO mode 4, DMA mode 2
uhci0 at pci0 dev 1 function 2 Intel 82371SB USB rev 0x01: irq 11
piixpm0 at pci0 dev 1 function 3 Intel 82371AB Power rev 0x03: irq 9
iic0 at piixpm0
vga1 at pci0 dev 2 function 0 Cirrus Logic CL-GD5446 rev 0x00
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
virtio0 at pci0 dev 3 function 0 Qumranet Virtio Network rev 0x00:
Virtio Network Device
vio0 at virtio0: address 52:54:00:ab:f7:d6
virtio0: irq 11
virtio1 at pci0 dev 4 function 0 Qumranet Virtio Memory rev 0x00:
Virtio Memory Balloon Device
viomb0 at virtio1
virtio1: irq 11
virtio2 at pci0 dev 5 function 0 Qumranet Virtio Network rev 0x00:
Virtio Network Device
vio1 at virtio2: address 52:54:00:4f:65:af
virtio2: irq 10
virtio3 at pci0 dev 6 function 0 Qumranet Virtio Network rev 0x00:
Virtio Network Device
vio2 at virtio3: address 52:54:00:42:d8:ff
virtio3: irq 10
isa0 at pcib0
isadma0 at isa0
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
fd0 at fdc0 drive 1: density unknown
usb0 at uhci0: USB revision 1.0
uhub0 at usb0 Intel UHCI root hub rev 1.00/1.00 addr 1
nvram: invalid checksum
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
scsibus2 at softraid0: 256 targets
root on wd0a (ae6577d8240a3c26.a) swap on wd0b dump on wd0b
clock: unknown CMOS layout

This one is my test machine, and yes, it's virtualized. 

Re: ifconfig segmentation fault

2014-05-16 Thread Stuart Henderson
On 2014/05/16 17:12, Giancarlo Razzolini wrote:
 As I mentioned, I'm running 5.5 stable. So this might got fixed in
 current, I'm taking a look at the CVS commits right now to see if it was
 fixed. But, funny thing, I've managed to get another segmentation fault,
 this time from command line. While trying to replicate the bug in
 another machine, I've wrongly typed:
 
 ifconfig em4 -inet
 
 Instead of:
 
 ifconfig em4 -inet6

I'm unable to repeat this on amd64 5.5 release. Can you repeat it under gdb?
i.e. 'sudo gdb ifconfig' then 'set args em4 -inet' (or whatever) and 'run',
then if you can trigger it do a 'bt'.



Re: ifconfig segmentation fault

2014-05-16 Thread Luis Coronado
On my OBSD 5.5 box I cannot reproduce:

/etc/hostname.bge0
inet 192.168.2.170 255.255.255.0  -inet6

# sh /etc/netstart
bge0

ifconfig: -inet6: bad value

OpenBSD 5.5 (GENERIC.MP) #315: Wed Mar  5 09:37:46 MST 2014
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 8563326976 (8166MB)
avail mem = 8326762496 (7941MB)
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.5 @ 0xcf79c000 (58 entries)
bios0: vendor Dell Inc. version 1.4.1 date 08/03/2009
bios0: Dell Inc. PowerEdge T100
acpi0 at bios0: rev 2
acpi0: sleep states S0 S4 S5
acpi0: tables DSDT FACP APIC SPCR HPET MCFG SLIC TCPA SSDT SSDT SSDT
acpi0: wakeup devices PCI0(S5) COMP(S5)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Pentium(R) Dual CPU E2220 @ 2.40GHz, 2400.45 MHz
cpu0:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,EST,TM2,SSSE3,CX16,xTPR,PDCM,NXE,LONG,LAHF,PERF
cpu0: 1MB 64b/line 4-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
cpu0: apic clock running at 200MHz
cpu0: mwait min=64, max=64, C-substates=0.2.2.0.0, IBE
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Pentium(R) Dual CPU E2220 @ 2.40GHz, 2400.08 MHz
cpu1:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,EST,TM2,SSSE3,CX16,xTPR,PDCM,NXE,LONG,LAHF,PERF
cpu1: 1MB 64b/line 4-way L2 cache
cpu1: smt 0, core 1, package 0
ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 24 pins
ioapic0: misconfigured as apic 0, remapped to apid 2
acpihpet0 at acpi0: 14318179 Hz
acpimcfg0 at acpi0 addr 0xe000, bus 0-255
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 1 (PEX1)
acpiprt2 at acpi0: bus 2 (SBE0)
acpiprt3 at acpi0: bus 3 (SBE4)
acpiprt4 at acpi0: bus 4 (SBE5)
acpiprt5 at acpi0: bus 5 (COMP)
acpicpu0 at acpi0: PSS
acpicpu1 at acpi0: PSS
cpu0: Enhanced SpeedStep 2400 MHz: speeds: 2400, 2200, 2000, 1800, 1600,
1400, 1200 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 Intel 3200/3210 Host rev 0x01
ppb0 at pci0 dev 1 function 0 Intel 3200/3210 PCIE rev 0x01: msi
pci1 at ppb0 bus 1
uhci0 at pci0 dev 26 function 0 Intel 82801I USB rev 0x02: apic 2 int 17
uhci1 at pci0 dev 26 function 1 Intel 82801I USB rev 0x02: apic 2 int 18
ehci0 at pci0 dev 26 function 7 Intel 82801I USB rev 0x02: apic 2 int 19
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 Intel EHCI root hub rev 2.00/1.00 addr 1
ppb1 at pci0 dev 28 function 0 Intel 82801I PCIE rev 0x02: msi
pci2 at ppb1 bus 2
ppb2 at pci0 dev 28 function 4 Intel 82801I PCIE rev 0x02: msi
pci3 at ppb2 bus 3
ppb3 at pci0 dev 28 function 5 Intel 82801I PCIE rev 0x02
pci4 at ppb3 bus 4
bge0 at pci4 dev 0 function 0 Broadcom BCM5722 rev 0x00, BCM5755 C0
(0xa200): msi, address 00:23:8b:64:75:70
brgphy0 at bge0 phy 1: BCM5722 10/100/1000baseT PHY, rev. 0
uhci2 at pci0 dev 29 function 0 Intel 82801I USB rev 0x02: apic 2 int 21
uhci3 at pci0 dev 29 function 1 Intel 82801I USB rev 0x02: apic 2 int 20
uhci4 at pci0 dev 29 function 2 Intel 82801I USB rev 0x02: apic 2 int 21
ehci1 at pci0 dev 29 function 7 Intel 82801I USB rev 0x02: apic 2 int 21
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 Intel EHCI root hub rev 2.00/1.00 addr 1
ppb4 at pci0 dev 30 function 0 Intel 82801BA Hub-to-PCI rev 0x92
pci5 at ppb4 bus 5
re0 at pci5 dev 0 function 0 Realtek 8169 rev 0x10: RTL8169/8110SB
(0x1000), apic 2 int 18, address c8:3a:35:d8:bb:a5
rgephy0 at re0 phy 7: RTL8169S/8110S PHY, rev. 3
radeondrm0 at pci5 dev 5 function 0 ATI ES1000 rev 0x02
drm0 at radeondrm0
radeondrm0: apic 2 int 19
pcib0 at pci0 dev 31 function 0 Intel 82801IR LPC rev 0x02
pciide0 at pci0 dev 31 function 2 Intel 82801I SATA rev 0x02: DMA,
channel 0 configured to native-PCI, channel 1 configured to native-PCI
pciide0: using apic 2 int 23 for native-PCI interrupt
wd0 at pciide0 channel 0 drive 0: WDC WD1601ABYS-18C0A0
wd0: 16-sector PIO, LBA48, 152587MB, 31250 sectors
atapiscsi0 at pciide0 channel 0 drive 1
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0: PLDS, DVD-ROM DH-16D3S, SD11 ATAPI 5/cdrom
removable
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 6
cd0(pciide0:0:1): using PIO mode 4, Ultra-DMA mode 5
atapiscsi1 at pciide0 channel 1 drive 1
scsibus1 at atapiscsi1: 2 targets
cd1 at scsibus1 targ 0 lun 0: HL-DT-ST, DVDRAM GH22NS40, NL00 ATAPI
5/cdrom removable
cd1(pciide0:1:1): using PIO mode 4, Ultra-DMA mode 5
usb2 at uhci0: USB revision 1.0
uhub2 at usb2 Intel UHCI root hub rev 1.00/1.00 addr 1
usb3 at uhci1: USB revision 1.0
uhub3 at usb3 Intel UHCI root hub rev 1.00/1.00 addr 1
usb4 at uhci2: USB revision 1.0
uhub4 at usb4 Intel UHCI root hub rev 1.00/1.00 addr 1
usb5 at uhci3: USB revision 1.0
uhub5 at usb5 Intel UHCI root hub rev 1.00/1.00 addr 1
usb6 at uhci4: 

Re: ifconfig segmentation fault

2014-05-16 Thread Giancarlo Razzolini
Em 16-05-2014 17:18, Stuart Henderson escreveu:
 On 2014/05/16 17:12, Giancarlo Razzolini wrote:
 As I mentioned, I'm running 5.5 stable. So this might got fixed in
 current, I'm taking a look at the CVS commits right now to see if it was
 fixed. But, funny thing, I've managed to get another segmentation fault,
 this time from command line. While trying to replicate the bug in
 another machine, I've wrongly typed:

 ifconfig em4 -inet

 Instead of:

 ifconfig em4 -inet6
 I'm unable to repeat this on amd64 5.5 release. Can you repeat it under gdb?
 i.e. 'sudo gdb ifconfig' then 'set args em4 -inet' (or whatever) and 'run',
 then if you can trigger it do a 'bt'.

Yes, I was able to repeat:

(gdb) set args em4 -inet
(gdb) run
Starting program: /sbin/ifconfig em4 -inet
warning: shared library handler failed to enable breakpoint

Program received signal SIGSEGV, Segmentation fault.
0x0043607a in ?? ()
(gdb) bt
#0  0x0043607a in ?? ()
#1  0x00412835 in ?? ()
#2  0x00412ac5 in ?? ()
#3  0x00404919 in ?? ()
#4  0x0040aaba in ?? ()
#5  0x00400301 in ?? ()
#6  0x0003 in ?? ()
#7  0x7f7beb28 in ?? ()
#8  0x7f7beb37 in ?? ()
#9  0x7f7beb3b in ?? ()
#10 0x in ?? ()

Very odd. If you want I can also attach the core dump.

Cheers,

-- 
Giancarlo Razzolini
GPG: 4096R/77B981BC



Re: ifconfig segmentation fault

2014-05-16 Thread Giancarlo Razzolini
Em 16-05-2014 17:18, Stuart Henderson escreveu:
 On 2014/05/16 17:12, Giancarlo Razzolini wrote:
 As I mentioned, I'm running 5.5 stable. So this might got fixed in
 current, I'm taking a look at the CVS commits right now to see if it was
 fixed. But, funny thing, I've managed to get another segmentation fault,
 this time from command line. While trying to replicate the bug in
 another machine, I've wrongly typed:

 ifconfig em4 -inet

 Instead of:

 ifconfig em4 -inet6
 I'm unable to repeat this on amd64 5.5 release. Can you repeat it under gdb?
 i.e. 'sudo gdb ifconfig' then 'set args em4 -inet' (or whatever) and 'run',
 then if you can trigger it do a 'bt'.

Just to be thrill, here follows my sha256sum of my /sbin/ifconfig:

SHA256 (/sbin/ifconfig) =
e1b9688f2ebf5a278408c49ac13e35479a96b883ff9891ada141470d55a1b158

If anyone running stable can check it yours is the same, I appreciate.

Cheers,

-- 
Giancarlo Razzolini
GPG: 4096R/77B981BC



Re: ifconfig segmentation fault

2014-05-16 Thread Luis Coronado
# sha256
/sbin/ifconfig

SHA256 (/sbin/ifconfig) =
e1b9688f2ebf5a278408c49ac13e35479a96b883ff9891ada141470d55a1b158

and mine does not crash.

-luis



On Fri, May 16, 2014 at 2:29 PM, Giancarlo Razzolini
grazzol...@gmail.comwrote:

 Em 16-05-2014 17:18, Stuart Henderson escreveu:
  On 2014/05/16 17:12, Giancarlo Razzolini wrote:
  As I mentioned, I'm running 5.5 stable. So this might got fixed in
  current, I'm taking a look at the CVS commits right now to see if it was
  fixed. But, funny thing, I've managed to get another segmentation fault,
  this time from command line. While trying to replicate the bug in
  another machine, I've wrongly typed:
 
  ifconfig em4 -inet
 
  Instead of:
 
  ifconfig em4 -inet6
  I'm unable to repeat this on amd64 5.5 release. Can you repeat it under
 gdb?
  i.e. 'sudo gdb ifconfig' then 'set args em4 -inet' (or whatever) and
 'run',
  then if you can trigger it do a 'bt'.
 
 Just to be thrill, here follows my sha256sum of my /sbin/ifconfig:

 SHA256 (/sbin/ifconfig) =
 e1b9688f2ebf5a278408c49ac13e35479a96b883ff9891ada141470d55a1b158

 If anyone running stable can check it yours is the same, I appreciate.

 Cheers,

 --
 Giancarlo Razzolini
 GPG: 4096R/77B981BC




Re: ifconfig segmentation fault

2014-05-16 Thread Creamy
On Fri, May 16, 2014 at 05:29:10PM -0300, Giancarlo Razzolini wrote:
 Em 16-05-2014 17:18, Stuart Henderson escreveu:
  On 2014/05/16 17:12, Giancarlo Razzolini wrote:
  As I mentioned, I'm running 5.5 stable. So this might got fixed in
  current, I'm taking a look at the CVS commits right now to see if it was
  fixed. But, funny thing, I've managed to get another segmentation fault,
  this time from command line. While trying to replicate the bug in
  another machine, I've wrongly typed:
 
  ifconfig em4 -inet
 
  Instead of:
 
  ifconfig em4 -inet6
  I'm unable to repeat this on amd64 5.5 release. Can you repeat it under gdb?
  i.e. 'sudo gdb ifconfig' then 'set args em4 -inet' (or whatever) and 'run',
  then if you can trigger it do a 'bt'.
 
 Just to be thrill, here follows my sha256sum of my /sbin/ifconfig:
 
 SHA256 (/sbin/ifconfig) =
 e1b9688f2ebf5a278408c49ac13e35479a96b883ff9891ada141470d55a1b158
 
 If anyone running stable can check it yours is the same, I appreciate.

It matches -release from the official CD.

-- 
Creamy! 3



Re: ifconfig segmentation fault

2014-05-16 Thread Stuart Henderson
On 2014/05/16 17:26, Giancarlo Razzolini wrote:
 Em 16-05-2014 17:18, Stuart Henderson escreveu:
  On 2014/05/16 17:12, Giancarlo Razzolini wrote:
  As I mentioned, I'm running 5.5 stable. So this might got fixed in
  current, I'm taking a look at the CVS commits right now to see if it was
  fixed. But, funny thing, I've managed to get another segmentation fault,
  this time from command line. While trying to replicate the bug in
  another machine, I've wrongly typed:
 
  ifconfig em4 -inet
 
  Instead of:
 
  ifconfig em4 -inet6
  I'm unable to repeat this on amd64 5.5 release. Can you repeat it under gdb?
  i.e. 'sudo gdb ifconfig' then 'set args em4 -inet' (or whatever) and 'run',
  then if you can trigger it do a 'bt'.
 
 Yes, I was able to repeat:
 
 (gdb) set args em4 -inet
 (gdb) run
 Starting program: /sbin/ifconfig em4 -inet
 warning: shared library handler failed to enable breakpoint
 
 Program received signal SIGSEGV, Segmentation fault.
 0x0043607a in ?? ()
 (gdb) bt
 #0  0x0043607a in ?? ()
 #1  0x00412835 in ?? ()
 #2  0x00412ac5 in ?? ()
 #3  0x00404919 in ?? ()
 #4  0x0040aaba in ?? ()
 #5  0x00400301 in ?? ()
 #6  0x0003 in ?? ()
 #7  0x7f7beb28 in ?? ()
 #8  0x7f7beb37 in ?? ()
 #9  0x7f7beb3b in ?? ()
 #10 0x in ?? ()
 
 Very odd. If you want I can also attach the core dump.
 
 Cheers,
 
 -- 
 Giancarlo Razzolini
 GPG: 4096R/77B981BC
 

Oh, static stripped binary of course... worth a try with this,
if you have 5.5-stable sources on the system:

cd /usr/src/sbin/ifconfig
make obj
make clean
make DEBUG=-g -O0
gdb obj/ifconfig
[...]



Re: ifconfig segmentation fault

2014-05-16 Thread Giancarlo Razzolini
Em 16-05-2014 18:15, Stuart Henderson escreveu:
 On 2014/05/16 17:26, Giancarlo Razzolini wrote:
 Em 16-05-2014 17:18, Stuart Henderson escreveu:
 On 2014/05/16 17:12, Giancarlo Razzolini wrote:
 As I mentioned, I'm running 5.5 stable. So this might got fixed in
 current, I'm taking a look at the CVS commits right now to see if it was
 fixed. But, funny thing, I've managed to get another segmentation fault,
 this time from command line. While trying to replicate the bug in
 another machine, I've wrongly typed:

 ifconfig em4 -inet

 Instead of:

 ifconfig em4 -inet6
 I'm unable to repeat this on amd64 5.5 release. Can you repeat it under gdb?
 i.e. 'sudo gdb ifconfig' then 'set args em4 -inet' (or whatever) and 'run',
 then if you can trigger it do a 'bt'.

 Yes, I was able to repeat:

 (gdb) set args em4 -inet
 (gdb) run
 Starting program: /sbin/ifconfig em4 -inet
 warning: shared library handler failed to enable breakpoint

 Program received signal SIGSEGV, Segmentation fault.
 0x0043607a in ?? ()
 (gdb) bt
 #0  0x0043607a in ?? ()
 #1  0x00412835 in ?? ()
 #2  0x00412ac5 in ?? ()
 #3  0x00404919 in ?? ()
 #4  0x0040aaba in ?? ()
 #5  0x00400301 in ?? ()
 #6  0x0003 in ?? ()
 #7  0x7f7beb28 in ?? ()
 #8  0x7f7beb37 in ?? ()
 #9  0x7f7beb3b in ?? ()
 #10 0x in ?? ()

 Very odd. If you want I can also attach the core dump.

 Cheers,

 -- 
 Giancarlo Razzolini
 GPG: 4096R/77B981BC

 Oh, static stripped binary of course... worth a try with this,
 if you have 5.5-stable sources on the system:

 cd /usr/src/sbin/ifconfig
 make obj
 make clean
 make DEBUG=-g -O0
 gdb obj/ifconfig
 [...]

In this system I don't. But will do ASAP. I'm starting to believe that
this has something to do with virtualization.

Cheers,

-- 
Giancarlo Razzolini
GPG: 4096R/77B981BC



Re: ifconfig segmentation fault

2014-05-16 Thread Héctor Luis Gimbatti
/etc/hostname.if
Inet 1.2.3.4 255.255.255.0 NONE -inet6

# ksh /etc/netstart
# ifconfig 
## NO PROBLEM

/etc/hostname.if
Inet 1.2.3.4 255.255.255.0 -inet6

# ksh /etc/netstart
ifconfig: -inet6: bad value
## NO SEGMENTATION FAULT


So, IMHO, if there is any problem at all, of course it should be due to the 
''correctness'' of the line in /etc/hostname.
We should check if the parsing of such file is OK (by that I mean of course to 
check for the correctness of the values )

But AFAIK , and As Far I've tested /etc/hostname.if for different, WRONG LINES, 
it has never cause ifconfig to segfault.






Re: ifconfig segmentation fault

2014-05-16 Thread Giancarlo Razzolini
Em 16-05-2014 18:19, Héctor Luis Gimbatti escreveu:
 /etc/hostname.if
 Inet 1.2.3.4 255.255.255.0 NONE -inet6

 # ksh /etc/netstart
 # ifconfig 
 ## NO PROBLEM

 /etc/hostname.if
 Inet 1.2.3.4 255.255.255.0 -inet6

 # ksh /etc/netstart
 ifconfig: -inet6: bad value
 ## NO SEGMENTATION FAULT


 So, IMHO, if there is any problem at all, of course it should be due to the 
 ''correctness'' of the line in /etc/hostname.
 We should check if the parsing of such file is OK (by that I mean of course 
 to check for the correctness of the values )

 But AFAIK , and As Far I've tested /etc/hostname.if for different, WRONG 
 LINES, it has never cause ifconfig to segfault.




Anyone else running OpenBSD under linux kvm can test this? I was only
able to reproduce it on virtualized machines. My test on a physical one
wasn't on 5.5 and it didn't segfault, as I wrongly stated before. I was
so eager to test it, that I wasn't logged on the right machine, sorry.
Stuart, I didn't had a chance yet to recompile ifconfig following your
instructions, but I'll try to ASAP. Really seem to be something with
virtualization itself. I've tried on three OpenBSD installs that are
under kvm, and all of them segfaulted. All of them are amd64, I didn't
tried with an i386 installation.


Cheers,

-- 
Giancarlo Razzolini
GPG: 4096R/77B981BC



Re: ifconfig segmentation fault

2014-05-16 Thread sven falempin
On Fri, May 16, 2014 at 10:15 PM, Giancarlo Razzolini
grazzol...@gmail.comwrote:

 Em 16-05-2014 18:19, Héctor Luis Gimbatti escreveu:
  /etc/hostname.if
  Inet 1.2.3.4 255.255.255.0 NONE -inet6
 
  # ksh /etc/netstart
  # ifconfig
  ## NO PROBLEM
 
  /etc/hostname.if
  Inet 1.2.3.4 255.255.255.0 -inet6
 
  # ksh /etc/netstart
  ifconfig: -inet6: bad value
  ## NO SEGMENTATION FAULT
 
 
  So, IMHO, if there is any problem at all, of course it should be due to
 the ''correctness'' of the line in /etc/hostname.
  We should check if the parsing of such file is OK (by that I mean of
 course to check for the correctness of the values )
 
  But AFAIK , and As Far I've tested /etc/hostname.if for different, WRONG
 LINES, it has never cause ifconfig to segfault.
 
 
 
 
 Anyone else running OpenBSD under linux kvm can test this? I was only
 able to reproduce it on virtualized machines. My test on a physical one
 wasn't on 5.5 and it didn't segfault, as I wrongly stated before. I was
 so eager to test it, that I wasn't logged on the right machine, sorry.
 Stuart, I didn't had a chance yet to recompile ifconfig following your
 instructions, but I'll try to ASAP. Really seem to be something with
 virtualization itself. I've tried on three OpenBSD installs that are
 under kvm, and all of them segfaulted. All of them are amd64, I didn't
 tried with an i386 installation.


 Cheers,

 --
 Giancarlo Razzolini
 GPG: 4096R/77B981BC


Linux / kvm is not a precise statement enough,

for example on recent version the network can completly stop under load
(but is very fast) while older release remain stable.

What qemu version ? what (linux)kernel version ?


-- 
-
() ascii ribbon campaign - against html e-mail
/\


Re: ifconfig segmentation fault

2014-05-16 Thread Giancarlo Razzolini
Em 16-05-2014 23:48, sven falempin escreveu:



 On Fri, May 16, 2014 at 10:15 PM, Giancarlo Razzolini
 grazzol...@gmail.com mailto:grazzol...@gmail.com wrote:

 Em 16-05-2014 18:19, Héctor Luis Gimbatti escreveu:
  /etc/hostname.if
  Inet 1.2.3.4 255.255.255.0 NONE -inet6
 
  # ksh /etc/netstart
  # ifconfig
  ## NO PROBLEM
 
  /etc/hostname.if
  Inet 1.2.3.4 255.255.255.0 -inet6
 
  # ksh /etc/netstart
  ifconfig: -inet6: bad value
  ## NO SEGMENTATION FAULT
 
 
  So, IMHO, if there is any problem at all, of course it should be
 due to the ''correctness'' of the line in /etc/hostname.
  We should check if the parsing of such file is OK (by that I
 mean of course to check for the correctness of the values )
 
  But AFAIK , and As Far I've tested /etc/hostname.if for
 different, WRONG LINES, it has never cause ifconfig to segfault.
 
 
 
 
 Anyone else running OpenBSD under linux kvm can test this? I was only
 able to reproduce it on virtualized machines. My test on a
 physical one
 wasn't on 5.5 and it didn't segfault, as I wrongly stated before.
 I was
 so eager to test it, that I wasn't logged on the right machine, sorry.
 Stuart, I didn't had a chance yet to recompile ifconfig following your
 instructions, but I'll try to ASAP. Really seem to be something with
 virtualization itself. I've tried on three OpenBSD installs that are
 under kvm, and all of them segfaulted. All of them are amd64, I didn't
 tried with an i386 installation.


 Cheers,

 --
 Giancarlo Razzolini
 GPG: 4096R/77B981BC


 Linux / kvm is not a precise statement enough,

 for example on recent version the network can completly stop under
 load (but is very fast) while older release remain stable.

 What qemu version ? what (linux)kernel version ?


 -- 
 -
 () ascii ribbon campaign - against html e-mail 
 /\ 
It's a ubuntu 14.04 running kernel 3.13.0 and the qemu-kvm version is
2.0.0. I believe that on Monday I'll be able to test it more and even
compile ifconfig, as Stuart mentioned. Just to be clear, my machines
work perfectly I don't have any problems at all.


Cheers,

-- 
Giancarlo Razzolini
GPG: 4096R/77B981BC