# Illegal instruction: 4 (core dumped)



## varnie (Oct 26, 2009)

greetings.

could you please help me with the problem i am facing: a few days ago Code::Blocks IDE 8.02 started to crash leaving the nasty logs in the console:

```
...
Process terminated with status 1 (0 minutes, 3 seconds)
5 errors, 0 warnings
Reparsing saved files...
[B]Illegal instruction: 4 (core dumped)[/B]
```

is this a bug related to FreeBSD internals/hardware or just a Code::Blocks one? i am using codeblocks-8.02_3 from portstree.
my freebsd box is FreeBSD 7.2-RELEASE-p4 with the default GENERIC kernel.

or, maybe, it is gcc related issue? (just guessing)

thanks for any comments.


----------



## tbyte (Oct 27, 2009)

I'm not familiar with codeblocks but the error suggests that You are/have compiled some binary which is for different CPU than You are running it on.
Say You have binary which is compiled with flags CPUTYPE=p4 and the compilers adds instructions which P4 and newer and You try to run that binary on P3 - You'll get SIGILL (Illegal instruction).


----------



## varnie (Oct 27, 2009)

tbyte, thanks for comments.

well, it occurs even when i just use codeblocks (when i don't click "compile" button in it). that's strange..


----------



## tbyte (Oct 27, 2009)

What flags did You use to compile codeblocks or was it a binary package ?
It may be of course some binary library that codeblocks is using too


----------



## varnie (Oct 27, 2009)

i've built it from the portstree : /usr/ports/devel/codeblocks using make && make install && make clean. nothing special.
my /etc/make.conf is as follows:


> PERL_VERSION_=5.8.9


seems ok.


----------



## tbyte (Oct 27, 2009)

Paste dmesg, I want to see what exactly generates SIGILL.


----------



## varnie (Oct 27, 2009)

here it is, part one:

```
Copyright (c) 1992-2009 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 7.2-RELEASE-p4 #0: Sat Oct 10 04:13:17 YEKST 2009
    [email]xxxx@xxx.yyy[/email]:/usr/obj/usr/src/sys/GENERIC
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Intel(R) Core(TM)2 CPU          6600  @ 2.40GHz (2400.01-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0x6f6  Stepping = 6
  Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
  Features2=0xe3bd<SSE3,DTES64,MON,DS_CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM>
  AMD Features=0x20100000<NX,LM>
  AMD Features2=0x1<LAHF>
  Cores per package: 2
real memory  = 1073348608 (1023 MB)
avail memory = 1024069632 (976 MB)
ACPI APIC Table: <A M I  OEMAPIC >
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
 cpu0 (BSP): APIC ID:  0
 cpu1 (AP): APIC ID:  1
ioapic0 <Version 2.0> irqs 0-23 on motherboard
kbd1 at kbdmux0
acpi0: <A M I OEMRSDT> on motherboard
acpi0: [ITHREAD]
acpi0: Power Button (fixed)
acpi0: reservation of 0, a0000 (3) failed
acpi0: reservation of 100000, 3ff00000 (3) failed
Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x808-0x80b on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
pcib1: <ACPI PCI-PCI bridge> irq 16 at device 1.0 on pci0
pci1: <ACPI PCI bus> on pcib1
vgapci0: <VGA-compatible display> port 0x8c00-0x8c7f mem 0xfd000000-0xfdffffff,0xc0000000-0xcfffffff,0xfc000000-0xfcffffff irq 16 at device 0.0 on pci1
nvidia0: <GeForce 7900 GS> on vgapci0
vgapci0: child nvidia0 requested pci_enable_busmaster
vgapci0: child nvidia0 requested pci_enable_io
vgapci0: child nvidia0 requested pci_enable_io
nvidia0: [GIANT-LOCKED]
nvidia0: [ITHREAD]
uhci0: <Intel 82801H (ICH8) USB controller USB-D> port 0xdc00-0xdc1f irq 16 at device 26.0 on pci0
uhci0: [GIANT-LOCKED]
uhci0: [ITHREAD]
usb0: <Intel 82801H (ICH8) USB controller USB-D> on uhci0
usb0: USB revision 1.0
uhub0: <Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1> on usb0
uhub0: 2 ports with 2 removable, self powered
uhci1: <Intel 82801H (ICH8) USB controller USB-E> port 0xe000-0xe01f irq 17 at device 26.1 on pci0
uhci1: [GIANT-LOCKED]
uhci1: [ITHREAD]
usb1: <Intel 82801H (ICH8) USB controller USB-E> on uhci1
usb1: USB revision 1.0
uhub1: <Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1> on usb1
uhub1: 2 ports with 2 removable, self powered
ehci0: <Intel 82801H (ICH8) USB 2.0 controller USB2-B> mem 0xfebffc00-0xfebfffff irq 18 at device 26.7 on pci0
ehci0: [GIANT-LOCKED]
ehci0: [ITHREAD]
usb2: waiting for BIOS to give up control
usb2: EHCI version 1.0
usb2: companion controllers, 2 ports each: usb0 usb1
usb2: <Intel 82801H (ICH8) USB 2.0 controller USB2-B> on ehci0
usb2: USB revision 2.0
uhub2: <Intel EHCI root hub, class 9/0, rev 2.00/1.00, addr 1> on usb2
uhub2: 4 ports with 4 removable, self powered
pci0: <multimedia, HDA> at device 27.0 (no driver attached)
pcib2: <ACPI PCI-PCI bridge> irq 16 at device 28.0 on pci0
pci4: <ACPI PCI bus> on pcib2
pcib3: <ACPI PCI-PCI bridge> irq 16 at device 28.4 on pci0
pci3: <ACPI PCI bus> on pcib3
atapci0: <JMicron JMB363 SATA300 controller> port 0xac00-0xac07,0xa880-0xa883,0xa800-0xa807,0xa480-0xa483,0xa400-0xa40f mem 0xfe9fe000-0xfe9fffff irq 16 at device 0.0 on pci3
atapci0: [ITHREAD]
atapci0: AHCI called from vendor specific driver
atapci0: AHCI Version 01.00 controller with 2 ports detected
ata2: <ATA channel 0> on atapci0
ata2: [ITHREAD]
ata3: <ATA channel 1> on atapci0
ata3: [ITHREAD]
ata4: <ATA channel 2> on atapci0
ata4: [ITHREAD]
```


----------



## varnie (Oct 27, 2009)

and the part two:

```
pcib4: <ACPI PCI-PCI bridge> irq 17 at device 28.5 on pci0
pci2: <ACPI PCI bus> on pcib4
mskc0: <Marvell Yukon 88E8056 Gigabit Ethernet> port 0x9800-0x98ff mem 0xfe8fc000-0xfe8fffff irq 17 at device 0.0 on pci2
msk0: <Marvell Technology Group Ltd. Yukon EC Ultra Id 0xb4 Rev 0x02> on mskc0
msk0: Ethernet address: 00:18:f3:76:48:29
miibus0: <MII bus> on msk0
e1000phy0: <Marvell 88E1149 Gigabit PHY> PHY 0 on miibus0
e1000phy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseTX-FDX, auto
mskc0: [FILTER]
uhci2: <Intel 82801H (ICH8) USB controller USB-A> port 0xd480-0xd49f irq 23 at device 29.0 on pci0
uhci2: [GIANT-LOCKED]
uhci2: [ITHREAD]
usb3: <Intel 82801H (ICH8) USB controller USB-A> on uhci2
usb3: USB revision 1.0
uhub3: <Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1> on usb3
uhub3: 2 ports with 2 removable, self powered
uhci3: <Intel 82801H (ICH8) USB controller USB-B> port 0xd800-0xd81f irq 19 at device 29.1 on pci0
uhci3: [GIANT-LOCKED]
uhci3: [ITHREAD]
usb4: <Intel 82801H (ICH8) USB controller USB-B> on uhci3
usb4: USB revision 1.0
uhub4: <Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1> on usb4
uhub4: 2 ports with 2 removable, self powered
uhci4: <Intel 82801H (ICH8) USB controller USB-C> port 0xd880-0xd89f irq 18 at device 29.2 on pci0
uhci4: [GIANT-LOCKED]
uhci4: [ITHREAD]
usb5: <Intel 82801H (ICH8) USB controller USB-C> on uhci4
usb5: USB revision 1.0
uhub5: <Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1> on usb5
uhub5: 2 ports with 2 removable, self powered
ehci1: <Intel 82801H (ICH8) USB 2.0 controller USB2-A> mem 0xfebff800-0xfebffbff irq 23 at device 29.7 on pci0
ehci1: [GIANT-LOCKED]
ehci1: [ITHREAD]
usb6: EHCI version 1.0
usb6: companion controllers, 2 ports each: usb3 usb4 usb5
usb6: <Intel 82801H (ICH8) USB 2.0 controller USB2-A> on ehci1
usb6: USB revision 2.0
uhub6: <Intel EHCI root hub, class 9/0, rev 2.00/1.00, addr 1> on usb6
uhub6: 6 ports with 6 removable, self powered
pcib5: <ACPI PCI-PCI bridge> at device 30.0 on pci0
pci5: <ACPI PCI bus> on pcib5
pcm0: <Creative EMU10K1> port 0xb880-0xb89f irq 23 at device 2.0 on pci5
pcm0: <SigmaTel STAC9708/11 AC97 Codec>
pcm0: [ITHREAD]
fwohci0: <Texas Instruments TSB43AB22/A> mem 0xfeaff800-0xfeafffff,0xfeaf8000-0xfeafbfff irq 21 at device 3.0 on pci5
fwohci0: [FILTER]
fwohci0: OHCI version 1.10 (ROM=1)
fwohci0: No. of Isochronous channels is 4.
fwohci0: EUI64 00:11:d8:00:00:e8:68:4a
fwohci0: Phy 1394a available S400, 2 ports.
fwohci0: Link S400, max_rec 2048 bytes.
firewire0: <IEEE1394(FireWire) bus> on fwohci0
fwe0: <Ethernet over FireWire> on firewire0
if_fwe0: Fake Ethernet address: 02:11:d8:e8:68:4a
fwe0: Ethernet address: 02:11:d8:e8:68:4a
fwip0: <IP over FireWire> on firewire0
fwip0: Firewire address: 00:11:d8:00:00:e8:68:4a @ 0xfffe00000000, S400, maxrec 2048
sbp0: <SBP-2/SCSI over FireWire> on firewire0
dcons_crom0: <dcons configuration ROM> on firewire0
dcons_crom0: bus_addr 0x3ed20000
fwohci0: Initiate bus reset
fwohci0: BUS reset
fwohci0: node_id=0xc800ffc0, gen=1, CYCLEMASTER mode
skc0: <Marvell Gigabit Ethernet> port 0xb400-0xb4ff mem 0xfeaf4000-0xfeaf7fff irq 19 at device 4.0 on pci5
skc0: Marvell Yukon Lite Gigabit Ethernet rev. (0x9)
sk0: <Marvell Semiconductor, Inc. Yukon> on skc0
sk0: Ethernet address: 00:18:f3:76:34:e0
miibus1: <MII bus> on sk0
e1000phy1: <Marvell 88E1011 Gigabit PHY> PHY 0 on miibus1
e1000phy1:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseTX-FDX, auto
skc0: [ITHREAD]
isab0: <PCI-ISA bridge> at device 31.0 on pci0
isa0: <ISA bus> on isab0
atapci1: <Intel ICH8 SATA300 controller> port 0xec00-0xec07,0xe880-0xe883,0xe800-0xe807,0xe480-0xe483,0xe400-0xe40f,0xe080-0xe08f irq 19 at device 31.2 on pci0
atapci1: [ITHREAD]
ata5: <ATA channel 0> on atapci1
ata5: [ITHREAD]
ata6: <ATA channel 1> on atapci1
ata6: [ITHREAD]
pci0: <serial bus, SMBus> at device 31.3 (no driver attached)
atapci2: <Intel ICH8 SATA300 controller> port 0xd400-0xd407,0xd080-0xd083,0xd000-0xd007,0xcc00-0xcc03,0xc880-0xc88f,0xc800-0xc80f irq 19 at device 31.5 on pci0
atapci2: [ITHREAD]
ata7: <ATA channel 0> on atapci2
ata7: [ITHREAD]
ata8: <ATA channel 1> on atapci2
ata8: [ITHREAD]
acpi_button0: <Power Button> on acpi0
sio0: configured irq 4 not in bitmap of probed irqs 0
sio0: port may not be enabled
sio0: configured irq 4 not in bitmap of probed irqs 0
sio0: port may not be enabled
sio0: <16550A-compatible COM port> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
sio0: type 16550A
sio0: [FILTER]
fdc0: <floppy drive controller (FDE)> port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on acpi0
fdc0: [FILTER]
cpu0: <ACPI CPU> on acpi0
ACPI Warning (tbutils-0243): Incorrect checksum in table [SSDT] -  60, should be 67 [20070320]
ACPI Warning (tbutils-0243): Incorrect checksum in table [OEMB] -  E1, should be D8 [20070320]
coretemp0: <CPU On-Die Thermal Sensors> on cpu0
est0: <Enhanced SpeedStep Frequency Control> on cpu0
p4tcc0: <CPU Frequency Thermal Control> on cpu0
cpu1: <ACPI CPU> on acpi0
coretemp1: <CPU On-Die Thermal Sensors> on cpu1
est1: <Enhanced SpeedStep Frequency Control> on cpu1
p4tcc1: <CPU Frequency Thermal Control> on cpu1
pmtimer0 on isa0
orm0: <ISA Option ROM> at iomem 0xc0000-0xcdfff pnpid ORM0000 on isa0
ata0 at port 0x1f0-0x1f7,0x3f6 irq 14 on isa0
ata0: [ITHREAD]
ata1 at port 0x170-0x177,0x376 irq 15 on isa0
ata1: [ITHREAD]
atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
atkbd0: [ITHREAD]
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: [GIANT-LOCKED]
psm0: [ITHREAD]
psm0: model IntelliMouse Explorer, device ID 4
ppc0: parallel port not found.
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
sio1: configured irq 3 not in bitmap of probed irqs 0
sio1: port may not be enabled
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
ukbd0: <Logitech USB Receiver, class 0/0, rev 1.10/38.10, addr 2> on uhub3
kbd2 at ukbd0
ums0: <Logitech USB Receiver, class 0/0, rev 1.10/38.10, addr 2> on uhub3
ums0: 8 buttons and Z dir.
Timecounters tick every 1.000 msec
firewire0: 1 nodes, maxhop <= 0, cable IRM = 0 (me)
firewire0: bus manager 0 (me)
acd0: DVDR <NEC DVD RW ND-3550A/1.05> at ata4-master UDMA33
ad16: 476940MB <WDC WD5000AAKS-00A7B0 01.03B01> at ata8-master SATA300
GEOM_LABEL: Label for provider ad16s2 is ufsid/4a47b9de1730863b.
GEOM_LABEL: Label for provider ad16s1a is ufsid/4a6c5b51dd1a5c06.
GEOM_LABEL: Label for provider ad16s1d is ufsid/4a6c5b52cdf93441.
GEOM_LABEL: Label for provider ad16s1e is ufsid/4a6c5b51ba0fc04b.
GEOM_LABEL: Label for provider ad16s1f is ufsid/4a6c5b512802079e.
SMP: AP CPU #1 Launched!
Trying to mount root from ufs:/dev/ad16s1a
GEOM_LABEL: Label ufsid/4a6c5b51dd1a5c06 removed.
GEOM_LABEL: Label for provider ad16s1a is ufsid/4a6c5b51dd1a5c06.
GEOM_LABEL: Label ufsid/4a6c5b51ba0fc04b removed.
GEOM_LABEL: Label for provider ad16s1e is ufsid/4a6c5b51ba0fc04b.
GEOM_LABEL: Label ufsid/4a6c5b512802079e removed.
GEOM_LABEL: Label for provider ad16s1f is ufsid/4a6c5b512802079e.
GEOM_LABEL: Label ufsid/4a6c5b52cdf93441 removed.
GEOM_LABEL: Label for provider ad16s1d is ufsid/4a6c5b52cdf93441.
GEOM_LABEL: Label ufsid/4a47b9de1730863b removed.
GEOM_LABEL: Label for provider ad16s2 is ufsid/4a47b9de1730863b.
GEOM_LABEL: Label ufsid/4a6c5b51dd1a5c06 removed.
GEOM_LABEL: Label ufsid/4a6c5b51ba0fc04b removed.
GEOM_LABEL: Label ufsid/4a6c5b512802079e removed.
GEOM_LABEL: Label ufsid/4a6c5b52cdf93441 removed.
GEOM_LABEL: Label ufsid/4a47b9de1730863b removed.
pid 1201 (codeblocks), uid 1001: exited on signal 4 (core dumped)
```


----------



## tbyte (Oct 27, 2009)

I needed just 'pid 1201 (codeblocks), uid 1001: exited on signal 4 (core dumped)' 
It looks like it's compiled for different CPU or at least some library that codeblocks is using. Did You install anything on your system via pkg_add or from an install disk or binary package ?


----------



## varnie (Oct 27, 2009)

hmm.. i've installed Xorg and the other base stuff from an install disk, yes. but that's all.

btw, the codeblocks worked fine until i started my C++ project with new boost::spirit library (including a lots of C++ metaprogramming sources). and it seems it gets core-dumped only when i am using that project opened in it.


----------



## tbyte (Oct 28, 2009)

varnie said:
			
		

> hmm.. i've installed Xorg and the other base stuff from an install disk, yes. but that's all.


That's a lot 
Best way to solve it is to rebuild all the libraries used by codeblocks. And even better way is not to use packages at all


----------



## varnie (Oct 29, 2009)

have rebuilt all the dependencies of codeblocks, but no luck.


----------

