Skip to contentSkip to conversation

Fix for bug #853 - matchbox-panel segfaults, X becomes unusable

PATCH In review Darren Hart 4 participants 11 messages Mar 16, 2011 – Mar 17, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix for bug #853 - matchbox-panel segfaults, X becomes unusable

The root cause of the matchbox-panel segfault is the same as for the previous two bugs addressing the same issue:

o Bug 224 - [Netbook/emenlow] matchbox-panel segfault after X startup
o Bug 738 - matchbox-panel segfault after X startup

There apparently is a bug in gcc which results in the omission of some code leading to the segfault on core2. The following flags resolve the problem.

FULL_OPTIMIZATION = "-fexpensive-optimizations -frename-registers -O2 -ggdb -feliminate-unused-debug-types"

We can continue to patch each new machine's gtk+ recipe that is based on atom-pc.conf, or we can just add the above to tune-atom.conf. I've tested both on both the n450 and a Toshiba NB305 netbook, and each solution is effective.

Chaging it in tune-atom.conf likely fixes other bugs we either haven't solved yet or simply haven't hit. It is also much more invasive, and we may not be willing to accept that this close to 1.0. The patches follow, and we can include one or the other.

Preferences?

Signature · 3 lines
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
#1 lore raw

PATCH 1/1 n450: add optimization flags to gtk+ for n450 to avoid gcc core2 bug

