AvaloniaUI / Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
https://avaloniaui.net
MIT License
25.77k stars 2.23k forks source link

Some controls cause "Unhandled fault: alignment exception (0x001)" on Raspberry Pi Zero 2 (DRM) #9323

Closed nixtar closed 1 year ago

nixtar commented 2 years ago

Certain controls appear to cause Avalonia to hang when running on a Raspberry Pi with 11 Preview 1,2 and 3. When you kill the app in the terminal you can see a message Unhandled fault: alignment exception (0x001) at {memory address}.

My device is a RasPi Zero 2 connected to a Pimoroni HyperPixel 2.1 Round display. Its running Raspbian GNU/Linux 10 (buster) Lite with the GL driver set to G2 GL (Fake KMS). I've tried Full KMS however the HyperPixel screen does not show any output when set to Full.

Dotnet version: 6.0.402

I used https://docs.avaloniaui.net/guides/deep-dives/running-on-raspbian-lite-via-drm to create the project as described in the guide. With Avalonia 0.10.18 I can run the app without issues on the device. With Avalonia 11 Preview 3 the app runs for about 4 seconds then hangs. If I close the app via SSH I see the text on the screen: Unhandled fault: alignment exception (0x001) at {memory address} Note that after updating to Avalonia 11, builder.StartLinuxDrm(args) becomes ambiguous and I resolved this by changing it to builder.StartLinuxDrm(args, scaling: 1)

If I remove the Slider control from the MainView.axaml then the app runs without hanging. I added an Indeterminate ProgressBar so I can see if the app is running or not and with just the TextBlock and ProgressBar it runs fine. NumericUpDown also seems to work fine.

However, TimePicker was another control that caused it to hang.

Works:

  <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="30" Spacing="30">
    <TextBlock FontSize="25">
      Welcome to Avalonia! ❤
    </TextBlock>
    <ProgressBar IsIndeterminate="True" />
    <NumericUpDown Value="10" AllowSpin="True" Increment="10"/>
  </StackPanel>

Hangs:

  <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="30" Spacing="30">
    <TextBlock FontSize="25">
      Welcome to Avalonia! ❤
    </TextBlock>
    <ProgressBar IsIndeterminate="True" />
    <TimePicker />
  </StackPanel>

Most of my testing has been done on 11 Preview 3 however I did try with the Slider control on Preview 1 ,2 and 3. 0.10.18 appears to be fine with the controls I have tested so far. I've also tested dotnet 7 RC2 quickly and it had the same issue.

I'm not a very experienced developer with *nix OS's or these kinds of IoT devices so some guidance on how best to debug this would be appreciated.

Screenshot of the physical console after the app has hung a few times: 20221102_181030

nixtar commented 2 years ago

Unsure what changed for this to happen, but I've now reproduced this issue on 11 Preview 3 with only the TextBlock and NumericUpDown control. So maybe it's a red herring that it's caused by certain controls.

Seems like the other controls such as Slider and TimePicker appear to make it happen more consistatntly. It also seems to occur a lot faster when utilising the touch screen on the Slider or TimePicker.

If I run the app with the following xaml and just leave it idle it takes a minute or so to die. But it I instantly start playing around with the time picker with the touch screen it locks up in 3-5 seconds.

<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="30" Spacing="30">
  <ProgressBar IsIndeterminate="True" />
  <TimePicker />
</StackPanel>

Again, I'm unable to fault 0.10.18.

When I get some time to play with this again, I'll try the latest CI build.

kekekeks commented 2 years ago

Do you have a stack trace from the application?

nixtar commented 2 years ago

Do you have a stack trace from the application?

No, it doesn't crash in a nice way, it just stops rendering until you kill it externally.

I managed to get a debugger attached over ssh and the dotnet side of the app appears to still be ticking along.

I can pause the app and see the following in the stack:

System.Private.CoreLib.dll!System.Threading.WaitHandle.WaitMultiple(System.ReadOnlySpan<System.Threading.WaitHandle> waitHandles, bool waitAll, int millisecondsTimeout)
System.Private.CoreLib.dll!System.Threading.WaitHandle.WaitMultiple(System.Threading.WaitHandle[] waitHandles, bool waitAll, int millisecondsTimeout)
Avalonia.Controls!Avalonia.Controls.Platform.InternalPlatformThreadingInterface.RunLoop(System.Threading.CancellationToken cancellationToken)
Avalonia.Base!Avalonia.Threading.Dispatcher.MainLoop(System.Threading.CancellationToken cancellationToken)
Avalonia.Controls!Avalonia.Controls.DesktopApplicationExtensions.Run(Avalonia.Application app, System.Threading.CancellationToken token)
Avalonia.LinuxFramebuffer!LinuxFramebufferPlatformExtensions.StartLinuxDirect<Avalonia.AppBuilder>(Avalonia.AppBuilder builder, string[] args, Avalonia.LinuxFramebuffer.Output.IOutputBackend outputBackend, Avalonia.LinuxFramebuffer.Input.IInputBackend inputBackend)
Avalonia.LinuxFramebuffer!LinuxFramebufferPlatformExtensions.StartLinuxDrm<Avalonia.AppBuilder>(Avalonia.AppBuilder builder, string[] args, string card, double scaling, Avalonia.LinuxFramebuffer.Input.IInputBackend inputBackend)
AvaloniaTest!AvaloniaTest.Program.Main(string[] args) Line 20
kekekeks commented 2 years ago

Please, show dmesg output

nixtar commented 1 year ago

Please, show dmesg output

Sorry for the delay.

