NanoPi R4S Soft crashes after 25.12.4

After updating a NanoPi R4S from 24.10.5 to 25.12.4 I have been getting intermittent soft crashes on the router where I am still able to ping it, but most other functionality seems to be broken. When this happens browsing to the IP via a browser will give me "Bad Gateway" and I have had times where I was able to access SSH and times where I have not.
The one time I was able to access SSH while this was happening, I ran the "logread" command, and I recall seeing some errors about dnsmasq. I should have taken more note of this, but I was in a rush to get it fixed and didn't even take a screenshot ='(

First time I tried was via an in-place upgrade from 24.10 via attendedsysupgrade and when that wasn't working well (same symptoms), I thought maybe I had some bad packages that were getting carried through the update. I installed a fresh copy of 25.12.4 directly to the SD Card and installed ddns and sqm packages (and their luci components). It was working well for a few hours but overnight the issue happened again.

Power cycling the router seems to fix the issue until it happens again in several hours time.

Looking at the few reports in the NanoPi R4S thread on this forum, it seems like others have had no issues with 25.12.x on the device.

Not sure where to go from here in terms of troubleshooting next steps.

No issues here with my R4S.

If you are having issues with a fresh install I would suspect the SD card. Do you have another one on hand, and preferably another brand? I'd recommend trying that first is you are able.

Thanks for the tip. Using the same SD card, the issue is not present if I roll back to 24.10.x so I am a little dubious that it is an SD card issue. I'll see if I can find a spare one in the drawer somewhere to try however.

I was able to get some log entries from the kernel log while it was happening. Not quite sure what to make of it but maybe some could make sense of it?

[46821.815901] Modules linked in: pppoe ppp_async nft_fib_inet nf_flow_table_inet pppox ppp_generic nft_reject_ipv6 nft_reject_ipv4 nft_reject_inet nft_reject nft_redir nft_quota nft_numgen nft_nat nft_masq nft_log nft_limit nft_hash nft_flow_offload nft_fib_ipv6 nft_fib_ipv4 nft_fib nft_ct nft_compat nft_chain_nat nf_tables nf_nat nf_flow_table nf_conntrack iptable_mangle iptable_filter ipt_REJECT ipt_ECN ip_tables xt_time xt_tcpudp xt_tcpmss xt_statistic xt_multiport xt_mark xt_mac xt_limit xt_length xt_hl xt_ecn xt_dscp xt_comment xt_TCPMSS xt_LOG xt_HL xt_DSCP xt_CLASSIFY x_tables slhc sch_cake nfnetlink nf_reject_ipv6 nf_reject_ipv4 nf_log_syslog nf_defrag_ipv6 nf_defrag_ipv4 crc_ccitt sch_tbf sch_ingress sch_htb sch_hfsc em_u32 cls_u32 cls_route cls_matchall cls_fw cls_flow cls_basic act_skbedit act_mirred act_gact ifb r8169 gpio_button_hotplug(O)
[46821.822667] CPU: 2 UID: 0 PID: 9807 Comm: cat Tainted: G           O       6.12.87 #0
[46821.823362] Tainted: [O]=OOT_MODULE
[46821.823671] Hardware name: FriendlyElec NanoPi R4S (DT)
[46821.824131] pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[46821.824745] pc : 0xffff800080239478
[46821.825057] lr : 0xffff8000801cdfec
[46821.825367] sp : ffff80008ee6ba70
[46821.825660] x29: ffff80008ee6ba70 x28: 000000000041f000 x27: ffff80008ee6bc20
[46821.826295] x26: ffff000005796740 x25: ffff00000e7410f8 x24: 0000000000000008
[46821.826928] x23: ffff00000e741330 x22: 0000000000010000 x21: ffff80008ee6bcd0
[46821.827561] x20: 0000000010000000 x19: 0000000010001000 x18: ffff80008ee6bc88
[46821.828195] x17: 0000000000000001 x16: ffffffffffffffff x15: 0000000000000000
[46821.828827] x14: 0000000000000002 x13: 00000000000e7987 x12: 0000000000000000
[46821.829460] x11: 1fffe00000a5b821 x10: ffff80008ee6bc88 x9 : ffff0000052dc10c
[46821.830096] x8 : 0000000000000008 x7 : 0000000000400000 x6 : 0000000000000009
[46821.830732] x5 : 0000000000000020 x4 : 0000020040000000 x3 : ffff000000000000
[46821.831369] x2 : ffff8000810d25a8 x1 : 0000000000000000 x0 : 0000000000000000
[46821.832003] Call trace:
[46821.832223]  0xffff800080239478
[46821.832504]  0xffff8000801d03e0
[46821.832783]  0xffff8000801d0948
[46821.833063]  0xffff8000801d09d4
[46821.833342]  0xffff8000801db8f8
[46821.833621]  0xffff800080043254
[46821.833900]  0xffff8000800433d8
[46821.834179]  0xffff80008004ba98
[46821.834458]  0xffff80008004c2d4
[46821.834737]  0xffff80008004c348
[46821.835016]  0xffff800080022f2c
[46821.835295]  0xffff800080022fe0
[46821.835574]  0xffff800080a32560
[46821.835853]  0xffff800080a329c0
[46821.836131]  0xffff800080011558
[46821.836953] ---[ end trace 0000000000000000 ]---
[47093.549334] page: refcount:0 mapcount:-1 mapping:0000000000000000 index:0x0 pfn:0x102c9
[47093.550041] flags: 0x4(referenced|zone=0)
[47093.550406] raw: 0000000000000004 fffffdffc040b248 fffffdffc040b248 0000000000000000
[47093.551163] raw: 0000000000000000 0000000000000000 00000000fffffffe 0000000000000000
[47093.551856] page dumped because: bad pte
[47093.553932] CPU: 3 UID: 0 PID: 10498 Comm: packet_steering Tainted: G      D    O       6.12.87 #0
[47093.553946] Tainted: [D]=DIE, [O]=OOT_MODULE
[47093.553949] Hardware name: FriendlyElec NanoPi R4S (DT)
[47093.553954] Call trace:
[47093.553958]  0xffff80008001c53c
[47093.553963]  0xffff80008001c598
[47093.553967]  0xffff800080a31784
[47093.553972]  0xffff800080a317bc
[47093.553976]  0xffff8000801cda84
[47093.553980]  0xffff8000801d045c
[47093.553984]  0xffff8000801d0948
[47093.553988]  0xffff8000801d09d4
[47093.553992]  0xffff8000801db8f8
[47093.553997]  0xffff800080043254
[47093.554001]  0xffff8000800433d8
[47093.554005]  0xffff80008004ba98
[47093.554010]  0xffff80008004c2d4
[47093.554014]  0xffff80008004c348
[47093.554018]  0xffff800080022f2c
[47093.554022]  0xffff800080022fe0
[47093.554026]  0xffff800080a32560
[47093.554030]  0xffff800080a329c0
[47093.554034]  0xffff800080011558
[48710.902348] __vm_enough_memory: pid: 12322, comm: awk, bytes: 150323859456 not enough memory for the allocation
[48823.699467] Modules linked in: pppoe ppp_async nft_fib_inet nf_flow_table_inet pppox ppp_generic nft_reject_ipv6 nft_reject_ipv4 nft_reject_inet nft_reject nft_redir nft_quota nft_numgen nft_nat nft_masq nft_log nft_limit nft_hash nft_flow_offload nft_fib_ipv6 nft_fib_ipv4 nft_fib nft_ct nft_compat nft_chain_nat nf_tables nf_nat nf_flow_table nf_conntrack iptable_mangle iptable_filter ipt_REJECT ipt_ECN ip_tables xt_time xt_tcpudp xt_tcpmss xt_statistic xt_multiport xt_mark xt_mac xt_limit xt_length xt_hl xt_ecn xt_dscp xt_comment xt_TCPMSS xt_LOG xt_HL xt_DSCP xt_CLASSIFY x_tables slhc sch_cake nfnetlink nf_reject_ipv6 nf_reject_ipv4 nf_log_syslog nf_defrag_ipv6 nf_defrag_ipv4 crc_ccitt sch_tbf sch_ingress sch_htb sch_hfsc em_u32 cls_u32 cls_route cls_matchall cls_fw cls_flow cls_basic act_skbedit act_mirred act_gact ifb r8169 gpio_button_hotplug(O)
[48823.706231] CPU: 3 UID: 0 PID: 12510 Comm: date Tainted: G    B D    O       6.12.87 #0
[48823.706944] Tainted: [B]=BAD_PAGE, [D]=DIE, [O]=OOT_MODULE
[48823.707425] Hardware name: FriendlyElec NanoPi R4S (DT)
[48823.707884] pstate: 80400005 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[48823.708496] pc : 0xffff800080239478
[48823.708807] lr : 0xffff8000801cdfec
[48823.709115] sp : ffff80008ab2ba70
[48823.709408] x29: ffff80008ab2ba70 x28: 000000000041f000 x27: ffff80008ab2bc20
[48823.710043] x26: ffff000002b6d880 x25: ffff00000e7590f8 x24: 0000000000000008
[48823.710676] x23: ffff00000e759330 x22: 0000000000010000 x21: ffff80008ab2bcd0
[48823.711311] x20: 0000000010000000 x19: 0000000010001000 x18: ffff80008ab2bc88
[48823.711948] x17: 0000000000000001 x16: ffffffffffffffff x15: 0000000000000000
[48823.712584] x14: 0000000000000002 x13: 00000000000e872b x12: 0000000000000000
[48823.713220] x11: 1fffe000013e3781 x10: ffff80008ab2bc88 x9 : ffff000009f1bc0c
[48823.713857] x8 : 0000000000000008 x7 : 0000000000400000 x6 : 0000000000000009
[48823.714493] x5 : 0000000000000020 x4 : 0000020040000000 x3 : ffff000000000000
[48823.715126] x2 : ffff8000810d25a8 x1 : 0000000000000000 x0 : 0000000000000000
[48823.715759] Call trace:
[48823.715979]  0xffff800080239478
[48823.716259]  0xffff8000801d03e0
[48823.716538]  0xffff8000801d0948
[48823.716818]  0xffff8000801d09d4
[48823.717096]  0xffff8000801db8f8
[48823.717375]  0xffff800080043254
[48823.717654]  0xffff8000800433d8
[48823.717933]  0xffff80008004ba98
[48823.718212]  0xffff80008004c2d4
[48823.718491]  0xffff80008004c348
[48823.718770]  0xffff800080022f2c
[48823.719049]  0xffff800080022fe0
[48823.719328]  0xffff800080a32560
[48823.719606]  0xffff800080a329c0
[48823.719885]  0xffff800080011558
[48823.720706] ---[ end trace 0000000000000000 ]---

When I first had an R4S I had repeated issues. Helpful people on here suggested replacing the power cable and that indeed fixed it for me. Certainly it is working fine on the latest version

TBH my experience is that NanoPi R4S with OpenWrt is missing some patch. I have two R4S, and one of them fails to soft reboot since 23.05 (it worked OK with 22.03). So, since 23.05 I cannot run OpenWrt on this device anymore. See more details here.

This issue happens only with OpenWrt official. Running Armbian, DietPi, and FriendlyWrt works fine.

I spent a LOT of time trying to troubleshoot the issue (I even connected a UART), but so far I was not able to pinpoint the root cause.

At this moment I am running ImmortalWrt 25.12.0 on this unit, and it is working flawless.

Bottom line is that I believe OpenWrt is missing some patch that is impacting only some specific R4S units, and I am wondering this could be your case.

Just some wild guesses

I see packet steering mentioned so perhaps disable it and see if it helps.

Also I see gpio_button_hotplug(O) mentioned, have a look what that does

But this is a real crash

@waynea and @dsouza thanks for your experiences using the NanoPi R4S. For me it's been rock stable since the official release of OpenWRT a while back, but on 25.12.x it's the first time it's failed. Interesting to hear that on other firmware variants it's running stable.

@egc Thanks for the pointer, I will look into this further once I'm back on 25.12.x.

For now I have reverted to 24.10.7. I'll establish a baseline taking notes of any errors or warning I have on this version for a little while before trying to go back to 25.10.x. I highghly suspect it is something software related than hardware based on my experience and what others have mentioned here.