emacs crashes with "Arithmetic error"

Bug #684613 reported by Benoit Montagu
78
This bug affects 11 people
Affects Status Importance Assigned to Milestone
emacs23 (Ubuntu)
Fix Released
High
Unassigned
Lucid
Fix Released
High
Unassigned
Maverick
Fix Released
High
Unassigned

Bug Description

The fix for bug #445402 introduced a regression for many non-gnome non-KDE users. Affected package versions are 23.1+1-4ubuntu7.1 and 23.1+1-4ubuntu7.1+maverick1, fixed versions are
23.1+1-4ubuntu7.2 and 23.1+1-4ubuntu7.2+maverick1

workaround: downgrade to version 23.1+1-4ubuntu7

original report follows:
Binary package hint: emacs23

In graphic mode, emacs fails to start
$ emacs -q -Q
Arithmetic error
$

In terminal mode (option -nw), however, it works fine.

It happens since the upgrade to the version 23.1+1-4ubuntu7. It worked fine with earlier versions.

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: emacs 23.1+1-4ubuntu7.1+maverick1
ProcVersionSignature: Ubuntu 2.6.35-23.41-generic 2.6.35.7
Uname: Linux 2.6.35-23-generic i686
Architecture: i386
Date: Fri Dec 3 09:28:54 2010
PackageArchitecture: all
ProcEnviron:
 LANGUAGE=fr_FR.utf8
 PATH=(custom, no user)
 LANG=fr_FR.utf8
 LC_MESSAGES=fr_FR.utf8
 SHELL=/bin/bash
SourcePackage: emacs23

Revision history for this message
Benoit Montagu (bmontagu) wrote :
Revision history for this message
Jeff Barczewski (jeff-barczewski) wrote :

I have this problem too, please increase priority since emacs gtk is dead.

This also affects ubuntu-lucid 10.04.

Emacs was working fine until the recent upgrades of other libraries like libc?

Same issue, works in terminal mode but gtk mode throws Arithmetic error and exits.

Linux 2.6.32-26-generic #48-Ubuntu SMP Wed Nov 24 09:00:03 UTC 2010 i686 GNU/Linux

Thanks,

Jeff

Revision history for this message
era (era) wrote :

So does downgrading libc6 to the previous version fix it for you, as a workaround?

Revision history for this message
Reinhard Tartler (siretart) wrote :

I'm not able to reproduce this neither with libc6 version 2.11.1-0ubuntu7.5 nor
2.11.1-0ubuntu7.6

Can you guys please elaborate a bit more on your environment? Do you use something else than Gnome? What gtk theme do you have activated?

Changed in emacs23 (Ubuntu):
importance: Undecided → High
status: New → Incomplete
Revision history for this message
Yotam Medini (yotam-medini-gmail) wrote :

Reinhard Tartler,

This happens to me immediately and consistently
on Xubuntu-10.04 running on a very low-memory machine (about 180MB).

Revision history for this message
Jeff Barczewski (jeff-barczewski) wrote :

Reinhard,

I think you hit on something, I hadn't tried.

It appears to not be problem in gnome (I was able to bring it up fine in gnome) but when I switch to lubuntu session. I had switched session to lubuntu to save memory like Yotam.

Just a note though, everything was working fine in lubuntu too, until recent updates maybe a week ago. Here is what my apt/history.log shows from the recent past (below)... something in here broke it, just not sure what.

If you have any ideas on what I could try downgrading, I am happy to do so.

Thanks,

Jeff

Start-Date: 2010-12-09 13:17:57
Upgrade: libkrb5-3 (1.8.1+dfsg-2ubuntu0.3, 1.8.1+dfsg-2ubuntu0.4), libkrb5support0 (1.8.1+dfsg-2ubuntu0.3, 1.8.1+dfsg-2ubuntu0.4), emacs (23.1+1-4ubuntu7, 23.1+1-4ubuntu7.1), emacs23-bin-common (23.1+1-4ubuntu7, 23.1+1-4ubuntu7.1), git-gui (1.7.0.4-1, 1.7.0.4-1ubuntu0.1), libk5crypto3 (1.8.1+dfsg-2ubuntu0.3, 1.8.1+dfsg-2ubuntu0.4), update-inetd (4.35, 4.35ubuntu0.1), emacs23-common (23.1+1-4ubuntu7, 23.1+1-4ubuntu7.1), gitk (1.7.0.4-1, 1.7.0.4-1ubuntu0.1), emacs23 (23.1+1-4ubuntu7, 23.1+1-4ubuntu7.1), git-core (1.7.0.4-1, 1.7.0.4-1ubuntu0.1), libgssapi-krb5-2 (1.8.1+dfsg-2ubuntu0.3, 1.8.1+dfsg-2ubuntu0.4)
End-Date: 2010-12-09 13:18:27

