core: Uncaught TypeError: Unsupported operand types: string + string
Important notices
Before you add a new report, we ask you kindly to acknowledge the following:
- I have read the contributing guide lines at https://github.com/opnsense/core/blob/master/CONTRIBUTING.md
- I am convinced that my issue is new after having checked both open and closed issues at https://github.com/opnsense/core/issues?q=is%3Aissue
Describe the bug Since upgrading to an Intel N100 SoC (Asrock N100M) the system crashes daily. Probably related to the following pfSense bug: https://redmine.pfsense.org/issues/14648 Workaround: https://redmine.pfsense.org/projects/pfsense/repository/2/revisions/aed18fb07d387c90942b729c02fe460064310f5e/diff/src/usr/local/www/includes/functions.inc.php
To Reproduce
Run OPNsense on new Intel NXXX SoC
Expected behavior
No crashes
Describe alternatives you considered
Currently testing the following changes in system.inc:103-108
$totalMem = (int) get_single_sysctl("vm.stats.vm.v_page_count");
$inactiveMem = (int) get_single_sysctl("vm.stats.vm.v_inactive_count");
$cachedMem = (int) get_single_sysctl("vm.stats.vm.v_cache_count");
$freeMem = (int) get_single_sysctl("vm.stats.vm.v_free_count");
$result['memory']['total'] = (int) get_single_sysctl('hw.physmem');
Screenshots
none
Relevant log files
System Information:
User-Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0
FreeBSD 13.2-RELEASE-p3 stable/23.7-n254818-f155405f505 SMP amd64
OPNsense 23.7.7_3 f464e1901
Plugins os-api-backup-1.1 os-bind-1.27_1 os-cache-1.0_1 os-ddclient-1.16_1 os-dmidecode-1.1_1 os-hw-probe-1.0_1 os-iperf-1.0_1 os-realtek-re-1.0 os-shadowsocks-1.0_2 os-smart-2.2_3 os-theme-cicada-1.34_3 os-theme-rebellion-1.8.9 os-theme-vicuna-1.45_1 os-tor-1.9 os-upnp-1.5_4 os-wireguard-2.4_1 os-wol-2.4_2
Time Tue, 31 Oct 2023 12:46:01 +0100
OpenSSL 1.1.1w 11 Sep 2023
Python 3.9.18
PHP 8.2.11
PHP Errors:
[31-Oct-2023 12:38:00 Europe/Berlin] PHP Fatal error: Uncaught TypeError: Unsupported operand types: string + string in /usr/local/www/widgets/api/plugins/system.inc:109
Stack trace:
#0 /usr/local/www/widgets/api/plugins/system.inc(217): system_api_kernel()
#1 /usr/local/www/widgets/api/get.php(70): system_api()
#2 {main}
thrown in /usr/local/www/widgets/api/plugins/system.inc on line 109
dmesg.boot:
Copyright (c) 1992-2021 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 13.2-RELEASE-p3 stable/23.7-n254818-f155405f505 SMP amd64
FreeBSD clang version 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc12386ae247c)
VT(vga): resolution 640x480
CPU: Intel(R) N100 (806.40-MHz K8-class CPU)
Origin="GenuineIntel" Id=0xb06e0 Family=0x6 Model=0xbe Stepping=0
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=0x7ffafbbf<SSE3,PCLMULQDQ,DTES64,MON,DS_CPL,VMX,EST,TM2,SSSE3,SDBG,FMA,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,TSCDLT,AESNI,XSAVE,OSXSAVE,AVX,F16C,RDRAND>
AMD Features=0x2c100800<SYSCALL,NX,Page1GB,RDTSCP,LM>
AMD Features2=0x121<LAHF,ABM,Prefetch>
Structured Extended Features=0x239ca7eb<FSGSBASE,TSCADJ,BMI1,AVX2,FDPEXC,SMEP,BMI2,ERMS,INVPCID,NFPUSG,PQE,RDSEED,ADX,SMAP,CLFLUSHOPT,CLWB,PROCTRACE,SHA>
Structured Extended Features2=0x98c007bc<UMIP,PKU,OSPKE,WAITPKG,GFNI,VAES,VPCLMULQDQ,RDPID,MOVDIRI,MOVDIR64B>
Structured Extended Features3=0xfc184410<FSRM,MD_CLEAR,IBT,IBPB,STIBP,L1DFL,ARCH_CAP,CORE_CAP,SSBD>
XSAVE Features=0xf<XSAVEOPT,XSAVEC,XINUSE,XSAVES>
IA32_ARCH_CAPS=0x180fd6b<RDCL_NO,IBRS_ALL,SKIP_L1DFL_VME,MDS_NO,TAA_NO>
VT-x: PAT,HLT,MTF,PAUSE,EPT,UG,VPID,VID,PostIntr
TSC: P-state invariant, performance statistics
real memory = 8589934592 (8192 MB)
avail memory = 8030289920 (7658 MB)
Event timer "LAPIC" quality 600
ACPI APIC Table: <ALASKA A M I >
WARNING: L3 data cache covers more APIC IDs than a package (7 > 3)
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
FreeBSD/SMP: 1 package(s) x 4 core(s)
random: registering fast source Intel Secure Key RNG
random: fast provider: "Intel Secure Key RNG"
random: unblocking device.
ioapic0 <Version 2.0> irqs 0-119
Launching APs: 1 3 2
wlan: mac acl policy registered
random: entropy device external interface
kbd1 at kbdmux0
WARNING: Device "spkr" is Giant locked and may be deleted before FreeBSD 14.0.
efirtc0: <EFI Realtime Clock>
efirtc0: registered as a time-of-day clock, resolution 1.000000s
smbios0: <System Management BIOS> at iomem 0x77c2a000-0x77c2a01e
smbios0: Version: 3.5, BCD Revision: 3.5
aesni0: <AES-CBC,AES-CCM,AES-GCM,AES-ICM,AES-XTS,SHA1,SHA256>
acpi0: <ALASKA A M I >
acpi0: Power Button (fixed)
hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed003ff on acpi0
Timecounter "HPET" frequency 19200000 Hz quality 950
Event timer "HPET" frequency 19200000 Hz quality 550
Event timer "HPET1" frequency 19200000 Hz quality 440
Event timer "HPET2" frequency 19200000 Hz quality 440
Event timer "HPET3" frequency 19200000 Hz quality 440
Event timer "HPET4" frequency 19200000 Hz quality 440
attimer0: <AT timer> port 0x40-0x43,0x50-0x53 irq 0 on acpi0
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
Timecounter "ACPI-fast" frequency 3579545 Hz quality 900
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x1808-0x180b on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
vgapci0: <VGA-compatible display> port 0x6000-0x603f mem 0x6000000000-0x6000ffffff,0x4000000000-0x400fffffff at device 2.0 on pci0
vgapci0: Boot video device
xhci0: <XHCI (generic) USB 3.0 controller> mem 0x6001110000-0x600111ffff at device 13.0 on pci0
xhci0: 32 bytes context size, 64-bit DMA
usbus0 on xhci0
usbus0: 5.0Gbps Super Speed USB v3.0
xhci1: <XHCI (generic) USB 3.0 controller> mem 0x6001100000-0x600110ffff at device 20.0 on pci0
xhci1: 32 bytes context size, 64-bit DMA
usbus1 on xhci1
usbus1: 5.0Gbps Super Speed USB v3.0
pci0: <memory, RAM> at device 20.2 (no driver attached)
pci0: <simple comms> at device 22.0 (no driver attached)
ahci0: <AHCI SATA controller> port 0x6090-0x6097,0x6080-0x6083,0x6060-0x607f mem 0x80b00000-0x80b01fff,0x80b03000-0x80b030ff,0x80b02000-0x80b027ff at device 23.0 on pci0
ahci0: AHCI v1.31 with 2 6Gbps ports, Port Multiplier not supported
ahcich0: <AHCI channel> at channel 0 on ahci0
ahcich1: <AHCI channel> at channel 1 on ahci0
pcib1: <ACPI PCI-PCI bridge> at device 28.0 on pci0
pci1: <ACPI PCI bus> on pcib1
pcib2: <ACPI PCI-PCI bridge> at device 0.0 on pci1
pci2: <ACPI PCI bus> on pcib2
pcib3: <PCI-PCI bridge> at device 2.0 on pci2
pci3: <PCI bus> on pcib3
em0: <Intel(R) PRO/1000 PT 82571EB/82571GB (Quad Copper)> port 0x4020-0x403f mem 0x809a0000-0x809bffff,0x80980000-0x8099ffff at device 0.0 on pci3
em0: EEPROM V5.10-2
em0: Using 1024 TX descriptors and 1024 RX descriptors
em0: Using an MSI interrupt
em0: Ethernet address: 00:1b:21:b1:f0:09
em0: netmap queues/slots: TX 1/1024, RX 1/1024
em1: <Intel(R) PRO/1000 PT 82571EB/82571GB (Quad Copper)> port 0x4000-0x401f mem 0x80940000-0x8095ffff,0x80920000-0x8093ffff at device 0.1 on pci3
em1: EEPROM V5.10-2
em1: Using 1024 TX descriptors and 1024 RX descriptors
em1: Using an MSI interrupt
em1: Ethernet address: 00:1b:21:b1:f0:08
em1: netmap queues/slots: TX 1/1024, RX 1/1024
pcib4: <PCI-PCI bridge> at device 4.0 on pci2
pci4: <PCI bus> on pcib4
em2: <Intel(R) PRO/1000 PT 82571EB/82571GB (Quad Copper)> port 0x3020-0x303f mem 0x808a0000-0x808bffff,0x80880000-0x8089ffff at device 0.0 on pci4
em2: EEPROM V5.10-2
em2: Using 1024 TX descriptors and 1024 RX descriptors
em2: Using an MSI interrupt
em2: Ethernet address: 00:1b:21:b1:f0:0b
em2: netmap queues/slots: TX 1/1024, RX 1/1024
em3: <Intel(R) PRO/1000 PT 82571EB/82571GB (Quad Copper)> port 0x3000-0x301f mem 0x80840000-0x8085ffff,0x80820000-0x8083ffff at device 0.1 on pci4
em3: EEPROM V5.10-2
em3: Using 1024 TX descriptors and 1024 RX descriptors
em3: Using an MSI interrupt
em3: Ethernet address: 00:1b:21:b1:f0:0a
em3: netmap queues/slots: TX 1/1024, RX 1/1024
pcib5: <ACPI PCI-PCI bridge> at device 28.6 on pci0
pci5: <ACPI PCI bus> on pcib5
re0: <Realtek PCIe GbE Family Controller> port 0x5000-0x50ff mem 0x80a04000-0x80a04fff,0x80a00000-0x80a03fff at device 0.0 on pci5
re0: Using Memory Mapping!
re0: Using 1 MSI-X message
re0: ASPM disabled
re0: version:1.98.00
re0: Ethernet address: 9c:6b:00:26:c6:0a
This product is covered by one or more of the following patents:
US6,570,884, US6,115,776, and US6,327,625.
re0: Ethernet address: 9c:6b:00:26:c6:0a
isab0: <PCI-ISA bridge> at device 31.0 on pci0
isa0: <ISA bus> on isab0
hdac0: <Intel Alder Lake-N HDA Controller> mem 0x6001120000-0x6001123fff,0x6001000000-0x60010fffff at device 31.3 on pci0
pci0: <serial bus> at device 31.5 (no driver attached)
acpi_button0: <Sleep Button> on acpi0
cpu0: <ACPI CPU> on acpi0
acpi_button1: <Power Button> on acpi0
acpi_syscontainer0: <System Container> on acpi0
atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
atrtc0: <AT realtime clock> at port 0x70 irq 8 on isa0
atrtc0: Warning: Couldn't map I/O.
atrtc0: registered as a time-of-day clock, resolution 1.000000s
Event timer "RTC" frequency 32768 Hz quality 0
uart0: <16550 or compatible> at port 0x3f8 irq 4 flags 0x10 on isa0
uart0: console (9600,n,8,1)
hwpstate_intel0: <Intel Speed Shift> on cpu0
hwpstate_intel1: <Intel Speed Shift> on cpu1
hwpstate_intel2: <Intel Speed Shift> on cpu2
hwpstate_intel3: <Intel Speed Shift> on cpu3
Timecounter "TSC" frequency 806402445 Hz quality 1000
Timecounters tick every 1.000 msec
hdacc0: <Realtek ALC897 HDA CODEC> at cad 0 on hdac0
hdaa0: <Realtek ALC897 Audio Function Group> at nid 1 on hdacc0
pcm0: <Realtek ALC897 (Rear Analog)> at nid 20 and 24,26 on hdaa0
pcm1: <Realtek ALC897 (Front Analog)> at nid 27 and 25 on hdaa0
ada0 at ahcich0 bus 0 scbus0 target 0 lun 0
ada0: <KINGSTON SA400S37240G SBFKB1E1> ACS-3 ATA SATA 3.x device
ada0: Serial Number 50026B77823766E7
ada0: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 512bytes)
ada0: Command Queueing enabled
ada0: 228936MB (468862128 512 byte sectors)
Trying to mount root from ufs:/dev/gpt/rootfs [rw]...
ugen0.1: <Intel XHCI root HUB> at usbus0
ugen1.1: <Intel XHCI root HUB> at usbus1
uhub0WARNING: / was not properly dismounted
WARNING: /: mount pending error: blocks 8 files 0
on usbus1
uhub0: <Intel XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus1
uhub1 on usbus0
uhub1: <Intel XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0
uhub1: 3 ports with 3 removable, self powered
uhub0: 16 ports with 16 removable, self powered
ugen1.2: <Asmedia ASM107x> at usbus1
uhub2 on uhub0
uhub2: <Asmedia ASM107x, class 9/0, rev 2.10/2.00, addr 1> on usbus1
uhub2: MTT enabled
uhub2: 4 ports with 4 removable, self powered
ugen1.3: <vendor 0x05e3 USB2.0 Hub> at usbus1
uhub3 on uhub0
uhub3: <vendor 0x05e3 USB2.0 Hub, class 9/0, rev 2.00/60.52, addr 2> on usbus1
uhub3: MTT enabled
uhub3: 4 ports with 4 removable, self powered
ugen1.4: <Asmedia ASM107x> at usbus1
uhub4 on uhub0
uhub4: <Asmedia ASM107x, class 9/0, rev 3.00/2.00, addr 3> on usbus1
uhub4: 4 ports with 4 removable, self powered
Additional context
It appears to be related to the following pfsense bug: https://redmine.pfsense.org/issues/14648
Environment
Software version used and hardware type if relevant, e.g.:
OPNsense 23.7.7_3 (amd64, commit: f464e1901) Intel N100 (Board: ASROCK N100M) Network Intel® Quad NIC 82571EB/82571GB
About this issue
- Original URL
- State: closed
- Created 8 months ago
- Comments: 20 (14 by maintainers)
Commits related to this issue
- util.inc - get_single_sysctl : only return '' when value not found. for https://github.com/opnsense/core/issues/6969 — committed to opnsense/core by AdSchellevis 8 months ago
- system: refactor get_single_sysctl() while here #6969 — committed to opnsense/core by fichtner 7 months ago
I’m beginning to suspect these N100/Adler Lake things are broken by design and can only be fixed by microcode updates as discussed here https://forum.opnsense.org/index.php?topic=37055.0 (German thread) and that this in particular is just one of the friendlier side effects.
I’ve applied the patch and will report if the problem persists!
I doubt
empty($value)
is a good choice here as it will transform0
to''
. The caller knows best what value is expected. Certainly for arithmetics the caller should make sure it is dealing with integer (or possibly float) values.But I also think the kernel or harware is glitching here if it returns 0 on memory. 😉