Fixes [YOCTO #853]

Without these added optimization flags, the matchbox-panel (and possibly other) applications would segfault. This patch applies the change only to the gtk+ recipe for the n450 bsp.

---
 meta-n450/recipes-gnome/gtk+/gtk+_2.22.1.bbappend |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
 create mode 100644 meta-n450/recipes-gnome/gtk+/gtk+_2.22.1.bbappend
meta-n450/recipes-gnome/gtk+/gtk+_2.22.1.bbappend new file +2 -0
new file mode 100644
index 0000000..3af4187
@@ -0,0 +1,2 @@
+#-fomit-frame-pointer in default FULL_OPTIMIZATION will cause matchbox-panel segfault on n450
+FULL_OPTIMIZATION_n450 = "-fexpensive-optimizations -frename-registers -O2 -ggdb -feliminate-unused-debug-types"
Signature · 6 lines
1.7.1

-- 
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
#4 lore raw

PATCH 1/1 atom-pc: work around gcc bug for core2

In reply to Darren Hart

Fixes [YOCTO #853]

Without these added optimization flags, the matchbox-panel (and possibly other) applications would segfault. This patch applies the changes to all machines derived from atom-pc.conf.

---
 meta/conf/machine/include/tune-atom.inc |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
meta/conf/machine/include/tune-atom.inc +4 -0
index a401856..db78b0d 100644
@@ -3,3 +3,7 @@ TARGET_CC_ARCH = "-m32 -march=core2 -msse3 -mtune=generic -mfpmath=sse"
 #MOBLIN_CFLAGS = "-Os -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -fasynchronous-unwind-tables"
 
 PACKAGE_EXTRA_ARCHS += "x86 i386 i486 i586 core2"
+
+# Work around a gcc bug for core2 which caused matchbox-panel to segfault
+# and possibly others.
+FULL_OPTIMIZATION = "-fexpensive-optimizations -frename-registers -O2 -ggdb -feliminate-unused-debug-types"
Signature · 1 line
1.7.1
#2 lore raw

Re: [PATCH A] n450: add optimization flags to gtk+ for n450 to avoid gcc core2 bug

In reply to Darren Hart
Quoted 20 lines · Darren Hart

Fixes [YOCTO #853]

Without these added optimization flags, the matchbox-panel (and possibly other) applications would segfault. This patch applies the change only to the gtk+ recipe for the n450 bsp.

---
  meta-n450/recipes-gnome/gtk+/gtk+_2.22.1.bbappend |    2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)

create mode 100644 meta-n450/recipes-gnome/gtk+/gtk+_2.22.1.bbappend

meta-n450/recipes-gnome/gtk+/gtk+_2.22.1.bbappend new file +0 -0
new file mode 100644
index 0000000..3af4187

meta-n450/recipes-gnome/gtk+/gtk+_2.22.1.bbappend line 2

Quoted 2 lines
meta-n450/recipes-gnome/gtk+/gtk+_2.22.1.bbappend new file +2 -0
@@ -0,0 +1,2 @@
+#-fomit-frame-pointer in default FULL_OPTIMIZATION will cause matchbox-panel segfault on n450
+FULL_OPTIMIZATION_n450 = "-fexpensive-optimizations -frename-registers -O2 -ggdb -feliminate-unused-debug-types"

Note that this patch only addresses the problem for the n450, and it would remain on the atom-pc. If we don't want to take Patch B, then we would need another solution for atom-pc. The only thing that comes to mind would be to add the above to the core gtk+ recipe in the form:

#-fomit-frame-pointer in default FULL_OPTIMIZATION will cause matchbox-panel segfault on atom-pc FULL_OPTIMIZATION_atom-pc = "-fexpensive-optimizations -frename-registers -O2 -ggdb -feliminate-unused-debug-types"

Thoughts?

Signature · 3 lines
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
#3 lore raw

Re: [PATCH A] n450: add optimization flags to gtk+ for n450 to avoid gcc core2 bug

Quoted 35 lines · Darren Hart
Quoted 25 lines · Darren Hart

Fixes [YOCTO #853]

Without these added optimization flags, the matchbox-panel (and possibly other)
applications would segfault. This patch applies the change only to the gtk+
recipe for the n450 bsp.

---
meta-n450/recipes-gnome/gtk+/gtk+_2.22.1.bbappend | 2 ++

1 files changed, 2 insertions(+), 0 deletions(-)

create mode 100644 meta-n450/recipes-gnome/gtk+/gtk+_2.22.1.bbappend

meta-n450/recipes-gnome/gtk+/gtk+_2.22.1.bbappend new file +1 -0
new file mode 100644
index 0000000..3af4187
@@ -0,0 +1,2 @@
+#-fomit-frame-pointer in default FULL_OPTIMIZATION will cause

matchbox-panel segfault on n450

meta-n450/recipes-gnome/gtk+/gtk+_2.22.1.bbappend

Quoted 2 lines
meta-n450/recipes-gnome/gtk+/gtk+_2.22.1.bbappend new file +1 -1
+FULL_OPTIMIZATION_n450 = "-fexpensive-optimizations
-frename-registers -O2 -ggdb -feliminate-unused-debug-types"

Note that this patch only addresses the problem for the n450, and it would remain on the atom-pc. If we don't want to take Patch B, then we would need another solution for atom-pc. The only thing that comes to mind would be to add the above to the core gtk+ recipe in the form:

Quoted 4 lines

#-fomit-frame-pointer in default FULL_OPTIMIZATION will cause matchbox-panel segfault on atom-pc FULL_OPTIMIZATION_atom-pc = "-fexpensive-optimizations -frename-registers -O2 -ggdb -feliminate-unused-debug-types"

Guess I should have looked at the recipe first :-) It already does this. I'll push the n450 patch per Saul's preference of minimal change.

--
Darren

Quoted 4 lines

Thoughts?

Signature · 3 lines
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
#5 lore raw
In reply to Darren Hart
Quoted 18 lines · Darren Hart

The root cause of the matchbox-panel segfault is the same as for the previous two bugs addressing the same issue:

o Bug 224 - [Netbook/emenlow] matchbox-panel segfault after X startup
o Bug 738 - matchbox-panel segfault after X startup

There apparently is a bug in gcc which results in the omission of some code leading to the segfault on core2. The following flags resolve the problem.

FULL_OPTIMIZATION = "-fexpensive-optimizations -frename-registers -O2 -ggdb -feliminate-unused-debug-types"

We can continue to patch each new machine's gtk+ recipe that is based on atom-pc.conf, or we can just add the above to tune-atom.conf. I've tested both on both the n450 and a Toshiba NB305 netbook, and each solution is effective.

Quoted 6 lines

Chaging it in tune-atom.conf likely fixes other bugs we either haven't solved yet or simply haven't hit. It is also much more invasive, and we may not be willing to accept that this close to 1.0. The patches follow, and we can include one or the other.

Preferences?

I'm in favour of C which is to add this to tune-atom.inc:

FULL_OPTIMIZATION_pn-gtk+ = "-fexpensive-optimizations -frename-registers -O2 -ggdb -feliminate-unused-debug-types"

:)

Cheers,

Richard

#6 lore raw

Great job finding this, Darren!

Quoted 54 lines

-----Original Message-----
From: [email protected] [mailto:poky- [email protected]] On Behalf Of Richard Purdie
Sent: Wednesday, March 16, 2011 5:14 PM
To: Darren Hart
Cc: [email protected]
Subject: Re: [poky] [PATCH A or B] Fix for bug #853 - matchbox-panel segfaults, X becomes unusable

Quoted 6 lines · Darren Hart

The root cause of the matchbox-panel segfault is the same as for the previous two bugs addressing the same issue:

o Bug 224 - [Netbook/emenlow] matchbox-panel segfault after X startup
o Bug 738 - matchbox-panel segfault after X startup

Quoted 8 lines

There apparently is a bug in gcc which results in the omission of some code leading to the segfault on core2. The following flags resolve the problem.

FULL_OPTIMIZATION = "-fexpensive-optimizations -frename-registers -O2 -ggdb -feliminate-unused-debug-types"

We can continue to patch each new machine's gtk+ recipe that is based

on

Quoted 6 lines

atom-pc.conf, or we can just add the above to tune-atom.conf. I've tested both on both the n450 and a Toshiba NB305 netbook, and each solution is effective.

Chaging it in tune-atom.conf likely fixes other bugs we either haven't solved yet or simply haven't hit. It is also much more invasive, and

we

Quoted 1 line

may not be willing to accept that this close to 1.0. The patches

follow,

Quoted 3 lines

and we can include one or the other.

Preferences?

I'm in favour of C which is to add this to tune-atom.inc:

FULL_OPTIMIZATION_pn-gtk+ = "-fexpensive-optimizations -frename- registers -O2 -ggdb -feliminate-unused-debug-types"

:)

