emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] How to debug "org-clock-display: Args out of range: [48230 48230


From: Nick Dokos
Subject: Re: [O] 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

Nick Dokos <address@hidden> wrote:

> Gregor Zattler <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]