Start-Date: 2010-12-10 09:23:07
Upgrade: xulrunner-1.9.2 (1.9.2.12+build1+nobinonly-0ubuntu0.10.04.1, 1.9.2.13+build3+nobinonly-0ubuntu0.10.04.1), firefox (3.6.12+build1+nobinonly-0ubuntu0.10.04.1, 3.6.13+build3+nobinonly-0ubuntu0.10.04.1), firefox-gnome-support (3.6.12+build1+nobinonly-0ubuntu0.10.04.1, 3.6.13+build3+nobinonly-0ubuntu0.10.04.1), firefox-branding (3.6.12+build1+nobinonly-0ubuntu0.10.04.1, 3.6.13+build3+nobinonly-0ubuntu0.10.04.1)
End-Date: 2010-12-10 09:23:37

Start-Date: 2010-12-13 10:56:12
Install: fakeroot (1.14.4-1ubuntu1), g++-4.4 (4.4.3-4ubuntu5), libstdc++6-4.4-dev (4.4.3-4ubuntu5), g++ (4.4.3-1ubuntu1), libreadline5-dev (5.2-7build1), libssl-dev (0.9.8k-7ubuntu8.5), zlib1g-dev (1.2.3.3.dfsg-15ubuntu1), dpkg-dev (1.15.5.6ubuntu4.4), xz-utils (4.999.9beta+20091116-1), libncurses5-dev (5.7+20090803-2ubuntu3), libreadline5 (5.2-7build1), build-essential (11.4build1)
End-Date: 2010-12-13 10:56:33

Start-Date: 2010-12-13 16:59:06
Upgrade: libc-bin (2.11.1-0ubuntu7.5, 2.11.1-0ubuntu7.6), gnome-settings-daemon (2.30.1-0ubuntu1, 2.30.1-0ubuntu1.1), libc-dev-bin (2.11.1-0ubuntu7.5, 2.11.1-0ubuntu7.6), libc6-i686 (2.11.1-0ubuntu7.5, 2.11.1-0ubuntu7.6), libc6-dev (2.11.1-0ubuntu7.5, 2.11.1-0ubuntu7.6), libc6 (2.11.1-0ubuntu7.5, 2.11.1-0ubuntu7.6)
End-Date: 2010-12-13 16:59:29

Start-Date: 2010-12-13 17:23:31
Install: sqlite3 (3.6.22-1)
End-Date: 2010-12-13 17:23:34

Revision history for this message
Benoit Montagu (bmontagu) wrote :

I am using Lubuntu (LXDE + Openbox). In any case, I am not using Gnome.

Revision history for this message
Mikael Hjelm (j-m-hjelm) wrote :

Lubuntu for me too. As stated it has worked perfectly until recent update.

Revision history for this message
Haruka YAGNI (hyagni) wrote :

I have the same problem in Ubuntu 10.10.
The cause was upgrading emacs23 (and related packages) from 23.1-4ubuntu7 to 23.1-4ubuntu7.1+maverick1.

By downgrading, I solved this problem. However, I am sure that something is wrong with the new package.
I would like developers to fix it.

Revision history for this message
kantor (andreagiaccherini) wrote :

It affects lubuntu 10.04 too, after an upgrade a weeks ago.

Revision history for this message
mattsl (matts-lindstrom) wrote :

I'm experiencing the same problem: using LXDE session under ubuntu lucid

Revision history for this message
Mikael Hjelm (j-m-hjelm) wrote :

What would be required to have this flagged as confirmed rather than incomplete?