Cheers,

Richard

_______________________________________________
poky mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/poky

#7 lore raw
Quoted 1 line · David C

Great job finding this, Darren!

Thanks, but credit also goes to Ke who confirmed that this was the issue after I dismissed it because my build didn't reflect the change! Go Team.

:)

--
Darren

Quoted 55 lines
Quoted 55 lines

-----Original Message-----
From: [email protected] [mailto:poky- [email protected]] On Behalf Of Richard Purdie
Sent: Wednesday, March 16, 2011 5:14 PM
To: Darren Hart
Cc: [email protected]
Subject: Re: [poky] [PATCH A or B] Fix for bug #853 - matchbox-panel segfaults, X becomes unusable

Quoted 6 lines · Darren Hart

The root cause of the matchbox-panel segfault is the same as for the previous two bugs addressing the same issue:

o Bug 224 - [Netbook/emenlow] matchbox-panel segfault after X startup
o Bug 738 - matchbox-panel segfault after X startup

Quoted 8 lines

There apparently is a bug in gcc which results in the omission of some code leading to the segfault on core2. The following flags resolve the problem.

FULL_OPTIMIZATION = "-fexpensive-optimizations -frename-registers -O2 -ggdb -feliminate-unused-debug-types"

We can continue to patch each new machine's gtk+ recipe that is based

on

Quoted 6 lines

atom-pc.conf, or we can just add the above to tune-atom.conf. I've tested both on both the n450 and a Toshiba NB305 netbook, and each solution is effective.

Chaging it in tune-atom.conf likely fixes other bugs we either haven't solved yet or simply haven't hit. It is also much more invasive, and

we

Quoted 1 line

may not be willing to accept that this close to 1.0. The patches

follow,

Quoted 3 lines

and we can include one or the other.

Preferences?

I'm in favour of C which is to add this to tune-atom.inc:

FULL_OPTIMIZATION_pn-gtk+ = "-fexpensive-optimizations -frename- registers -O2 -ggdb -feliminate-unused-debug-types"

:)

Cheers,

Richard

_______________________________________________
poky mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/poky

Signature · 3 lines
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
#8 lore raw
In reply to Richard Purdie
Quoted 28 lines · Richard Purdie
Quoted 18 lines · Darren Hart

The root cause of the matchbox-panel segfault is the same as for the previous two bugs addressing the same issue:

o Bug 224 - [Netbook/emenlow] matchbox-panel segfault after X startup
o Bug 738 - matchbox-panel segfault after X startup

There apparently is a bug in gcc which results in the omission of some code leading to the segfault on core2. The following flags resolve the problem.

FULL_OPTIMIZATION = "-fexpensive-optimizations -frename-registers -O2 -ggdb -feliminate-unused-debug-types"