Click me for dmesg output ``` [ 0.000000] Booting Linux on physical CPU 0x0 [ 0.000000] Linux version 5.10.103-v7+ (dom@buildbot) (arm-linux-gnueabihf-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1529 SMP Tue Mar 8 12:21:37 GMT 2022 [ 0.000000] CPU: ARMv7 Processor [410fd034] revision 4 (ARMv7), cr=10c5383d [ 0.000000] CPU: div instructions available: patching division code [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache [ 0.000000] OF: fdt: Machine model: Raspberry Pi Zero 2 W Rev 1.0 [ 0.000000] random: fast init done [ 0.000000] Memory policy: Data cache writealloc [ 0.000000] Reserved memory: created CMA memory pool at 0x0bc00000, size 256 MiB [ 0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool [ 0.000000] Zone ranges: [ 0.000000] DMA [mem 0x0000000000000000-0x000000001bffffff] [ 0.000000] Normal empty [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x0000000000000000-0x000000001bffffff] [ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000001bffffff] [ 0.000000] On node 0 totalpages: 114688 [ 0.000000] DMA zone: 1008 pages used for memmap [ 0.000000] DMA zone: 0 pages reserved [ 0.000000] DMA zone: 114688 pages, LIFO batch:31 [ 0.000000] percpu: Embedded 20 pages/cpu s50828 r8192 d22900 u81920 [ 0.000000] pcpu-alloc: s50828 r8192 d22900 u81920 alloc=20*4096 [ 0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 113680 [ 0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 video=Composite-1:720x480@60i,margin_left=32,margin_right=32,margin_top=32,margin_bottom=32 smsc95xx.macaddr=B8:27:EB:7B:19:BD vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000 console=ttyS0,115200 console=tty1 root=PARTUUID=71f17646-02 rootfstype=ext4 fsck.repair=yes rootwait [ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear) [ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear) [ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off [ 0.000000] Memory: 174696K/458752K available (10240K kernel code, 1312K rwdata, 2952K rodata, 1024K init, 862K bss, 21912K reserved, 262144K cma-reserved) [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1 [ 0.000000] ftrace: allocating 32081 entries in 95 pages [ 0.000000] ftrace: allocated 94 pages with 5 groups [ 0.000000] rcu: Hierarchical RCU implementation. [ 0.000000] Rude variant of Tasks RCU enabled. [ 0.000000] Tracing variant of Tasks RCU enabled. [ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies. [ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16 [ 0.000000] random: get_random_bytes called from start_kernel+0x3ac/0x580 with crng_init=1 [ 0.000000] arch_timer: cp15 timer(s) running at 19.20MHz (phys). [ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns [ 0.000007] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns [ 0.000024] Switching to timer-based delay loop, resolution 52ns [ 0.000309] Console: colour dummy device 80x30 [ 0.001144] printk: console [tty1] enabled [ 0.001213] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=192000) [ 0.001271] pid_max: default: 32768 minimum: 301 [ 0.001484] LSM: Security Framework initializing [ 0.001745] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) [ 0.001792] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) [ 0.003267] cgroup: Disabling memory control group subsystem [ 0.003560] CPU: Testing write buffer coherency: ok [ 0.004091] CPU0: thread -1, cpu 0, socket 0, mpidr 80000000 [ 0.005352] Setting up static identity map for 0x100000 - 0x10003c [ 0.005559] rcu: Hierarchical SRCU implementation. [ 0.006500] smp: Bringing up secondary CPUs ... [ 0.007692] CPU1: thread -1, cpu 1, socket 0, mpidr 80000001 [ 0.008979] CPU2: thread -1, cpu 2, socket 0, mpidr 80000002 [ 0.010309] CPU3: thread -1, cpu 3, socket 0, mpidr 80000003 [ 0.010466] smp: Brought up 1 node, 4 CPUs [ 0.010521] SMP: Total of 4 processors activated (153.60 BogoMIPS). [ 0.010552] CPU: All CPU(s) started in HYP mode. [ 0.010579] CPU: Virtualization extensions available. [ 0.011498] devtmpfs: initialized [ 0.029132] VFP support v0.3: implementor 41 architecture 3 part 40 variant 3 rev 4 [ 0.029446] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns [ 0.029508] futex hash table entries: 1024 (order: 4, 65536 bytes, linear) [ 0.040191] pinctrl core: initialized pinctrl subsystem [ 0.041413] NET: Registered protocol family 16 [ 0.045650] DMA: preallocated 1024 KiB pool for atomic coherent allocations [ 0.051422] audit: initializing netlink subsys (disabled) [ 0.052321] thermal_sys: Registered thermal governor 'step_wise' [ 0.053171] audit: type=2000 audit(0.050:1): state=initialized audit_enabled=0 res=1 [ 0.053400] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers. [ 0.053442] hw-breakpoint: maximum watchpoint size is 8 bytes. [ 0.053769] Serial: AMBA PL011 UART driver [ 0.074309] bcm2835-mbox 3f00b880.mailbox: mailbox enabled [ 0.090199] raspberrypi-firmware soc:firmware: Attached to firmware from 2021-12-01T15:07:06, variant start [ 0.100210] raspberrypi-firmware soc:firmware: Firmware hash is 71bd3109023a0c8575585ba87cbb374d2eeb038f [ 0.144200] Kprobes globally optimized [ 0.149232] bcm2835-dma 3f007000.dma: DMA legacy API manager, dmachans=0x1 [ 0.151539] SCSI subsystem initialized [ 0.151810] usbcore: registered new interface driver usbfs [ 0.151909] usbcore: registered new interface driver hub [ 0.152002] usbcore: registered new device driver usb [ 0.154013] clocksource: Switched to clocksource arch_sys_counter [ 1.871796] VFS: Disk quotas dquot_6.6.0 [ 1.871945] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes) [ 1.872172] FS-Cache: Loaded [ 1.872429] CacheFiles: Loaded [ 1.873250] simple-framebuffer 1eb17000.framebuffer: framebuffer at 0x1eb17000, 0xe1000 bytes, mapped to 0x(ptrval) [ 1.873302] simple-framebuffer 1eb17000.framebuffer: format=a8r8g8b8, mode=480x480x32, linelength=1920 [ 1.877680] Console: switching to colour frame buffer device 60x30 [ 1.886780] simple-framebuffer 1eb17000.framebuffer: fb0: simplefb registered! [ 1.901791] NET: Registered protocol family 2 [ 1.904718] IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear) [ 1.911601] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear) [ 1.917012] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear) [ 1.922452] TCP bind hash table entries: 4096 (order: 3, 32768 bytes, linear) [ 1.928006] TCP: Hash tables configured (established 4096 bind 4096) [ 1.933854] UDP hash table entries: 256 (order: 1, 8192 bytes, linear) [ 1.939755] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear) [ 1.945955] NET: Registered protocol family 1 [ 1.949779] RPC: Registered named UNIX socket transport module. [ 1.955780] RPC: Registered udp transport module. [ 1.958803] RPC: Registered tcp transport module. [ 1.961713] RPC: Registered tcp NFSv4.1 backchannel transport module. [ 1.969045] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 7 counters available [ 1.978512] Initialise system trusted keyrings [ 1.981645] workingset: timestamp_bits=14 max_order=17 bucket_order=3 [ 1.996853] zbud: loaded [ 2.001724] FS-Cache: Netfs 'nfs' registered for caching [ 2.005495] NFS: Registering the id_resolver key type [ 2.008315] Key type id_resolver registered [ 2.011029] Key type id_legacy registered [ 2.013832] nfs4filelayout_init: NFSv4 File Layout Driver Registering... [ 2.019072] nfs4flexfilelayout_init: NFSv4 Flexfile Layout Driver Registering... [ 2.025474] Key type asymmetric registered [ 2.028085] Asymmetric key parser 'x509' registered [ 2.030722] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 249) [ 2.035840] io scheduler mq-deadline registered [ 2.038458] io scheduler kyber registered [ 2.049511] bcm2835-rng 3f104000.rng: hwrng registered [ 2.052574] vc-mem: phys_addr:0x00000000 mem_base=0x1ec00000 mem_size:0x20000000(512 MiB) [ 2.058754] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000 [ 2.076298] brd: module loaded [ 2.091008] loop: module loaded [ 2.095449] Loading iSCSI transport class v2.0-870. [ 2.099918] usbcore: registered new interface driver lan78xx [ 2.105142] usbcore: registered new interface driver smsc95xx [ 2.110346] dwc_otg: version 3.00a 10-AUG-2012 (platform bus) [ 2.843975] Core Release: 2.80a [ 2.846707] Setting default values for core params [ 2.849424] Finished setting default values for core params [ 3.055052] Using Buffer DMA mode [ 3.057663] Periodic Transfer Interrupt Enhancement - disabled [ 3.062869] Multiprocessor Interrupt Enhancement - disabled [ 3.068125] OTG VER PARAM: 0, OTG VER FLAG: 0 [ 3.070892] Dedicated Tx FIFOs mode [ 3.074701] WARN::dwc_otg_hcd_init:1074: FIQ DMA bounce buffers: virt = 8bd04000 dma = 0xcbd04000 len=9024 [ 3.082525] FIQ FSM acceleration enabled for : Non-periodic Split Transactions Periodic Split Transactions High-Speed Isochronous Endpoints Interrupt/Control Split Transaction hack enabled [ 3.097888] dwc_otg: Microframe scheduler enabled [ 3.097969] WARN::hcd_init_fiq:457: FIQ on core 1 [ 3.102844] WARN::hcd_init_fiq:458: FIQ ASM at 807cb8b8 length 36 [ 3.109942] WARN::hcd_init_fiq:497: MPHI regs_base at 9c810000 [ 3.116946] dwc_otg 3f980000.usb: DWC OTG Controller [ 3.119432] dwc_otg 3f980000.usb: new USB bus registered, assigned bus number 1 [ 3.124232] dwc_otg 3f980000.usb: irq 89, io mem 0x00000000 [ 3.128961] Init: Port Power? op_state=1 [ 3.131336] Init: Power Port (0) [ 3.134040] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.10 [ 3.138847] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [ 3.143660] usb usb1: Product: DWC OTG Controller [ 3.146172] usb usb1: Manufacturer: Linux 5.10.103-v7+ dwc_otg_hcd [ 3.151139] usb usb1: SerialNumber: 3f980000.usb [ 3.154534] hub 1-0:1.0: USB hub found [ 3.157108] hub 1-0:1.0: 1 port detected [ 3.161115] dwc_otg: FIQ enabled [ 3.161128] dwc_otg: NAK holdoff enabled [ 3.161140] dwc_otg: FIQ split-transaction FSM enabled [ 3.161157] Module dwc_common_port init [ 3.161456] usbcore: registered new interface driver usb-storage [ 3.166792] mousedev: PS/2 mouse device common for all mice [ 3.173193] bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer [ 3.181002] sdhci: Secure Digital Host Controller Interface driver [ 3.186412] sdhci: Copyright(c) Pierre Ossman [ 3.189803] mmc-bcm2835 3f300000.mmcnr: could not get clk, deferring probe [ 3.195947] sdhost-bcm2835 3f202000.mmc: could not get clk, deferring probe [ 3.201663] sdhci-pltfm: SDHCI platform and OF driver helper [ 3.208083] ledtrig-cpu: registered to indicate activity on CPUs [ 3.214086] hid: raw HID events driver (C) Jiri Kosina [ 3.217127] usbcore: registered new interface driver usbhid [ 3.222778] usbhid: USB HID core driver [ 3.230841] Initializing XFRM netlink socket [ 3.233727] NET: Registered protocol family 17 [ 3.236732] Key type dns_resolver registered [ 3.240195] Registering SWP/SWPB emulation handler [ 3.243221] registered taskstats version 1 [ 3.246076] Loading compiled-in X.509 certificates [ 3.249718] Key type ._fscrypt registered [ 3.252470] Key type .fscrypt registered [ 3.255175] Key type fscrypt-provisioning registered [ 3.269508] uart-pl011 3f201000.serial: cts_event_workaround enabled [ 3.274876] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 114, base_baud = 0) is a PL011 rev2 [ 3.282574] bcm2835-power bcm2835-power: Broadcom BCM2835 power domains driver [ 3.289654] mmc-bcm2835 3f300000.mmcnr: mmc_debug:0 mmc_debug2:0 [ 3.294976] mmc-bcm2835 3f300000.mmcnr: DMA channel allocated [ 3.327144] sdhost: log_buf @ (ptrval) (cbd03000) [ 3.365875] mmc1: queuing unknown CIS tuple 0x80 (2 bytes) [ 3.372786] mmc1: queuing unknown CIS tuple 0x80 (3 bytes) [ 3.379746] mmc1: queuing unknown CIS tuple 0x80 (3 bytes) [ 3.385225] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1) [ 3.414084] of_cfs_init [ 3.416977] of_cfs_init: OK [ 3.421371] Waiting for root device PARTUUID=71f17646-02... [ 3.427621] mmc1: queuing unknown CIS tuple 0x80 (7 bytes) [ 3.434892] mmc1: queuing unknown CIS tuple 0x80 (3 bytes) [ 3.499199] mmc0: host does not support reading read-only switch, assuming write-enable [ 3.509480] mmc0: new high speed SDHC card at address aaaa [ 3.516278] mmcblk0: mmc0:aaaa SL16G 14.8 GiB [ 3.521905] mmcblk0: p1 p2 [ 3.556359] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null) [ 3.561884] VFS: Mounted root (ext4 filesystem) readonly on device 179:2. [ 3.573293] mmc1: new high speed SDIO card at address 0001 [ 3.576413] devtmpfs: mounted [ 3.589145] Freeing unused kernel memory: 1024K [ 3.624527] Run /sbin/init as init process [ 3.627176] with arguments: [ 3.627188] /sbin/init [ 3.627199] with environment: [ 3.627210] HOME=/ [ 3.627221] TERM=linux [ 4.204439] systemd[1]: System time before build time, advancing clock. [ 4.357724] NET: Registered protocol family 10 [ 4.362043] Segment Routing with IPv6 [ 4.449202] systemd[1]: systemd 241 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD -IDN2 +IDN -PCRE2 default-hierarchy=hybrid) [ 4.464838] systemd[1]: Detected architecture arm. [ 4.546680] systemd[1]: Set hostname to . [ 5.338006] random: systemd: uninitialized urandom read (16 bytes read) [ 5.356725] random: systemd: uninitialized urandom read (16 bytes read) [ 5.362705] systemd[1]: Listening on initctl Compatibility Named Pipe. [ 5.372220] random: systemd: uninitialized urandom read (16 bytes read) [ 5.378955] systemd[1]: Listening on Journal Socket. [ 5.393648] systemd[1]: Starting Set the console keyboard layout... [ 5.404529] systemd[1]: Condition check resulted in Huge Pages File System being skipped. [ 5.411913] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point. [ 5.421776] systemd[1]: Reached target Swap. [ 5.438194] systemd[1]: Starting Load Kernel Modules... [ 5.511393] i2c /dev entries driver [ 6.167951] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null) [ 6.298566] systemd-journald[122]: Received request to flush runtime journal from PID 1 [ 6.802439] gpio-10 (i2c@0): enforced open drain please flag it properly in DT/ACPI DSDT/board file [ 6.802555] gpio-11 (i2c@0): enforced open drain please flag it properly in DT/ACPI DSDT/board file [ 6.803424] i2c-gpio i2c@0: using lines 10 (SDA) and 11 (SCL) [ 6.918413] vc_sm_cma: module is from the staging directory, the quality is unknown, you have been warned. [ 6.921012] bcm2835_vc_sm_cma_probe: Videocore shared memory driver [ 6.921041] [vc_sm_connected_init]: start [ 6.927204] [vc_sm_connected_init]: installed successfully [ 6.941394] mc: Linux media interface: v0.10 [ 6.981045] videodev: Linux video capture interface: v2.00 [ 7.020817] pinctrl-bcm2835 3f200000.gpio: pin gpio2 already requested by rpi_backlight; cannot claim for 3f804000.i2c [ 7.020863] pinctrl-bcm2835 3f200000.gpio: pin-2 (3f804000.i2c) status -22 [ 7.020901] pinctrl-bcm2835 3f200000.gpio: could not request pin 2 (gpio2) from group gpio2 on device pinctrl-bcm2835 [ 7.020928] i2c-bcm2835 3f804000.i2c: Error applying setting, reverse things back [ 7.020989] i2c-bcm2835: probe of 3f804000.i2c failed with error -22 [ 7.022885] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned. [ 7.022893] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned. [ 7.023813] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned. [ 7.036181] snd_bcm2835: module is from the staging directory, the quality is unknown, you have been warned. [ 7.039054] bcm2835_audio bcm2835_audio: there is not valid maps for state default [ 7.064127] bcm2835_isp: module is from the staging directory, the quality is unknown, you have been warned. [ 7.071137] bcm2835-isp bcm2835-isp: Device node output[0] registered as /dev/video13 [ 7.071649] bcm2835-isp bcm2835-isp: Device node capture[0] registered as /dev/video14 [ 7.072244] bcm2835-isp bcm2835-isp: Device node capture[1] registered as /dev/video15 [ 7.072577] bcm2835-isp bcm2835-isp: Device node stats[2] registered as /dev/video16 [ 7.072610] bcm2835-isp bcm2835-isp: Register output node 0 with media controller [ 7.072635] bcm2835-isp bcm2835-isp: Register capture node 1 with media controller [ 7.072656] bcm2835-isp bcm2835-isp: Register capture node 2 with media controller [ 7.072676] bcm2835-isp bcm2835-isp: Register capture node 3 with media controller [ 7.072867] bcm2835-isp bcm2835-isp: Loaded V4L2 bcm2835-isp [ 7.077513] bcm2835_v4l2: module is from the staging directory, the quality is unknown, you have been warned. [ 7.087519] bcm2835_codec: module is from the staging directory, the quality is unknown, you have been warned. [ 7.102700] bcm2835-codec bcm2835-codec: Device registered as /dev/video10 [ 7.102763] bcm2835-codec bcm2835-codec: Loaded V4L2 decode [ 7.121036] bcm2835-codec bcm2835-codec: Device registered as /dev/video11 [ 7.121093] bcm2835-codec bcm2835-codec: Loaded V4L2 encode [ 7.125656] bcm2835-codec bcm2835-codec: Device registered as /dev/video12 [ 7.125722] bcm2835-codec bcm2835-codec: Loaded V4L2 isp [ 7.128314] bcm2835-codec bcm2835-codec: Device registered as /dev/video18 [ 7.128356] bcm2835-codec bcm2835-codec: Loaded V4L2 image_fx [ 7.391172] cfg80211: Loading compiled-in X.509 certificates for regulatory database [ 7.532003] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7' [ 7.642353] brcmfmac: F1 signature read @0x18000000=0x1542a9a6 [ 7.666153] checking generic (1eb17000 e1000) vs hw (0 ffffffff) [ 7.666179] fb0: switching to vc4drmfb from simple [ 7.666905] Console: switching to colour dummy device 80x30 [ 7.668449] vc4-drm soc:gpu: bound 3f600000.firmwarekms (ops vc4_fkms_ops [vc4]) [ 7.668718] vc4-drm soc:gpu: bound 3fc00000.v3d (ops vc4_v3d_ops [vc4]) [ 7.670105] [drm] Initialized vc4 0.0.0 20140616 for soc:gpu on minor 0 [ 7.681577] Console: switching to colour frame buffer device 60x30 [ 7.685008] vc4-drm soc:gpu: [drm] fb0: vc4drmfb frame buffer device [ 7.720411] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43436-sdio for chip BCM43430/2 [ 7.722144] usbcore: registered new interface driver brcmfmac [ 7.916356] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43436-sdio for chip BCM43430/2 [ 7.916501] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43436-sdio for chip BCM43430/2 [ 7.937733] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/2 wl0: Oct 9 2020 14:44:32 version 9.88.4.65 (test) (f149b32@shgit) (r679549) FWID 01-f40f3270 [ 7.981121] edt_ft5x06 11-0015: supply vcc not found, using dummy regulator [ 7.991197] input: generic ft5x06 (00) as /devices/platform/i2c@0/i2c-11/11-0015/input/input0 [ 10.258141] random: crng init done [ 10.258166] random: 7 urandom warning(s) missed due to ratelimiting [ 10.379081] uart-pl011 3f201000.serial: no DMA platform data [ 10.404793] 8021q: 802.1Q VLAN Support v1.8 [ 10.746863] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save enabled [ 10.854108] Adding 102396k swap on /var/swap. Priority:-2 extents:1 across:102396k SSFS [ 16.272359] Bluetooth: Core ver 2.22 [ 16.272468] NET: Registered protocol family 31 [ 16.272476] Bluetooth: HCI device and connection manager initialized [ 16.272998] Bluetooth: HCI socket layer initialized [ 16.273014] Bluetooth: L2CAP socket layer initialized [ 16.273039] Bluetooth: SCO socket layer initialized [ 16.312689] Bluetooth: HCI UART driver ver 2.3 [ 16.312707] Bluetooth: HCI UART protocol H4 registered [ 16.312787] Bluetooth: HCI UART protocol Three-wire (H5) registered [ 16.312983] Bluetooth: HCI UART protocol Broadcom registered [ 16.759785] Bluetooth: BNEP (Ethernet Emulation) ver 1.3 [ 16.759808] Bluetooth: BNEP filters: protocol multicast [ 16.759836] Bluetooth: BNEP socket layer initialized [ 18.076428] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready [ 19.988459] ICMPv6: process `dhcpcd' is using deprecated sysctl (syscall) net.ipv6.neigh.wlan0.retrans_time - use net.ipv6.neigh.wlan0.retrans_time_ms instead ```
ahopper commented 1 year ago