This related?
http://superuser.com/questions/139436/how-to-fix-emacs-client-error-arithmetic-error

Revision history for this message
Urs Fleisch (ufleisch) wrote :

I have this bug in Lubuntu 10.04 and Lubuntu 10.10 since the upgrade emacs23-lucid 23.1+1-4ubuntu7 -> 23.1+1-4ubuntu7.1+maverick1. When downgrading the problem does no longer occur.
When I start a Kubuntu session, emacs starts normally, the Arithmetic error happens in Lubuntu and LXDE sessions. Starting emacs without customizations (e.g. without a black background as reported in the link at #12) does not help. As there are no debug packages available, I cannot provide a stack trace.

Revision history for this message
Urs Fleisch (ufleisch) wrote :

Maybe it is something with the fonts: I can start emacs when specifying a font, e.g.

emacs -fn fixed
emacs -fn lucida
emacs -fn courier

However, the font is very small and the initial window width is large. I can then manually set a larger font, e.g. with (set-face-font 'default "-Misc-Fixed-Medium-R-Normal--14-130-75-75-C-70-ISO8859-1").

Revision history for this message
Fabio Bossi (fabio-bossi-deactivatedaccount) wrote :

Same problem for me. The font workaround applies.

Revision history for this message
Jeff Barczewski (jeff-barczewski) wrote :

The font work around allows it to start for me too. It is really small and one has to reset font to use.

It appears that many of the fonts that come up in the selection box don't work .

So that might be a good clue on what the problem is regarding emacs and lxde/lubuntu, something to do with fonts not being available in lxde/lubuntu??

Revision history for this message
Taleman (tapio-lehtonen) wrote :

Bug seen here.

taleman@myrsky:~/Work/Satatuuli/Laskunkirjoitus$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.04.2 LTS
Release: 10.04
Codename: lucid

Using LXDE desktop.

font workaroud allows emacs23 to start.

Revision history for this message
ozonehole (taibei) wrote :

I'm also seeing this error, and like the others have said, it all worked fine until a recent update. I'm running Lubuntu (10.10). The font workaround also works for me, though it sure is a nuisance. Hope it gets fixed soon.

Revision history for this message
oican (ozgurican) wrote : Re: [Bug 684613] Re: emacs crashes with "Arithmetic error"

@ozonehole
It is EXACTLY same here.

By the way i'm currently using LXDE because
of the bug [Bug 526572] and unable to use KDE or Gnome. This emacs bug
does not reproduce itself
under Gnome or KDE as far as i see.

On Thu, Feb 17, 2011 at 2:56 AM, ozonehole <email address hidden> wrote:
>
> I'm also seeing this error, and like the others have said, it all worked
> fine until a recent update. I'm running Lubuntu (10.10). The font
> workaround also works for me, though it sure is a nuisance. Hope it gets
> fixed soon.
>
> --
> You received this bug notification because you are a direct subscriber
> of the bug.
> https://bugs.launchpad.net/bugs/684613
>
> Title:
>  emacs crashes with "Arithmetic error"

--
Ozgur

Revision history for this message
Christopher J. Shaker (cjshaker) wrote :

Same 'Arithmetic error' emacs crash, font workaround also does work for me. LUbuntu 10.10, on top of Ubuntu server:

cjshaker@ubuntu2: uname -a
Linux ubuntu2 2.6.35-25-server #44-Ubuntu SMP Fri Jan 21 19:09:14 UTC 2011 x86_64 GNU/Linux
cjshaker@ubuntu2:

Chris Shaker

Revision history for this message
Christopher J. Shaker (cjshaker) wrote :

Another workaround is to use the xemacs21 package instead. Works great for me on Lubuntu.

Chris Shaker

Revision history for this message
Urs Fleisch (ufleisch) wrote :
Download full text (6.5 KiB)

I built the emacs packages myself with debugging information. The crash happens at fringe.c:1214

(gdb) r
Program received signal SIGFPE, Arithmetic exception.
0x08126361 in compute_fringe_widths (f=0x85d8d00, redraw=1) at fringe.c:1214
(gdb) bt
#0 0x08126361 in compute_fringe_widths (f=0x85d8d00, redraw=1) at fringe.c:1214
#1 0x081094ed in x_new_font (f=0x85d8d00, font_object=141700660, fontset=2) at xterm.c:8372
#2 0x08064ce9 in x_set_font (f=0x85d8d00, arg=141729051, oldval=138348745) at frame.c:3445
#3 0x08063a3b in x_set_frame_parameters (f=0x85d8d00, alist=138348745) at frame.c:3017
#4 0x080662b3 in x_default_parameter (f=0x85d8d00, alist=139436189, prop=138561249, deflt=141700660, xprop=0x825029a "font", xclass=0x8250295 "Font", type=RES_TYPE_STRING) at frame.c:4130
#5 0x08113b6b in x_default_font_parameter (f=0x85d8d00, parms=139436189) at xfns.c:3043
#6 0x0811444c in Fx_create_frame (parms=139436189) at xfns.c:3257
#7 0x081cc469 in Ffuncall (nargs=2, args=0xbfffe510) at eval.c:3045
#8 0x08209371 in Fbyte_code (bytestr=136975739, vector=136975756, maxdepth=40) at bytecode.c:678
(..)
The code there is

(gdb) l
1209 {
1210 int left_wid = left_fringe_width >= 0 ? left_fringe_width : -left_fringe_width;
1211 int right_wid = right_fringe_width >= 0 ? right_fringe_width : -right_fringe_width;
1212 int conf_wid = left_wid + right_wid;
1213 int font_wid = FRAME_COLUMN_WIDTH (f);
1214 int cols = (left_wid + right_wid + font_wid-1) / font_wid;
1215 int real_wid = cols * font_wid;
1216 if (left_wid && right_wid)
1217 {
1218 if (left_fringe_width < 0)

A division by zero occurs because font_wid is 0.

(gdb) p font_wid
$3 = 0
(gdb) p left_wid
$4 = 8
(gdb) p right_wid
$5 = 8

font_wid is calculated using FRAME_COLUMN_WIDTH, which is defined in frame.h, 868:
#define FRAME_COLUMN_WIDTH(F) ((F)->column_width)

(gdb) p *f
$1 = {size = 1073742869, next = 0x85be378, name = 141729355, icon_name = 138348745, title = 138348745, focus_frame = 138348745, root_window = 140609412, selected_window = 140609412, minibuffer_window = 140104924, param_alist = 139429197, scroll_bars = 138348745, condemned_scroll_bars = 138348745, menu_bar_items = 138348745, face_alist = 138348745, menu_bar_vector = 138348745, buffer_predicate = 138348745, buffer_list = 139434141, buried_buffer_list = 138348745, menu_bar_window = 138348745, tool_bar_window = 138348745, tool_bar_items = 138348745, desired_tool_bar_string = 138348745, current_tool_bar_string = 138348745, face_cache = 0x0, menu_bar_items_used = 0, namebuf = 0x0, current_pool = 0x0, desired_pool = 0x0, desired_matrix = 0x0, current_matrix = 0x0, glyphs_initialized_p = 0, resized_p = 0, force_flush_display_p = 0, default_face_done_p = 0, already_hscrolled_p = 0, updated_p = 0, minimize_tool_bar_window_p = 0, tool_bar_lines = 0, n_tool_bar_rows = 0, n_tool_bar_items = 0, decode_mode_spec_buffer = 0x0, insert_line_cost = 0x0, delete_line_cost = 0x0, insert_n_lines_cost = 0x0, delete_n_lines_cost = 0x0, text_lines = 10, text_cols = 10, total_lines = 0, total_cols = 10, new_text_lines = 0, new_text_cols = 0, left_pos = 0, top_pos = 0, pixel_height = 0, pixel_width = 0, ...

Read more...

Revision history for this message
Urs Fleisch (ufleisch) wrote :

And here's the patch...

tags: added: patch
Changed in emacs23 (Ubuntu):
status: Incomplete → In Progress
Changed in emacs23 (Ubuntu Lucid):
importance: Undecided → High
Changed in emacs23 (Ubuntu Maverick):
importance: Undecided → High
Changed in emacs23 (Ubuntu Lucid):
status: New → In Progress
Changed in emacs23 (Ubuntu):
status: In Progress → Fix Released
Changed in emacs23 (Ubuntu Maverick):
status: New → In Progress
Revision history for this message
Reinhard Tartler (siretart) wrote :

I've now uploaded Urs' patch to lucid and maverick, thanks a lot for the
patch.

I guess this bug description needs to be updated to confirm to the SRU policy

--
Gruesse/greetings,
Reinhard Tartler, KeyID 945348A4

tags: added: verification-needed
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Accepted emacs23 into maverick-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in emacs23 (Ubuntu Maverick):
status: In Progress → Fix Committed
Changed in emacs23 (Ubuntu Lucid):
status: In Progress → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote :

Accepted emacs23 into lucid-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

tags: added: regression-update
description: updated
Revision history for this message
Reinhard Tartler (siretart) wrote : Re: [Bug 684613] Please test proposed package

On Fri, Mar 04, 2011 at 18:40:41 (CET), Martin Pitt wrote:

> Accepted emacs23 into lucid-proposed, the package will build now and be
> available in a few hours. Please test and give feedback here. See
> https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to
> enable and use -proposed. Thank you in advance!

Package version 23.1+1-4ubuntu7.2 works for me in a lucid environment
as expected. I'd still like to see reports from people not running Gnome
nor KDE, since only those were affected by the problem this update rectifies

--
Gruesse/greetings,
Reinhard Tartler, KeyID 945348A4

Revision history for this message
Andrey Bondarenko (abone) wrote :

> Accepted emacs23 into maverick-proposed, the package will build now and be
> available in a few hours. Please test and give feedback here. See >
> https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to
> enable and use -proposed. Thank you in advance!

Package version 23.1+1-4ubuntu7.2+maverick1 in a maverick environment works
for me. I'm able to start GUI emacs in Lubuntu desktop session. Going to use this
version and will report if I hit any regression.

Martin Pitt (pitti)
tags: added: verification-done-maverick
Revision history for this message
Mikael Hjelm (j-m-hjelm) wrote :

I second #28,
Tested in Lubuntu maverick.
Will try in Lucid on another computer.

Revision history for this message
Mikael Hjelm (j-m-hjelm) wrote :

Tested in lucid and it seems to work.

Version 23.1+1-4ubuntu7

Revision history for this message
Jeff Barczewski (jeff-barczewski) wrote :

Tested 23.1+1-4ubuntu7.2 in Lubuntu lucid and it works

Revision history for this message
Mikael Hjelm (j-m-hjelm) wrote :

Sorry meant 23.1+1-4ubuntu7.2 in #30.
Using show in aptsh i do not see the last .2 in the version string, shouldn't i ?

Mikael Hjelm (j-m-hjelm)
tags: added: verification-done-lucid
removed: verification-needed
Martin Pitt (pitti)
tags: added: verification-done
removed: verification-done-lucid verification-done-maverick
Revision history for this message
Fabio Bossi (fabio-bossi-deactivatedaccount) wrote :

Proposed patch works for me too.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package emacs23 - 23.1+1-4ubuntu7.2

---------------
emacs23 (23.1+1-4ubuntu7.2) lucid-proposed; urgency=low

  * Amend fix-huge-fonts.diff to gracefully handle the case that
    the API read_xft_dpi returns 0.0. Analysis and proposed patch
    thanks to Urs Fleisch! Fixes LP: #684613
 -- Reinhard Tartler <email address hidden> Fri, 04 Mar 2011 08:06:29 +0100

Changed in emacs23 (Ubuntu Lucid):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package emacs23 - 23.1+1-4ubuntu7.2+maverick1

---------------
emacs23 (23.1+1-4ubuntu7.2+maverick1) maverick-proposed; urgency=low

  * No-change upload to maverick-proposed

emacs23 (23.1+1-4ubuntu7.2) lucid-proposed; urgency=low

  * Amend fix-huge-fonts.diff to gracefully handle the case that
    the API read_xft_dpi returns 0.0. Analysis and proposed patch
    thanks to Urs Fleisch! Fixes LP: #684613
 -- Reinhard Tartler <email address hidden> Fri, 04 Mar 2011 08:13:23 +0100

Changed in emacs23 (Ubuntu Maverick):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.