Regression: "Undefined video mode" with 3.5.0-14.16
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| gcc-4.7 (Ubuntu) |
Undecided
|
Unassigned | ||
| Quantal |
Undecided
|
Unassigned | ||
| linux (Ubuntu) |
Medium
|
Tim Gardner | ||
| Quantal |
Medium
|
Tim Gardner |
Bug Description
Starting last night, Ubuntu images started showing an error message after the isolinux "press any key" screen but before plymouth. This is affecting today's daily images. Screenshot attached.
"Undefined video mode number: 0
Press <ENTER> to see video modes available, <SPACE> to continue, or wait 30 sec"
cjwatson said that this was related to the kernel:
arch/x86/
I don't believe this affects installed Ubuntu with grub2. The Ubuntu install images use isolinux instead.
ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: linux-image-
ProcVersionSign
Uname: Linux 3.5.0-14-generic x86_64
ApportVersion: 2.5.1-0ubuntu7
Architecture: amd64
Date: Wed Sep 12 08:28:01 20125
ProcFB: 0 inteldrmfb
ProcKernelCmdLine: BOOT_IMAGE=
RelatedPackageV
linux-
linux-
linux-firmware 1.91
SourcePackage: linux
Jeremy Bicha (jbicha) wrote : | #1 |
Changed in linux (Ubuntu): | |
status: | New → Confirmed |
Joseph Salisbury (jsalisbury) wrote : | #2 |
Changed in linux (Ubuntu): | |
importance: | Undecided → Medium |
tags: | added: kernel-da-key needs-upstream-testing regression-update |
Changed in linux (Ubuntu): | |
status: | Confirmed → Incomplete |
Ubuntu QA Website (ubuntuqa) wrote : | #3 |
This bug has been reported on the Ubuntu ISO testing tracker.
A list of all reports related to this bug can be found here:
http://
tags: | added: iso-testing |
Changed in linux (Ubuntu Quantal): | |
assignee: | nobody → Tim Gardner (timg-tpi) |
status: | Incomplete → In Progress |
Seth Forshee (sforshee) wrote : | #4 |
This message comes from early boot code, which hasn't changed recently. The kernel includes a few options for handling video in early boot. Each option defines a struct that gets linked into a section named .videocards, and the kernel iterates through the structs in this section looking for any which can provide mode information. Somehow we're ending up with nothing in that section.
$ readelf -s setup.elf | grep video_card
138: 00003660 0 NOTYPE GLOBAL DEFAULT 12 video_cards
151: 00003660 0 NOTYPE GLOBAL DEFAULT 12 video_cards_end
We should see some space between video_cards and video_cards_end, and the fact that we don't means the kernel isn't going to find any options for video.
I verified that beta 1 (3.5.0-13.14) doesn't have this issue. None of the kernel changes between these versions look like they should have any impact, so my best guess is that this is caused by some change to the build tools. Those kernels are built with the same gcc version, but it does looke like binutils changed recently.
description: | updated |
Tim Lunn (darkxst) wrote : | #5 |
3.5.0-14.15 is unaffected also.
I tried testing the mainline kernel, but couldnt get it to install in the livecd chroot, grub complains about missing / device.
Tim Gardner (timg-tpi) wrote : | #6 |
Hmm, this is looking like it might be a binutils issue. Building Ubuntu-3.5.0-14.16 in a Precise chroot produces:
readelf -s ./debian/
160: 000042ec 0 NOTYPE GLOBAL DEFAULT 12 video_cards
173: 00004340 0 NOTYPE GLOBAL DEFAULT 12 video_cards_end
Quantal produces:
readelf -s ./debian/
138: 00003658 0 NOTYPE GLOBAL DEFAULT 12 video_cards
151: 00003658 0 NOTYPE GLOBAL DEFAULT 12 video_cards_end
Tim Gardner (timg-tpi) wrote : | #7 |
Installing binutils_
rtg@salmon:
GCC: (Ubuntu/Linaro 4.7.1-8ubuntu1) 4.7.1 20120908 (prerelease)
rtg@salmon:
GCC: (Ubuntu/Linaro 4.7.1-7ubuntu1) 4.7.1 20120814 (prerelease)
Tim Gardner (timg-tpi) wrote : | #8 |
Doko suggested trying https:/
readelf -s ./debian/
147: 00002f3b 0 NOTYPE GLOBAL DEFAULT ABS video_cards
148: 00003650 0 NOTYPE GLOBAL DEFAULT ABS video_cards_end
Tim Gardner (timg-tpi) wrote : | #9 |
Indeed, kernels built with binutils 2.22.90.
Matthias Klose (doko) wrote : | #10 |
binutils 2.22.90.
Matthias Klose (doko) wrote : | #11 |
I tried to reproduce this with binutils 2.22.90.
$ KBUILD_VERBOSE=1 DEB_BUILD_
[...]
$ readelf -s debian/
138: 0000365c 0 NOTYPE GLOBAL DEFAULT 12 video_cards
151: 0000365c 0 NOTYPE GLOBAL DEFAULT 12 video_cards_end
Jeremy Bicha (jbicha) wrote : | #12 |
I tested with today's daily build which uses Linux 3.5.0-14.17 and I still get the "undefined video mode" error.
Matthias Klose (doko) wrote : | #13 |
Jakub Jelinek commented on freenode/#gcc:
from quick look at the kernel, I'd say the kernel is buggy
I'd say used attribute is a must in the #define __videocard struct card_info __attribute_
because when it declares static __videocard var = { ... }; then the compiler has all rights to just nuke those as unused
though I can't reproduce it with:
struct S { int i, j; };
static struct S __attribute_
void foo (void)
{
s.i = 2;
s.j = 3;
}
actually, the kernel code is even more insane
struct S { int i, j; void (*p) (void); };
static struct S __attribute_
static void foo (void)
{
s.i = 2;
s.j = 3;
}
static struct S __attribute_
if this ever worked, it was purely by accident
note that the struct var is static, not marked as used, only used (visibly to the compiler) in a static function that is only referenced from the static struct variable's initializer
but please tell me which gcc would not optimize that away, even 4.1 at -O2 does
seems this got broken 4 years ago though
commit a1a00b58855ccdb
Author: Hannes Eder <email address hidden>
Date: Sun Nov 23 19:37:09 2008 +0100
a preprocessed testcase still would be nice to see if for some reason it happens not to be optimized out by month old 4.7 and is right now
but the reduced testcase from what I saw in the kernel code really optimizes to nothing even in 4.1
even 3.4 does, 3.3/3.2 doesn't at -O2
Matthias Klose (doko) wrote : | #14 |
--- arch/x86/
+++ arch/x86/
@@ -80,7 +80,7 @@
u16 xmode_n; /* Size of unprobed mode range */
};
-#define __videocard struct card_info __attribute_
+#define __videocard struct card_info __attribute_
extern struct card_info video_cards[], video_cards_end[];
int mode_defined(u16 mode); /* video.c */
Changed in linux (Ubuntu Quantal): | |
status: | In Progress → Fix Committed |
Launchpad Janitor (janitor) wrote : | #15 |
This bug was fixed in the package linux - 3.5.0-14.18
---------------
linux (3.5.0-14.18) quantal; urgency=low
[ Tim Gardner ]
* SAUCE: Add 'used' to the video_cards structure attributes
- LP: #1049650
-- Tim Gardner <email address hidden> Fri, 14 Sep 2012 10:58:40 -0400
Changed in linux (Ubuntu Quantal): | |
status: | Fix Committed → Fix Released |
Launchpad Janitor (janitor) wrote : | #16 |
Status changed to 'Confirmed' because the bug affects multiple users.
Changed in gcc-4.7 (Ubuntu): | |
status: | New → Confirmed |
Colin Watson (cjwatson) wrote : | #17 |
Jeremy's right that this wouldn't affect installed systems with grub2, in general. grub2 uses the kernel's 32-bit entry point, which bypasses the affected code.
Matthias Klose (doko) wrote : | #18 |
the pointer to binutils unfortunately wasn't the right one. I always was able to reproduce the issue with any binutils version.
there were section sizes for the .videocards section. 0 (the buggy one), 84 (the correct one), and an even bigger one from comment #8. It was agreed not investigate the even bigger one, as it was only seen by one developer and couldn't be reproduced.
The root cause was a bug in the gcc-4.7 4.7.1-8ubuntu1 package, that the unused video_cards static variables were optimized away, even while the files were built using -fno-toplevel-
The suggested kernel fix to explicitly mark the video_cards variables as used isn't wrong, but maybe not needed. Please consider rebuilding the linux package using -9ubuntu1/2 when this is available in the archive for all architectures (even armel), so that files which may be affected from the issue are correctly rebuilt.
Changed in gcc-4.7 (Ubuntu Quantal): | |
status: | Confirmed → Fix Released |
Greg Faith (gregfaith) wrote : | #19 |
Got the same bug on alternate Lubuntu amd64 & i386 (di) installs. Colors were bright and strange lime green & blue but the installs proceeded as usual and completed. Reboots were okay and as expected colors both isos 20120918..
Adam Conrad (adconrad) wrote : Update Released | #20 |
The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.
Would it be possible for you to test the latest upstream kernel? Refer to https:/ /wiki.ubuntu. com/KernelMainl ineBuilds . Please test the latest v3.6 kernel[0] (Not a kernel in the daily directory) and install both the linux-image and linux-image-extra .deb packages.
Once you've tested the upstream kernel, please remove the 'needs- upstream- testing' tag. Please only remove that one tag and leave the other tags. This can be done by clicking on the yellow pencil icon next to the tag located at the bottom of the bug description and deleting the 'needs- upstream- testing' text.
If this bug is fixed in the mainline kernel, please add the following tag 'kernel- fixed-upstream' .
If the mainline kernel does not fix this bug, please add the tag: 'kernel- bug-exists- upstream' .
If you are unable to test the mainline kernel, for example it will not boot, please add the tag: 'kernel- unable- to-test- upstream' .
Once testing of the upstream kernel is complete, please mark this bug as "Confirmed".
Thanks in advance.
[0] http:// kernel. ubuntu. com/~kernel- ppa/mainline/ v3.6-rc5- quantal/