From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lawrence Mitchell Newsgroups: gmane.emacs.bugs Subject: bug#7244: `characterp' signals overflow-error Date: Wed, 20 Oct 2010 17:56:59 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1287595239 11252 80.91.229.12 (20 Oct 2010 17:20:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 20 Oct 2010 17:20:39 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 20 19:20:37 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P8cL6-0003ux-P0 for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Oct 2010 19:20:37 +0200 Original-Received: from localhost ([127.0.0.1]:41826 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8cDW-00038r-Ey for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Oct 2010 13:12:46 -0400 Original-Received: from [140.186.70.92] (port=52738 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8cDQ-00038V-8d for bug-gnu-emacs@gnu.org; Wed, 20 Oct 2010 13:12:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P8cDN-0004rH-Pz for bug-gnu-emacs@gnu.org; Wed, 20 Oct 2010 13:12:40 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58826) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P8cDN-0004rB-OS for bug-gnu-emacs@gnu.org; Wed, 20 Oct 2010 13:12:37 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1P8c38-0005g8-74; Wed, 20 Oct 2010 13:02:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Lawrence Mitchell Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Oct 2010 17:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7244 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Original-Received: via spool by submit@debbugs.gnu.org id=B.128759409421819 (code B ref -1); Wed, 20 Oct 2010 17:02:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 20 Oct 2010 17:01:34 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P8c2f-0005fs-DD for submit@debbugs.gnu.org; Wed, 20 Oct 2010 13:01:33 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P8c2e-0005fm-4w for submit@debbugs.gnu.org; Wed, 20 Oct 2010 13:01:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P8c5o-0000qB-5c for submit@debbugs.gnu.org; Wed, 20 Oct 2010 13:05:21 -0400 Original-Received: from lists.gnu.org ([199.232.76.165]:56740) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P8c5o-0000Kb-35 for submit@debbugs.gnu.org; Wed, 20 Oct 2010 13:04:48 -0400 Original-Received: from [140.186.70.92] (port=43565 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8bzn-0005Qu-NK for bug-gnu-emacs@gnu.org; Wed, 20 Oct 2010 12:58:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P8bzl-00078L-Hp for bug-gnu-emacs@gnu.org; Wed, 20 Oct 2010 12:58:34 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:58127) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P8bzl-00077M-CM for bug-gnu-emacs@gnu.org; Wed, 20 Oct 2010 12:58:33 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1P8bzi-000617-8Q for bug-gnu-emacs@gnu.org; Wed, 20 Oct 2010 18:58:30 +0200 Original-Received: from garnet.epcc.ed.ac.uk ([129.215.56.222]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 20 Oct 2010 18:58:30 +0200 Original-Received: from wence by garnet.epcc.ed.ac.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 20 Oct 2010 18:58:30 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 39 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: garnet.epcc.ed.ac.uk User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (usg-unix-v) Cancel-Lock: sha1:HeelV+62NDkPhFLOIVSAZBg1YUU= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 20 Oct 2010 13:02:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:41013 Archived-At: MON KEY wrote: > On Mon, Oct 18, 2010 at 10:47 PM, Kenichi Handa wrote: >> In article , MON KEY writes: >>> (characterp 2536870911) signals overflow-error "2536870911") >>> ;=> Debugger entered--Lisp error: (overflow-error "2536870911") >>> Why should this happen esp. when `max-char' sits just below the definition in >>> src/character.c ?? >> The error is signaled by Lisp reader; i.e. before characterp >> is executed. > OK. I didn't realize this. > This said, I am not understanding _where_ the overflow boundary is, > e.g. following doesn't signal: > most-positive-fixnum > ;=> 536870911 (#o3777777777, #x1fffffff) > (characterp 536870913) > ;=> nil Fread does this: EMACS_INT n = (errno = 0, strtol (read_buffer, &endptr, 10)); So if the number to be read does not fit in a long int, then you'll get a range error in strtol which is where the overflow comes from. For you, most-positive-fixnum == 2^29 - 1, so LONG_MAX == 2^31 - 1 (2147483647). 2536870911 > 2147483647. So you get a range error when trying to convert the number with strtol. Lawrence -- Lawrence Mitchell