Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash with a alignment trap issue when trying to view video files on a raspberry pi 2b #218

Open
BadlyDrawnBoy opened this issue Oct 14, 2022 · 4 comments

Comments

@BadlyDrawnBoy
Copy link

I tried a lot but I'm stuck now - is there a way out of this?

  • Raspberry pi 2b, 2022-09-22-raspios-bullseye-armhf-lite
  • pqiv 2.12-7-g1d2e621
  • FFmpeg:
ffmpeg version git-2022-10-11-37ee36f Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 10 (Raspbian 10.2.1-6+rpi1)
  configuration: --enable-gpl --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-postproc --enable-version3 --enable-shared --enable-mmal --enable-omx-rpi
  libavutil      57. 39.100 / 57. 39.100
  libavcodec     59. 50.100 / 59. 50.100
  libavformat    59. 34.101 / 59. 34.101
  libavdevice    59.  8.101 / 59.  8.101
  libavfilter     8. 49.101 /  8. 49.101
  libswscale      6.  8.112 /  6.  8.112
  libswresample   4.  9.100 /  4.  9.100
  libpostproc    56.  7.100 / 56.  7.100

service@raspberrypi:~/src/pqiv $ cat ./pqiv.sh
cd /home/service/src/pqiv/
xinit ./pqiv -s -t -d 2 -f --hide-info-box -l -t /mnt/images/ -- -nocursor -dpms -s 0 :0.0

service@raspberrypi:~/src/pqiv $ ls -hR /mnt/images
/mnt/images/dev1:
clip.gif  IMG_20160615_202509.JPG  VID_20220523_151157.mp4
service@raspberrypi:~/src/pqiv $ sudo cat /proc/cpu/alignment
User:		0
System:		0 (0x0)
Skipped:	0
Half:		0
Word:		0
DWord:		0
Multi:		0
User faults:	2 (fixup)
service@raspberrypi:~/src/pqiv $ sudo ./pqiv.sh

X.Org X Server 1.20.11
X Protocol Version 11, Revision 0
Build Operating System: linux Raspbian
Current Operating System: Linux raspberrypi 5.15.73-v7+ #1593 SMP Wed Oct 12 14:20:28 BST 2022 armv7l
Kernel command line: coherent_pool=1M snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 video=Composite-1:720x480@60i vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  console=ttyAMA0,115200 console=tty1 root=PARTUUID=467e33ad-02 rootfstype=ext4 fsck.repair=yes rootwait
Build Date: 05 August 2022  08:00:36AM
xorg-server 2:1.20.11-1+deb11u2 (https://www.debian.org/support) 
Current version of pixman: 0.40.0
	Before reporting problems, check http://wiki.x.org
	to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.0.log", Time: Fri Oct 14 14:53:24 2022
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(II) modeset(0): Initializing kms color map for depth 24, 8 bpc.
[swscaler @ 0x3bcb140] No accelerated colorspace conversion found from yuv420p to bgra.
xinit: connection to X server lost

waiting for X server to shut down (II) Server terminated successfully (0). Closing log file.
service@raspberrypi:~/src/pqiv $ sudo cat /proc/cpu/alignment
User:		1
System:		0 (0x0)
Skipped:	1
Half:		0
Word:		0
DWord:		0
Multi:		0
User faults:	2 (fixup)
service@raspberrypi:~/src/pqiv $ sudo dmesg
...
[ 1350.255459] process 'service/src/pqiv/pqiv' started with executable stack
[ 1362.508124] Alignment trap: not handling instruction f402602d at [<00bf2e68>]
[ 1362.508188] 8<--- cut here ---
[ 1362.511269] Unhandled fault: alignment exception (0x801) at 0x65dd7008
[ 1362.517909] pgd = acb0bebe
[ 1362.520653] [65dd7008] *pgd=05121835, *pte=10bcd75f, *ppte=10bcdc7f
@phillipberndt
Copy link
Owner

Does echo 3 > /proc/cpu/alignment help? (That is, asking the kernel to fix these up for you.)

If you want to fix the alignment issues that'll be some work, I didn't pay any attention to that when writing pqiv.

@BadlyDrawnBoy
Copy link
Author

BadlyDrawnBoy commented Oct 14, 2022

Hi,
thanks a lot for the quick reply! No, sadly it does not. I read somewhere that it may help to switch off the compiler optimization, but it has no effect. Also my initial thought that it is crashing because of the swscaler message seem to be a false route (why I messed around with compiling ffmpeg on the pi myself).

I'm okay at picking up breadcrumbs, and I know some C# on avr microcontrollers - but unfortunately I think this is probably beyond what I'm capable of. :(
Was hoping I could serve my dad with some slideshow rpi's (pictures and video) for a fair he is attending next weekend. Hmm, too bad - didn't came across an alternative yet.

root@raspberrypi:/home/service/src/pqiv# cat /proc/cpu/alignment
User:		6
System:		0 (0x0)
Skipped:	4
Half:		0
Word:		0
DWord:		0
Multi:		0
User faults:	3 (fixup+warn)
root@raspberrypi:/home/service/src/pqiv# dmesg
[14808.578385] Alignment trap: pqiv (1717) PC=0x6a8bfc68 Instr=0xf402602d Address=0x64811008 FSR 0x801
[14808.578452] Alignment trap: not handling instruction f402602d at [<6a8bfc68>]
[14808.578470] 8<--- cut here ---
[14808.581566] Unhandled fault: alignment exception (0x801) at 0x64811008
[14808.588231] pgd = 4027cbbc
[14808.591043] [64811008] *pgd=06a89835, *pte=11e6175f, *ppte=11e61c7f

@phillipberndt
Copy link
Owner

Well, if you're willing to look closer into this, we'll have to run pqiv (with debug symbols) in a debugger to see where in the code the sigbus happens. Do you know how to do that? (gdb --args ./pqiv file.mp4, r, bt once it crashes)

@BadlyDrawnBoy
Copy link
Author

Hi, I will have a try but for now all my raspberrys are on the fair and I didn't manage to boot a virtual pi with qemu yet. I will come back to it at some point.

Schöne Grüße aus Bremen! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants