Bug 2180107 - videodev crash "Unknown pixelformat 0x00000000"
Summary: videodev crash "Unknown pixelformat 0x00000000"
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 37
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-03-20 17:55 UTC by opotonil
Modified: 2023-06-11 19:00 UTC (History)
17 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-06-11 19:00:23 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
journalctl (154.87 KB, text/plain)
2023-03-20 17:55 UTC, opotonil
no flags Details
Kernel logs - Solved (99.56 KB, text/plain)
2023-03-27 18:49 UTC, opotonil
no flags Details

Description opotonil 2023-03-20 17:55:03 UTC
Created attachment 1952138 [details]
journalctl

Created attachment 1952138 [details]
journalctl

1. Please describe the problem:

[   19.705899] ------------[ cut here ]------------
[   19.705902] Unknown pixelformat 0x00000000
[   19.705949] WARNING: CPU: 0 PID: 1744 at drivers/media/v4l2-core/v4l2-ioctl.c:1503 v4l_enum_fmt+0x11e2/0x1b70 [videodev]
[   19.706011] Modules linked in: rfcomm snd_seq_dummy snd_hrtimer nft_objref nf_conntrack_netbios_ns nf_conntrack_broadcast nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ip_set nf_tables nfnetlink qrtr bnep sunrpc binfmt_misc vfat fat intel_rapl_msr intel_rapl_common rtl8723be intel_tcc_cooling x86_pkg_temp_thermal intel_powerclamp btcoexist coretemp rtl8723_common rtl_pci kvm_intel snd_hda_codec_hdmi rtlwifi iTCO_wdt snd_hda_codec_realtek intel_pmc_bxt kvm mei_pxp mei_hdcp ee1004 iTCO_vendor_support snd_hda_codec_generic dell_smm_hwmon mac80211 snd_hda_intel snd_intel_dspcfg snd_intel_sdw_acpi irqbypass snd_hda_codec rapl snd_hda_core btusb uvcvideo btrtl intel_cstate videobuf2_vmalloc snd_hwdep videobuf2_memops btbcm videobuf2_v4l2 snd_seq libarc4 btintel snd_seq_device videobuf2_common btmtk joydev intel_uncore snd_pcm dell_wmi dell_wmi_aio cfg80211 bluetooth
[   19.706198]  ledtrig_audio videodev dell_smbios sparse_keymap snd_timer dcdbas wmi_bmof snd dell_wmi_descriptor mc r8169 i2c_i801 pcspkr mei_me soundcore i2c_smbus mei rfkill acpi_pad loop zram i915 nouveau crct10dif_pclmul crc32_pclmul sdhci_pci crc32c_intel polyval_clmulni cqhci polyval_generic sdhci drm_buddy mxm_wmi ghash_clmulni_intel drm_display_helper mmc_core sha512_ssse3 serio_raw cec drm_ttm_helper hid_multitouch ttm video wmi ip6_tables ip_tables fuse
[   19.706306] CPU: 0 PID: 1744 Comm: pipewire Tainted: G        W I        6.1.18-200.fc37.x86_64 #1
[   19.706313] Hardware name: Dell Inc. Inspiron 24-7459/0503P4, BIOS 1.15.1 01/12/2021
[   19.706316] RIP: 0010:v4l_enum_fmt+0x11e2/0x1b70 [videodev]
[   19.706375] Code: c7 c3 53 37 c5 c0 81 fe 64 76 73 64 0f 84 53 f0 ff ff 41 80 7c 24 0c 00 0f 85 12 ef ff ff 48 c7 c7 a6 45 c5 c0 e8 ee 00 4c c5 <0f> 0b 48 c7 c2 c2 45 c5 c0 49 8d 4c 24 2c 49 8d 7c 24 0c 31 ed be
[   19.706380] RSP: 0018:ffffa6f44579bcf8 EFLAGS: 00010296
[   19.706387] RAX: 000000000000001e RBX: ffffffffc0c53d0e RCX: 0000000000000000
[   19.706391] RDX: 0000000000000002 RSI: ffffffff8774aa5b RDI: 00000000ffffffff
[   19.706395] RBP: 0000000000000000 R08: 0000000000000000 R09: ffffa6f44579bb80
[   19.706399] R10: 0000000000000003 R11: ffffffff88147448 R12: ffffa6f44579be00
[   19.706403] R13: 0000000000000000 R14: ffff96f40e2f5840 R15: ffff96f40e258018
[   19.706408] FS:  00007f1ab05c2740(0000) GS:ffff96f772000000(0000) knlGS:0000000000000000
[   19.706414] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   19.706419] CR2: 000055d343ee0040 CR3: 0000000147414006 CR4: 00000000003706f0
[   19.706423] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[   19.706427] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[   19.706432] Call Trace:
[   19.706435]  <TASK>
[   19.706442]  __video_do_ioctl+0x1ad/0x3e0 [videodev]
[   19.706509]  video_usercopy+0x329/0x720 [videodev]
[   19.706582]  ? v4l_print_control+0x20/0x20 [videodev]
[   19.706651]  v4l2_ioctl+0x46/0x50 [videodev]
[   19.706709]  __x64_sys_ioctl+0x8d/0xd0
[   19.706720]  do_syscall_64+0x58/0x80
[   19.706729]  ? do_syscall_64+0x67/0x80
[   19.706738]  ? syscall_exit_to_user_mode+0x17/0x40
[   19.706745]  ? do_syscall_64+0x67/0x80
[   19.706753]  ? do_syscall_64+0x67/0x80
[   19.706760]  ? do_syscall_64+0x67/0x80
[   19.706770]  entry_SYSCALL_64_after_hwframe+0x63/0xcd
[   19.706779] RIP: 0033:0x7f1ab06e5d6f
[   19.706794] Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 18 48 8b 44 24 18 64 48 2b 04 25 28 00 00
[   19.706800] RSP: 002b:00007ffcc7680770 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
[   19.706807] RAX: ffffffffffffffda RBX: 0000000000000026 RCX: 00007f1ab06e5d6f
[   19.706811] RDX: 000055d343ed55dc RSI: ffffffffc0405602 RDI: 0000000000000026
[   19.706815] RBP: 000055d343ed5620 R08: 00000000000000e0 R09: 000000000000000b
[   19.706820] R10: 0000000000000000 R11: 0000000000000246 R12: 000055d343ed55dc
[   19.706824] R13: 000055d343ed53e8 R14: 000055d343ed55b0 R15: 0000000000000000
[   19.706838]  </TASK>
[   19.706841] ---[ end trace 0000000000000000 ]---

