32-bit Lazarus/main built by current FPC/main crashes at startup with access violation

Summary

When the 32-bit Lazarus/IDE (main branch, commit 41eed87a55afc9c421ddcede764cd715f3487a1e ) is built by the current FPC main branch and started for the first time, it crashes with an access violation. The stack-trace is

TApplication.HandleException: EAccessViolation
Access violation
  Stack trace:
  $007AB1CA  TBASEVIRTUALTREE__DESTROY,  line 12479 of laz.virtualtrees.pas
  $007D1860  TCUSTOMVIRTUALSTRINGTREE__DESTROY,  line 34129 of laz.virtualtrees.pas
  $007D07A8  TCUSTOMVIRTUALSTRINGTREE__CREATE,  line 33557 of laz.virtualtrees.pas
  $004A5F9D
  $004A639A
  $004A06FB
  $004A7855
  $005270FC  INITCOMPONENT,  line 3152 of lresources.pp
  $00526EF7  INITLAZRESOURCECOMPONENT,  line 3179 of lresources.pp
  $00522715  INITRESOURCECOMPONENT,  line 805 of lresources.pp
  $0043C828  TCUSTOMFORM__PROCESSRESOURCE,  line 2035 of ./include/customform.inc
  $0043C771  TCUSTOMFORM__CREATE,  line 2023 of ./include/customform.inc
  $0043EDD7  TFORM__CREATE,  line 3222 of ./include/customform.inc
  $013F41D5  TBREAKPOINTSDLG__CREATE,  line 580 of breakpointsdlg.pp
  $012B1D35  TDEBUGMANAGER__VIEWDEBUGDIALOG,  line 1851 of debugmanager.pas
  $012B450C  TDEBUGMANAGER__CREATEDEBUGDIALOG,  line 2548 of debugmanager.pas
  $011A967E  CREATEDEBUGDIALOG,  line 143 of debuggerdlg.pp

System Information

  • Operating system: Windows 11
  • Processor architecture: x86-64
  • Compiler version: FPC/main (commit 0d5dddfc)
  • Device: Computer

Steps to reproduce

My FPC build script uses the options -dDEBUG -gl -gw3. Lazarus is clean-built from the IDE menu as "Normal IDE". When, after building, the IDE restarts, the above-mentioned access voilation is observed.

Observations

Repeating the same steps for a 64-bit IDE no crash is observed.

Since the units mentioned in the Lazarus stack tracke have not been changed recently I bisected the FPC commits and found that the issue first appears with commit 8c5a48da "Make compilerwidestring a class using dyn array, rework tstringconstnode: value_str -> valueas, valuews" by Michael Van Canneyt.