Unhandled Page Faults running BSP2.8b3

Hello again.

I am testing some of our software with the 2.8b3 BSP release. And I noticed a strange error in dmesg or kern.log every time I start Java. I haven’t seen this before, so I thought I’d post here and check if anyone has any ideas where it might be coming from. I haven’t seen this before moving to 2.8b3 release. I have tested with a couple of JDK/JRE versions and all seem to cause this.

It’s doesn’t seem to affect any of the software, but an “unhanded page fault” looks like something that could create problems. I can imagine this could be an issue on Java side as well, but thought I would post here and see if anyone had a clue of what could have changed to cause this.

Aug  4 06:07:56 tegra-ubuntu kernel: [ 9454.468652] java: unhandled page fault (11) at 0xb6f35000, code 0x207
Aug  4 06:07:56 tegra-ubuntu kernel: [ 9454.468668] pgd = e2b8c000
Aug  4 06:07:56 tegra-ubuntu kernel: [ 9454.472508] [b6f35000] *pgd=9ec10003, *pmd=8c0b3003, *pte=2400000ae7ecf9e
Aug  4 06:07:56 tegra-ubuntu kernel: [ 9454.491835]
Aug  4 06:07:56 tegra-ubuntu kernel: [ 9454.491854] CPU: 0 PID: 12127 Comm: java Not tainted 3.10.40-2.8.3+g6c533d3 #1
Aug  4 06:07:56 tegra-ubuntu kernel: [ 9454.491863] task: cc0ffa40 ti: cc11e000 task.ti: cc11e000
Aug  4 06:07:56 tegra-ubuntu kernel: [ 9454.491924] PC is at 0xb426b630
Aug  4 06:07:56 tegra-ubuntu kernel: [ 9454.491932] LR is at 0xb427e394
Aug  4 06:07:56 tegra-ubuntu kernel: [ 9454.491940] pc : [<b426b630>]    lr : [<b427e394>]    psr: 60010010
Aug  4 06:07:56 tegra-ubuntu kernel: [ 9454.491940] sp : 718fdf78  ip : b6f35000  fp : 718fe058
Aug  4 06:07:56 tegra-ubuntu kernel: [ 9454.491949] r10: 71a8cc00  r9 : 71c301b0  r8 : 71a74128
Aug  4 06:07:56 tegra-ubuntu kernel: [ 9454.491956] r7 : 71c2cba7  r6 : 71c30340  r5 : 73aa7520  r4 : 00000000
Aug  4 06:07:56 tegra-ubuntu kernel: [ 9454.491963] r3 : 00000001  r2 : 0000ffff  r1 : 0000000a  r0 : 00000001
Aug  4 06:07:56 tegra-ubuntu kernel: [ 9454.491973] Flags: nZCv  IRQs on  FIQs on  Mode USER_32  ISA ARM  Segment user
Aug  4 06:07:56 tegra-ubuntu kernel: [ 9454.492021] Control: 30c5387d  Table: a2b8c000  DAC: fffffffd
Aug  4 06:07:56 tegra-ubuntu kernel: [ 9454.492031] CPU: 0 PID: 12127 Comm: java Not tainted 3.10.40-2.8.3+g6c533d3 #1
Aug  4 06:07:56 tegra-ubuntu kernel: [ 9454.492070] [<c0015488>] (unwind_backtrace+0x0/0x120) from [<c0012038>] (show_stack+0x18/0x1c)
Aug  4 06:07:56 tegra-ubuntu kernel: [ 9454.492123] [<c0012038>] (show_stack+0x18/0x1c) from [<c001cb7c>] (__do_user_fault+0x7c/0xc4)
Aug  4 06:07:56 tegra-ubuntu kernel: [ 9454.492135] [<c001cb7c>] (__do_user_fault+0x7c/0xc4) from [<c001cf24>] (do_page_fault+0x360/0x374)
Aug  4 06:07:56 tegra-ubuntu kernel: [ 9454.492147] [<c001cf24>] (do_page_fault+0x360/0x374) from [<c00083ec>] (do_DataAbort+0x34/0x98)
Aug  4 06:07:56 tegra-ubuntu kernel: [ 9454.492160] [<c00083ec>] (do_DataAbort+0x34/0x98) from [<c000e334>] (__dabt_usr+0x34/0x40)
Aug  4 06:07:56 tegra-ubuntu kernel: [ 9454.492198] Exception stack(0xcc11ffb0 to 0xcc11fff8)
Aug  4 06:07:56 tegra-ubuntu kernel: [ 9454.492206] ffa0:                                     00000001 0000000a 0000ffff 00000001
Aug  4 06:07:56 tegra-ubuntu kernel: [ 9454.492996] ffc0: 00000000 73aa7520 71c30340 71c2cba7 71a74128 71c301b0 71a8cc00 718fe058
Aug  4 06:07:56 tegra-ubuntu kernel: [ 9454.493008] ffe0: b6f35000 718fdf78 b427e394 b426b630 60010010 ffffffff

Page faults typically happens if a user space application accesses memory which is not mapped. Typically, for C programs this points to a real issue (e.g. uninitialized pointers). However, a user space application may use the virtual memory system for optimization and handle a page fault accordingly. The Java HotSpot VM seems to use page faults to optimize the garbage collector. The article Garbage collection in the HotSpot JVM explains how virtual memory protection is used to optimize garbage collection.

Since 2.8 we used user_debug to enabled verbose messages when user applications crash due to an exception (see also kernel-parameters.txt). However, in the Java case those messages are really not helpful. You can disable the page fault error message by clearing bit 8 (SIGSEGV faults). The user_debug variable is part of defargs, so using user_debug=22 instead of user_debug=30 should get rid of the messages on an Apalis TK1:

env set defargs=lp0_vec=2064@0xf46ff000 core_edp_mv=1150 core_edp_ma=4000 usb_port_owner_info=3 lane_owner_info=6 emc_max_dvfs=0 pcie_aspm=off user_debug=22
env save

This makes total sense. Thanks!

You are welcome.