2. What is the Version-Release number of the kernel:

Linux fedora 6.1.18-200.fc37.x86_64.

3. Did it work previously in Fedora? If so, what kernel version did the issue
   *first* appear?  Old kernels are available for download at
   https://koji.fedoraproject.org/koji/packageinfo?packageID=8 :

Working well with version 6.1.12.

4. Can you reproduce this issue? If so, please provide the steps to reproduce
   the issue below:

Boot PC and start GNOME session.

5. Does this problem occur with the latest Rawhide kernel? To install the
   Rawhide kernel, run ``sudo dnf install fedora-repos-rawhide`` followed by
   ``sudo dnf update --enablerepo=rawhide kernel``:

On version 6.2.7 the trouble persist.

6. Are you running any modules that not shipped with directly Fedora's kernel?:

No.

7. Please attach the kernel logs. You can get the complete kernel log
   for a boot with ``journalctl --no-hostname -k > dmesg.txt``. If the
   issue occurred on a previous boot, use the journalctl ``-b`` flag.

Kernel log attached.

Comment 1 opotonil 2023-03-21 19:19:55 UTC
On linux 6.2.7 I see the warning from my first post and:
# journalctl -b | grep "Unknown video format"
mar 19 13:18:18 desktop kernel: uvcvideo 2-7:1.3: Unknown video format 52564e49-2d90-4a58-920b-773f1f2c556b
mar 19 13:18:18 desktop kernel: uvcvideo 2-7:1.3: Unknown video format 49524e49-2d90-4a58-920b-773f1f2c556b
mar 19 13:18:18 desktop kernel: uvcvideo 2-7:1.3: Unknown video format 494c4552-1314-f943-a75a-ee6bbf012e23

On linux 6.1.12 I don't see the warning, I only see:
# journalctl -b | grep "Unknown video format"
mar 21 19:49:17 desktop kernel: uvcvideo 2-7:1.3: Unknown video format 52564e49-2d90-4a58-920b-773f1f2c556b
mar 21 19:49:17 desktop kernel: uvcvideo 2-7:1.3: Unknown video format 49524e49-2d90-4a58-920b-773f1f2c556b
mar 21 19:49:17 desktop kernel: uvcvideo 2-7:1.3: Unknown video format 494c4552-1314-f943-a75a-ee6bbf012e23

Maybe on linux 6.1.12 if "uvcvideo" module param "trace" is 0 don't show warnings (for me, this seems the correct way). And some change between linux 6.1.12 and linux 6.1.18 makes it don't respect the "uvcvideo" module param "trace". The changelog of linux 6.1.16 show quite work on "v2l".

Seems related: https://bugzilla.redhat.com/show_bug.cgi?id=2179542

Comment 2 opotonil 2023-03-22 18:50:55 UTC
I did gets time to determine kernel between 6.1.12 and 6.1.18 that introduced the issue.

The issue was introduced by kernel 6.1.18. I think the culprit commit is [1] or maybe [2].

[1] https://github.com/torvalds/linux/commit/50459f103edfe47c9a599d766a850ef6014936c5
[2] https://github.com/torvalds/linux/commit/41ddb251c68ac75c101d3a50a68c4629c9055e4c

Comment 3 opotonil 2023-03-23 19:02:57 UTC
After git bisect the culprit is:

commit 2c8ea08b86a5789449c5eb3da23e3864bb58c16a
Author: Laurent Pinchart <laurent.pinchart>
Date: Tue Nov 15 18:44:29 2016 +0200

