| Summary: | X server fails on PowerPC when built with GCC 4.7.x | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] Meta-yocto | Reporter: | Gary Thomas <gary> | ||||
| Component: | meta-yocto | Assignee: | Richard Purdie <richard.purdie> | ||||
| Status: | VERIFIED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | Medium | CC: | andrei, laurentiu.serban, poky.bs.watcher, poky.watcher, raj.khem, sgw | ||||
| Version: | 1.2 | ||||||
| Target Milestone: | 1.3 M1 | ||||||
| Hardware: | x86 | ||||||
| OS: | Multiple | ||||||
| Whiteboard: | |||||||
| OS type for building Yocto: | --- | Type of Regression: | --- | ||||
| Verified: | Documentation change: | --- | |||||
| Bug Depends on: | |||||||
| Bug Blocks: | 1477 | ||||||
| Attachments: |
|
||||||
|
Description
Gary Thomas
2012-05-15 17:06:05 UTC
The problem boils down to code that looks like this:
void *ptr;
switch(XX) {
case a:
define_some_structure A;
ptr = &A;
break;
case b:
define_some_structure B;
ptr = &B;
break;
}
call_some_function(ptr);
The data in the structure (either A or B) is being destroyed or lost
somewhere in this process, hence the function may fail.
IMO, this is should not be legal (if it even is, I'm not a C spec expert),
even if it has been around and working for 25 years :-(
The attached patch fixes this bug and the X server runs again. That said,
who knows how many other such dragons are left to be discovered.
Created attachment 513 [details]
Fix incorrect stack variable usage
(In reply to comment #2) > Created attachment 513 [details] > Fix incorrect stack variable usage this patch is OK FWIW I think gcc 4.7 kills the locals once it goes out of scope i.e. switch {} I wonder if you get warnings about it from gcc There are no warnings about this in the build log. Per discussion with Martin Jansa, I've proposed (oe-core list) to bring in an upstream fix from 2010-08-10 (which tells you how stale this recipe is...) http://cgit.freedesktop.org/xorg/xserver/patch/Xext/xace.c?id=6dae7f3792611aace1df0cca63bf50c50d93de43 Merged in master. commit 6d40b658f42837f4270f1dd3c0f350eb84b369f0 Author: Gary Thomas <gary@mlbassoc.com> Date: Fri May 18 17:18:18 2012 +0300 Verified |