does setting UseCompositor to false prevent the fault?

nixtar commented 1 year ago

does setting UseCompositor to false prevent the fault?

Unless I'm missing something, LinuxFramebufferPlatformOptions has no UseCompositor property? Is there another Platform Options class that works with StartLinuxDrm?

nixtar commented 1 year ago

FYI, I've reproduced this issue on dotnet 7.0.100 and Avalonia 11.0.0-preview4.

Please feel free to let me know if there is anything you would like me to try.

ahopper commented 1 year ago

does setting UseCompositor to false prevent the fault?

Unless I'm missing something, LinuxFramebufferPlatformOptions has no UseCompositor property? Is there another Platform Options class that works with StartLinuxDrm?

Sorry, I just assumed framebuffer had the same options. I don't know if there is another way to turn off Composition.

hisleiterj commented 1 year ago

I can confirm that this issue happens not only on Raspberry PI but other (Embedded) Linux Systems as well. I am using Avalonia 11.0.0-preview4 (including Avalonia.LinuxFramebuffer 11.0.0-preview4) on a STM32MP1 demo-board (ARM Cortex-A9). As @nixtar, I am also using the minimal example from https://docs.avaloniaui.net/guides/deep-dives/running-on-raspbian-lite-via-drm. However, for me it does not seem to matter if I remove the Slider control or not, even with only the TextBlock, the application immediately hangs without showing anything on the screen. The same application works fine on this system with Avalonia 0.10.18.

Dmesg shows:

[  746.730063] Alignment trap: not handling instruction ed910b00 at [<af4651b0>]
[  746.736071] 8<--- cut here ---
[  746.738948] Unhandled fault: alignment exception (0x001) at 0x004f54fa
[  746.745437] pgd = 6d956803
[  746.748235] [004f54fa] *pgd=c4102835, *pte=d15e175f, *ppte=d15e1c7f