-
Notifications
You must be signed in to change notification settings - Fork 26
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
Panic on 12.1-RC2 when kernel module is loaded #183
Comments
The 12.0-kmod package is built on 12.0 and so is not compatible with 12.1. You should build // @johalun why is this module even loading on 12.1? Aren't version checks supposed to prevent that? |
Yes that was the purpose of this exercise. We are preparing for the 12.1-RELEASE and wanted to determine that the existing binaries won't work, and then to come up with a solution for users after the release is live. |
This will be big problem once 12.1 is out and people start upgrading. We must make it so that binary packages work across minor FreeBSD version updates, even kmod packages. It was the same issue when 11.3 was released, iirc. @myfreeweb I know that the fix is fairly simple, for you, an experienced FreeBSD user and developer. But as @nomadlogic points out, this isn't about that, this is about making things for 12.1 work out of the box. Having people doing freebsd-update to 12.1 just to have the system immediately panicing, is quite bad, and will drive people away. Pointing people to the ports tree and tell them to build the ports from there might work. Telling them to clone a random git repository and use that won't work. At all. |
Oh sure, the original post just didn't look like "an exercise" at all, it totally looks like just "I have this problem right now" :) Again, first of all it's odd that there's a panic instead of the loader refusing to load the module. The failure should be softer. Anyway I guess we're bound to reinvent Linux's DKMS thing eventually.. Other than that, an interesting solution for shipping the correct module would be to have an additional pkg repo (enabled out of the box) just for this module (or all kmod packages eventually). The main repo doesn't distinguish between minor releases but this one would. // Yeah, it doesn't have to be from git right now, rebuilding from ports should work too. |
I guess the missing context is that this was a followup from a discussion at our meeting, which is quite hard for you to know. :)
Agreed. I believe the check is only if the module is too new for the kernel, not the opposite. I think the rationale is that it's easier to be backwards compatible (making the kernel work with older modules) than the other way around. This might need to change though.
Yeah, I think that's probably the best solution, to be honest.
This is an interesting solution as well, I wonder if it's possible. |
that's a good point, I should have put more context into this ticket when i opened it. I just wanted to make sure we had documented what happens when trying to load the binary, but to people who were part of that discussion it def looks like a generic bug report that needs a fix now. |
I'm also experiencing the panic after the upgrade to 12.1-RC2. The machine just reboots immediately after loading the module. I can provide more information if desired. |
Not a solution but how about having drm-v5.0-fbsd12.1 comitted to the ports tree with the NO_PACKAGE option then unlock it when 12.0 gets EOL'd? I think it would be a bit more approachable to type |
drm-fbsd12.0-kmod works on 12.1, you just have to compile it from ports as well. |
What would be useful (instead of an identical port) is a slave port that downloads and builds against 12.1 source tree. Then even the 12.0 package builder may place a 12.1-compatible package into the repository. It doesn't ideally fix the problem since user must take care to install the correct package despite both appearing available. Building the download-its-own-12.1 slave on a real 12.1 installation should also be disabled with a warning. Since this isn't normally done, maybe the potential for confusion makes it more trouble than it's worth? Rebuilding a kernel module during package install, on a system which otherwise uses only downloaded binaries for everything else (what Linux DKMS does) does not seem like a good idea. Ultimately a decision will be needed between either engineering the kernel to ensure compatibility with older modules or building all kmod ports for each release, yes? |
Thinking through this further... There can be a "fat" kmod package containing the module for all releases supported (this should compress well) and the appropriate binary may be selected automatically during installation. At the very list this is better from the user's perspective than having it build from source, and this shouldn't require any changes to pkg or ports infrastructure. |
This will not resolve the primary issue that official pkgs are built against a major versions least common denominator. The crux of the problem is not that we can't distribute multiple versions of the kmod (we do that already via the drm-kmod meta port), but that the package builders for 12.x for example don't build against the 12.1-RELEASE source, but rather against 12.0-RELEASE. |
I addressed that in my first comment: Have the port itself download the 12.1-RELEASE source. And I wasn't discussing multiple versions of the kmod, I was discussing the same version of the kmod built against multiple differing kernel sources. |
Ok I must have been confused when you said "Rebuilding a kernel module during package install, on a system which otherwise uses only downloaded binaries for everything else (what Linux DKMS does) does not seem like a good idea." I think the general consensus so far has been that we will need to ship a sub-set of the source needed for the drm-kmod to build correctly ala DKMS. This seems to be the only reasonable way for us to ensure people on newer releases are able to install the official upstream pkgs. It also has quite a bit of precedent in both the Linux and Unix world before that when working with drivers. |
A bit offtopic: I got crashes on 12.1 with drm-v5.0-fbsd12.1 on video playback until update bios to latest. |
i have upgraded from 12.0 to 12.1 and yes my machine reboots when loading drm-kmod :-( this is not how things were ever made in FreeBSD :-( why did you remove the dem-kmod-stable? that would provide some compatibility among all 12. now you have to create a dedicated port for every release. the 12.1 is out and the port is not there. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241787 :-( |
There is no need for a new port specifically for 12.1. The issue is, if you would read the entire issue, that prebuilt packages are currently built against the oldest support release for a major version. So for FreeBSD-12 packages are built against 12.0-RELEASE. Unfortunately for the DRM drivers (as well as some other ports) which requires building kmods necessary changes were introduced to the KBI for 12.1 that are not backwards compatible with 12.0. This is what is causing the panic on kernel load you reference. This issue can be resolved by rebuilding the drm-kmod package on your local 12.1 machine. I use "make package" personally to achieve this. |
the issue is that i did a release upgrade and my machine is useless out of the box. even worse it crashes the os with mounted root in endless loop what eventually results in data corruption! the issue is that it should work out of the box without "reading the entire issue". this is not Linux. i avoid Linux for that. i came here after reporting a bug in bugtracker and reading mailing list with dozens people with the same issue. FreeBSD was always "it works stable or its not part of stable" (not to mention a release). We should not accept, ever, this rush, just because others do. We avoid Windows and Linux for that. We never should accept a situation like this in FreeBSD! btw if the port is for 12 stable then please rename it to 12 from 12.0 because 12.0 suggests it will not work on 12.1 (as it would not work on 11.2). My two cents to your discussion maybe can come handy:
UPDATE: |
I prefer to have ports: To always have synced kernel and modules from ports I add to make.conf:
and do not use binary updates.
|
Seems like kms-drm and the ports are all "works as intended" in this situation. The real bugs are FreeBSD bugs in general:
|
Good point @therontarigo I would slightly update it to:
I just wonder is it the right way to go. What other ports/packages/modules has this kind of issues? Maybe the issue is really with the current DRM implementation or design if it enforces such a big changes around not the otherwise? Maybe DRM design can be reconsidered rather than whole set of kernel changes for DRM? :-) For me it looks like a problem that appeared in Linux 2.6.9 -> 2.6.10 when Kernel API started to change between each release. such a maintenance disaster. Please do not follow this path on FreeBSD. |
Maybe this is the good place and time to ask this question: why DRM drivers provided with generic kernel distribution are different from DRM provided with Ports? I can understand that Ports version provides development snapshots that can provide features preview integrated with system build automation. But why then those features do not land in kernel master? Wouldn't that solve all mentioned build/distribution/maintenance problems? Users would get functional video drivers out of the box! |
Yes, this is a system failure in the way we produce and release packages. I am sorry that this was not addressed prior to the release of 12.1.
The kernel has infrastructure to only allow compatible modules to load; the issue here is that the module built on 12.0 claims that it is compatible with any 12.x. This is an issue with the port itself.
Yes, one way to solve this would be to have the concept of overlay repos or a hierarchy of repos, so that the kernel module package could come from a 12.0 or 12.1 repo as appropriate, while the rest of the packages would come from a shared repo as today. |
Please search "drm2" in freebsd-current@ archives. |
Not only DRM kernel modules in ports, there are vbox, netgraph, mac and other. |
I would just like you to reconsider those frequent Kernel API changes. It already resulted in some problems. This is a kind of solution that generates more new problems. Look at Windows or Linux what mess it is. No one really even cares anymore. I really love FreeBSD for its elegance, minimal ZEN like optimal simplicity and integrity. I am sure there are better ways to handle this situation rather than pushing towards avalanche of even more complexity. |
I make drm-fbsd12-devel-kmod port for drm-v5.0-fbsd12.1 branch, if some one need this - can post to fbsd bug tracker. |
THIS MODULE IS A MESS AND SHOULD NOT BE PART OF A RELEASE NOR THIS MESSY LINUX APPROACH :-( Sorry, but I have wasted several days on crashed production systems with this. Looks like this is a bug tracker thread to follow: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=241101 |
Pretty sad situation. Wasted time too, for basically no reason. |
Just bumped into this problem too on my $WORK after upgrading a dozen of machines to 12.1. This is not a FreeBSD way, indeed. |
This issue technically pertains only to the panic on startup, not to the various troubles around ports, pkgs, and supported releases. How close is anyone to fixing this panic bug? If a kernel module cannot bail out while loading, shouldn't it instead disable itself such that no minor-release-specific code paths are entered, with a dmesg warning for why the mismatched module will do nothing? |
Hi, I welcome feedback / rejection / enhancements for an approach to making sure packages are built for each minor release. https://reviews.freebsd.org/D23881 |
Dear maintainers, I think I ran into this issue too, when I upgraded my Laptop from 12.1-RELEASE to 12.2-RELEASE. I can't precisely tell because before an error message could appear, the text output got corrupted and I could no longer read my screen. The ideal solution for me would be to simply have the correct package available during upgrade, so this whole disable-uninstall-portsbuild dance can be avoided. If that is not possible right now, I'd still wish to hear about such issues in the release notes - especially since this was known beforehand. Relevant System Specs: |
I’ve searched the Internet for an explanation of why drm-current-kmod requires FreeBSD 13-CURRENT, the issue remains obscure, there’s no discussion on any mailing list I can find. I’ve had to remove this port because this is too annoying and my Ryzen 3000 is not supported, and never will be until I upgrade to FreeBSD 13. I am likely not going to do an in-place upgrade when the time comes, and but this at the moment is the main compelling reason to do so. |
@ctipper just build it and install manually (do not use pkg binary) from the ports and it should work on 12 :-)
If you work on AMD GPU you need 13 will bring new features, it may work better, it will come up soon :-) You may even try the beta already: https://download.freebsd.org/ftp/releases/amd64/amd64/ISO-IMAGES/13.0/ |
@ctipper @cederom This discussion is off topic for this PR. |
As per details bellow, on 12.1-RC2 when I have the upstream FreeBSD drm-kmod pkg installed I get a panic on boot.
Here's info from the panic:
not super helpful unfortunately but I have a core available if we want to poke at it.
here is my system info
The text was updated successfully, but these errors were encountered: