extra/enlightenment: fix segfault on start

enlightenment_start stops very quickly with a segfault:
(gdb) bt
 #0  0xb6bcba1c in pause () from /usr/lib/libpthread.so.0
 #1  <signal handler called>
 #2  0x0007672c in e_desk_show ()
 #3  0x0010ace8 in e_zone_desk_count_set ()
 #4  0x00000000 in ?? ()

After recompiling with debug symbols, I noticed this is due to
some memory corruption, and found an upstream patch that fixes the
problem (applied in their enlightenment-0.18 branch but not in
release 0.18.8):
http://git.enlightenment.org/core/enlightenment.git/commit/?h=enlightenment-0.18&id=590eb392f1438d2cde775a93aa1178c61b75e9e7

Technically, the bug is also present on x86, but does not cause a
segfault.
This commit is contained in:
Nicolas Boichat 2014-07-13 10:15:42 +08:00
parent ad7ae005a7
commit bdc766ed1b
2 changed files with 39 additions and 3 deletions

View file

@ -1,9 +1,12 @@
# Maintainer: Ronald van Haren <ronald@archlinux.org>
# Contributor: Enlightenment Developers <enlightenment-devel@enlightenment.org>>
# ALARM: Nicolas Boichat <nicolas@boichat.ch>
# - Add upstream patch to fix overflow in e_desk.c
pkgname=enlightenment
pkgver=0.18.8
pkgrel=1
pkgrel=1.1
pkgdesc="Enlightenment window manager"
arch=('i686' 'x86_64')
url="http://www.enlightenment.org"
@ -17,9 +20,16 @@ conflicts=("enlightenment17")
replaces=("enlightenment17")
backup=('etc/enlightenment/sysactions.conf'
'etc/xdg/menus/enlightenment.menu')
source=(http://download.enlightenment.org/rel/apps/${pkgname}/$pkgname-$pkgver.tar.gz)
source=(http://download.enlightenment.org/rel/apps/${pkgname}/$pkgname-$pkgver.tar.gz
enlightenment-0.18.8-e-desk-overflow.patch)
install=enlightenment.install
sha1sums=('71d6212fc55ba65a47d656b0bc4891684445e3ff')
sha1sums=('71d6212fc55ba65a47d656b0bc4891684445e3ff'
'd915cfde817dddd9e2ecf673aea53dfd06344813')
prepare() {
cd "${srcdir}/${pkgname}-${pkgver}"
patch -p1 -i "${srcdir}/enlightenment-0.18.8-e-desk-overflow.patch"
}
build() {
cd "${srcdir}/${pkgname}-${pkgver}"

View file

@ -0,0 +1,26 @@
From 9e6c276905b13fb4a2d795fee5f98d52aecb354b Mon Sep 17 00:00:00 2001
From: Carlos Rafael Giani <dv@pseudoterminal.org>
Date: Sun, 1 Jun 2014 14:45:49 +0200
Subject: bugfix: Fix buffer overflow in desk_show.
Was the wrong structure type which caused writing after the allocated
size and was generally bad and wrong.
Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
diff --git a/src/bin/e_desk.c b/src/bin/e_desk.c
index 8c97364..854946a 100644
--- a/src/bin/e_desk.c
+++ b/src/bin/e_desk.c
@@ -224,7 +224,7 @@ e_desk_show(E_Desk *desk)
E_Event_Desk_Show *ev;
E_Event_Desk_Before_Show *eev;
E_Event_Desk_After_Show *eeev;
- Edje_Message_Float_Set *msg;
+ Edje_Message_Int_Set *msg;
Eina_List *l;
E_Shelf *es;
int was_zone = 0, x, y, dx = 0, dy = 0;
--
cgit v0.10.1