We can continue to patch each new machine's gtk+ recipe that is based on atom-pc.conf, or we can just add the above to tune-atom.conf. I've tested both on both the n450 and a Toshiba NB305 netbook, and each solution is effective.

Quoted 6 lines

Chaging it in tune-atom.conf likely fixes other bugs we either haven't solved yet or simply haven't hit. It is also much more invasive, and we may not be willing to accept that this close to 1.0. The patches follow, and we can include one or the other.

Preferences?

I'm in favour of C which is to add this to tune-atom.inc:

Quoted 7 lines

FULL_OPTIMIZATION_pn-gtk+ = "-fexpensive-optimizations -frename-registers -O2 -ggdb -feliminate-unused-debug-types"

:)

Cheers,

Richard

I have an option D :)

i.e. in gtk+_2.22.1.bb, add:
FULL_OPTIMIZATION_core2= "-fexpensive-optimizations -frename-registers -O2 -ggdb -feliminate-unused-debug-types"

because this issue is caused by gcc optimization for core2 arch, so in theory, all machine with core2 arch setting will be affected, no only limited to atom machine

Regards
Ke

#9 lore raw
Quoted 40 lines · Yu Ke
Quoted 28 lines · Richard Purdie
Quoted 18 lines · Darren Hart

The root cause of the matchbox-panel segfault is the same as for the previous two bugs addressing the same issue:

o Bug 224 - [Netbook/emenlow] matchbox-panel segfault after X startup o Bug 738 - matchbox-panel segfault after X startup

There apparently is a bug in gcc which results in the omission of some code leading to the segfault on core2. The following flags resolve the problem.

FULL_OPTIMIZATION = "-fexpensive-optimizations -frename-registers -O2 -ggdb -feliminate-unused-debug-types"

We can continue to patch each new machine's gtk+ recipe that is based on atom-pc.conf, or we can just add the above to tune-atom.conf. I've tested both on both the n450 and a Toshiba NB305 netbook, and each solution is effective.

Quoted 6 lines

Chaging it in tune-atom.conf likely fixes other bugs we either haven't solved yet or simply haven't hit. It is also much more invasive, and we may not be willing to accept that this close to 1.0. The patches follow, and we can include one or the other.

Preferences?

I'm in favour of C which is to add this to tune-atom.inc:

Quoted 8 lines

FULL_OPTIMIZATION_pn-gtk+ = "-fexpensive-optimizations -frename-registers -O2 -ggdb -feliminate-unused-debug-types"

:)

Cheers,

Richard

I have an option D :)

Quoted 7 lines

i.e. in gtk+_2.22.1.bb, add: FULL_OPTIMIZATION_core2= "-fexpensive-optimizations -frename-registers -O2 -ggdb -feliminate-unused-debug-types"

because this issue is caused by gcc optimization for core2 arch, so in theory, all machine with core2 arch setting will be affected, no only limited to atom machine

There are apparently at least 4 ways to do this :-) RP has merged his change (version C) to bernard and I've tested it on atom-pc. I've removed the existing changes from the original gtk+ recipe and the various bbappends in meta-intel. I'm testing on n450 now. If that works I'll send the patch against gtk+ and commit those to bernard and master for meta-intel.

Signature · 3 lines
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
#10 lore raw
In reply to Yu Ke
Quoted 6 lines · Yu Ke
Quoted 3 lines · Richard Purdie

I'm in favour of C which is to add this to tune-atom.inc:

FULL_OPTIMIZATION_pn-gtk+ = "-fexpensive-optimizations -frename-registers -O2 -ggdb -feliminate-unused-debug-types"

Quoted 6 lines

I have an option D :)

i.e. in gtk+_2.22.1.bb, add:
FULL_OPTIMIZATION_core2= "-fexpensive-optimizations -frename-registers -O2 -ggdb -feliminate-unused-debug-types"

because this issue is caused by gcc optimization for core2 arch, so in theory, all machine with core2 arch setting will be affected, no only limited to atom machine

This wouldn't work as "core2" is PACKAGE_ARCH and PACKAGE_ARCH is not in OVERRIDES. I did briefly discuss this over jabber and you could do:

FULL_OPTIMIZATION_i586= "-fexpensive-optimizations -frename-registers -O2 -ggdb -feliminate-unused-debug-types"

since TARGET_ARCH (i586) is in OVERRIDES but this would then affect machines like qemux86 and I decided we didn't want to do that at this point in the release cycle.

Cheers,

Richard