media: uvcvideo: Remove format descriptions

[ Upstream commit 50459f103edfe47c9a599d766a850ef6014936c5 ]

The V4L2 core overwrites format descriptions in v4l_fill_fmtdesc(),
there's no need to manually set the descriptions in the driver. This
prepares for removal of the format descriptions from the uvc_fmts table.

Unlike V4L2, UVC makes a distinction between the SD-DV, SDL-DV and HD-DV
formats. It also indicates whether the DV format uses 50Hz or 60Hz. This
information is parsed by the driver to construct a format name string
that is printed in a debug message, but serves no other purpose as V4L2
has a single V4L2_PIX_FMT_DV pixel format that covers all those cases.

As the information is available in the UVC descriptors, and thus
accessible to users with lsusb if they really care, don't log it in a
debug message and drop the format name string to simplify the code.

Signed-off-by: Laurent Pinchart <laurent.pinchart>
Reviewed-by: Ricardo Ribalda <ribalda>
Reviewed-by: Michael Grzeschik <m.grzeschik>
Signed-off-by: Sasha Levin <sashal>

drivers/media/usb/uvc/uvc_driver.c | 24 ++----------------------
drivers/media/usb/uvc/uvc_v4l2.c | 2 --
drivers/media/usb/uvc/uvcvideo.h | 2 --
3 files changed, 2 insertions(+), 26 deletions(-)

Comment 4 Kate Hsuan 2023-03-24 13:22:31 UTC
Hi,

Thank you for reporting this.

Recently, since the description is removed from uvc driver, the description will not be created by the uvc itself.
v4l_fill_fmtdesc() already provides the information for the description but the uvc camera that returns the "unknown format" will trigger the warning message that you see.
The current implementation calls WARN() when a description can't be found and then the warning messages will be shown.

I made a new build to reduce the severity of the message and you could test it. :)
https://koji.fedoraproject.org/koji/taskinfo?taskID=99080890

Comment 5 Hans de Goede 2023-03-26 11:19:07 UTC
opotonil, thank you for the bisect, that is super helpful and I know that doing a bisect is quite a bit of work.

Kate thank you for preparing a kernel for opotonil to test.

opotonil, you can find x86_64 rpms from Kate's build here:

https://koji.fedoraproject.org/koji/taskinfo?taskID=99081008

And here are some instructions for installing a kernel directly from koji (Fedora's build system):
https://fedorapeople.org/~jwrdegoede/kernel-test-instructions.txt

Comment 6 opotonil 2023-03-27 18:49:52 UTC
Created attachment 1953999 [details]
Kernel logs - Solved

Comment 7 opotonil 2023-03-27 18:58:08 UTC
Thank Kate. I have attached the kernel logs, this is enough for me:

[   15.924132] video4linux video2: Unknown pixelformat 0x00000000
[   15.924140] video4linux video2: Unknown pixelformat 0x00000000
[   15.924172] video4linux video2: Unknown pixelformat 0x00000000
[   15.924943] video4linux video2: Unknown pixelformat 0x00000000
[   15.924949] video4linux video2: Unknown pixelformat 0x00000000
[   15.924983] video4linux video2: Unknown pixelformat 0x00000000

Thanks Hans, but all hard work was done by @loqs from Arch Linux [1]

I understand the patch will be provided to "upstream" so that Arch Linux and others can also benefit, so I don't need to report the problem to upstream, right?

[1] https://bugs.archlinux.org/task/77917

Comment 8 Kate Hsuan 2023-03-28 07:51:22 UTC
(In reply to opotonil from comment #7)
Hi opotonil,

Thank you for testing this patch :)

> Thank Kate. I have attached the kernel logs, this is enough for me:
> 
> [   15.924132] video4linux video2: Unknown pixelformat 0x00000000
> [   15.924140] video4linux video2: Unknown pixelformat 0x00000000
> [   15.924172] video4linux video2: Unknown pixelformat 0x00000000
> [   15.924943] video4linux video2: Unknown pixelformat 0x00000000
> [   15.924949] video4linux video2: Unknown pixelformat 0x00000000
> [   15.924983] video4linux video2: Unknown pixelformat 0x00000000
> 
> Thanks Hans, but all hard work was done by @loqs from Arch Linux [1]
> 
> I understand the patch will be provided to "upstream" so that Arch Linux and
> others can also benefit, so I don't need to report the problem to upstream,
> right?

You are right. We are working on getting it upstream.
This ticket was also mentioned in the commit message.


> 
> [1] https://bugs.archlinux.org/task/77917

Comment 9 opotonil 2023-06-11 19:00:23 UTC
Hi Kate and Hans,

Fixed in version 6.3.7 after merging the patch:
https://patchwork.kernel.org/project/linux-media/patch/20230506065809.24645-1-laurent.pinchart@ideasonboard.com/

I can see it currently in testing:
https://src.fedoraproject.org/rpms/kernel

So closing.


Note You need to log in before you can comment on or make changes to this bug.