A quick update about the bisecting saga: I've used the following build for more than one hour and didn't get any crash:
2023-01-12 Add INIT_ATTR to system_init() <- This one seems good
After the next bisection step I compiled and installed the following:
2023-01-13 toolchain: Bump zlib to 1.2.13 due to 1.2.12 being withdrawn <- Got a crash here
And got a crash before the two minutes mark:
Data abort at 30062e54
FSR 0x8
(domain 0, fault 8 )
address 0x8831881d
pc: 30062e54
sp: 300d3960
bt end
Looking at the rockbox.map it seems 0x30062e54 is related to font_load_ex() as you already discovered:
0x0000000030061fdc font_get_bits
0x00000000300620d4 font_load_ex
0x0000000030062850 font_load
The only commit between 20230112 and 20230113 related to fonts it's this one:
"Avoid using buflib names for storing font paths"
https://git.rockbox.org/cgit/rockbox.git/commit/?id=879888b158376f1ea2c92dd49e0c7617d07fd5b2I'll perform some more testing later tonight.
Edit: 20130113 "Remove buflib allocation names, part one" crashes too. I've narrowed down the possible list to just 7 commits or so. The latest crash:
Data abort at 30063348
..
pc:
30063348sp:300d4040
0x00000000300632f0 lcd_setfont
0x0000000030063304
lcd_getfont0x0000000030063318 lcd_getstringsize
Edit 2: this is my current bisection range:
2023-01-13 Remove buflib allocation names, part one <-
Bad (crash < 2 minutes after booting)
2023-01-13 Avoid using buflib names for storing font paths <-
Bad (crash < 2 minutes after booting)
2023-01-13 keyboard.c make editline respect current UI font <-
Bad (crash after 30-40 mins, pc 3006241c, font_get)
2023-01-12 add chunk_alloc to playlist.c #2
2023-01-12 [BugFix] playlist.c DIRCACHE stop scanning when changing indices <-
Good (no crash after 1+ hour)
2023-01-12 Fix red in 7e5fc4076a
2023-01-12 Add INIT_ATTR to i2c_init()
2023-01-12 Add INIT_ATTR to system_init() <-
Good (no crash after 1h+ hour)
The pc on my latest crash (2023-01-13 keyboard.c make editline respect current UI font) is 3006241c:
0x00000000300623f8 font_get
0x0000000030062458 font_get_width
0x0000000030062514 font_get_bits
However I have the strong impression that the latest crash may be caused by the font_filename or chunk_alloc() bugs that you've fixed in your last commits, as it happened after at least 30 minutes from booting, instead of after just a few minutes like with the later builds. The issue that still hasn't been fixed gets triggered in just a few minutes on my device.
I will test "2023-01-13 Avoid using buflib names for storing font paths" and see how long does it take to crash, as I believe the latest crash isn't related to the issue that remains undiscovered. (It crashes after a few minutes).