From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: How to debug "org-clock-display: Args out of range: [48230 48230 48230 38618 38618 0 0 0 0 0 ...], 61" Date: Thu, 12 Jan 2012 17:56:22 -0500 Message-ID: <5046.1326408982@alphaville1> References: <20120106002125.GA32086@shi.workgroup> <8762gp3aqz.fsf@norang.ca> <20120112214110.GB29496@shi.workgroup> <4047.1326406324@alphaville1> Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([140.186.70.92]:44864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlTaL-0004Yv-6Z for emacs-orgmode@gnu.org; Thu, 12 Jan 2012 17:57:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RlTaJ-0003Gg-Qu for emacs-orgmode@gnu.org; Thu, 12 Jan 2012 17:57:29 -0500 Received: from g6t0186.atlanta.hp.com ([15.193.32.63]:15547) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlTaJ-000389-NO for emacs-orgmode@gnu.org; Thu, 12 Jan 2012 17:57:27 -0500 Received: from g5t0029.atlanta.hp.com (g5t0029.atlanta.hp.com [16.228.8.141]) by g6t0186.atlanta.hp.com (Postfix) with ESMTP id 950CE2C1DA for ; Thu, 12 Jan 2012 22:56:23 +0000 (UTC) In-Reply-To: Message from Nick Dokos of "Thu, 12 Jan 2012 17:12:04 EST." <4047.1326406324@alphaville1> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Cc: nicholas.dokos@hp.com, emacs-orgmode Nick Dokos wrote: > Gregor Zattler wrote: > > > > Debugger entered--Lisp error: (args-out-of-range [49569 49569 49569 39957 3= > > 9957 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] 61) > > aref([49569 49569 49569 39957 39957 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0= > > 0 0 0 0 0 0] 61) > > This tries to get the 61st element of a vector that has at most 30 or so > elements, hence the complaint. But of course, that's hardly > enlightening. However, the backtrace shows that this code is inside the > function org-clock-sum (in org-clock.el). And if you look at that > function, you see (where I have elided large swathes of code): > > (let* (... > (lmax 30) > (ltimes (make-vector lmax 0)) > ... > > So ltimes is a vector with *exactly* 30 elements. I would change that 30 > to 100 or so (something greater than 61 in any case) and retest. If that > fixes it, then we know the culprit and then we can dedice which is the > unreasonable one: the code or your subtree :-) > Or maybe that 61 is way off base. After all, there are only 5 non-trivial entries in the vector. The code that sets the level seems suspect to me: (let* ((headline-forced (get-text-property (point) :org-clock-force-headline-inclusion)) (headline-included (or (null headline-filter) (save-excursion (save-match-data (funcall headline-filter)))))) (setq level (- (match-end 1) (match-beginning 1))) What do match-beginning/match-end return if headline-filter is nil? The save-match-data is not done, so we get the results of whatever random search was done last before this code executed. Nick