Re: [O] How to debug "org-clock-display: Args out of range: [48230 48230 48230 38618 38618 0 0 0 0 0 ...], 61"
Gregor Zattler writes: > Hi Bernt, org-mode developers, > * Bernt Hansen [05. Jan. 2012]: >> Gregor Zattler writes: >>> I use org-mode to record my working time. If I want to know the >>> total time worked on a project I do a M-X org-clock-display. >>> >>> But this suddenly gives me this error message: >>> >>> org-clock-display: Args out of range: [48230 48230 48230 38618 38618 0 0 0 >>> 0 0 ...], 61 >>> >> >> If you generate a backtrace with uncompiled org source files you should >> get an indication of where the problem is. > > I did as you said but the backtrace is totally opaque to me: > Hi Gregor, Apologies for not responding sooner but you didn't send a copy directly to me (with reply-all) and my gmane access has been down for a week - so I'm just now catching up on the list traffic. I see from later posts that Nick has already provided details to figure out what is going on. Regards, Bernt
Re: [O] How to debug "org-clock-display: Args out of range: [48230 48230 48230 38618 38618 0 0 0 0 0 ...], 61"
Nick Dokos writes: > 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. Hmmm... the above snippet is from org-clock-sum, right? That means it is part of (while (re-search-backward re nil t) ...) and that's the search match-beginning/match-end are referring to. -- Until the next mail..., Stefan.
Re: [O] How to debug "org-clock-display: Args out of range: [48230 48230 48230 38618 38618 0 0 0 0 0 ...], 61"
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
Re: [O] How to debug "org-clock-display: Args out of range: [48230 48230 48230 38618 38618 0 0 0 0 0 ...], 61"
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 :-) Nick > (> (aref ltimes level) 0) > (or (> t1 0) (> (aref ltimes level) 0)) > (if (or (> t1 0) (> (aref ltimes level) 0)) (progn (when (or headline-inc= > luded headline-forced) (if headline-included (loop for l from 0 to level do= > (aset ltimes l (+ (aref ltimes l) t1 (setq time (aref ltimes level)) (= > goto-char (match-beginning 0)) (put-text-property (point) (point-at-eol) :o= > rg-clock-minutes time) (if headline-filter (save-excursion (save-match-data= > (while (> ... 1) (outline-up-heading 1 t) (put-text-property ... ... :org-= > clock-force-headline-inclusion t)) (setq t1 0) (loop for l from level t= > o (1- lmax) do (aset ltimes l 0 > (when (or (> t1 0) (> (aref ltimes level) 0)) (when (or headline-included= > headline-forced) (if headline-included (loop for l from 0 to level do (ase= > t ltimes l (+ (aref ltimes l) t1 (setq time (aref ltimes level)) (goto-= > char (match-beginning 0)) (put-text-property (point) (point-at-eol) :org-cl= > ock-minutes time) (if headline-filter (save-excursion (save-match-data (whi= > le (> (funcall outline-level) 1) (outline-up-heading 1 t) (put-text-propert= > y (point) (point-at-eol) :org-clock-force-headline-inclusion t)) (setq = > t1 0) (loop for l from level to (1- lmax) do (aset ltimes l 0))) > (let* ((headline-forced (get-text-property (point) :org-clock-force-headl= > ine-inclusion)) (headline-included (or (null headline-filter) (save-excursi= > on (save-match-data (funcall headline-filter)) (setq level (- (match-en= > d 1) (match-beginning 1))) (when (or (> t1 0) (> (aref ltimes level) 0)) (w= > hen (or headline-included headline-forced) (if headline-included (loop for = > l from 0 to level do (aset ltimes l (+ (aref ltimes l) t1 (setq time (a= > ref ltimes level)) (goto-char (match-beginning 0)) (put-text-property (poin= > t) (point-at-eol) :org-clock-minutes time) (if headline-filter (save-excurs= > ion (save-match-data (while (> ... 1) (outline-up-heading 1 t) (put-text-pr= > operty ... ... :org-clock-force-headline-inclusion t)) (setq t1 0) (loo= > p for l from level to (1- lmax) do (aset ltimes l 0 > (cond ((match-end 2) (setq ts (match-string 2) te (match-string 3) ts (or= > g-float-time (apply (quote encode-time) (org-parse-time-string ts))) te (or= > g-float-time (apply (quote encode-time) (org-parse-time-string te))) ts (if= > tstart (max ts tstart) ts) te (if tend (min te tend) te) dt (- te ts) t1 (= > if (> dt 0) (+ t1 (floor (/ dt 60))) t1))) ((match-end 4) (setq t1 (+ t1 (s= > tring-to-number (match-string 5)) (* 60 (string-to-number (match-string 4))= > (t (when (and org-clock-report-include-clocking-task (equal (org-clock= > ing-buffer) (current-buffer)) (equal (marker-position org-clock-hd-marker) = > (point)) tstart tend (>=3D (org-float-time org-clock-start-time) tstart) (<= > =3D (org-float-time org-clock-start-time) tend)) (let ((time (floor (- ... = > =2E..) 60))) (setq t1 (+ t1 time (let* ((headline-forced (get-text-prop= > erty (point) :org-clock-force-headline-inclusion)) (headline-included (or (= > null headline-filter) (save-excursion (save-match-data ...) (setq level= > (- (match-end 1) (match-beginning 1))) (when (or (> t1 0) (> (aref ltimes = > level) 0)) (when (or headline-included headline-forced) (if headline-includ= > ed (loop for l from 0 to level do (aset ltimes l ...))) (setq time (aref lt= > imes level)) (goto-char (match-beginning 0)) (put-text-property (point) (po= > int-at-eol) :org-clock-minutes time) (if headline-filter (save-excursion (s= > ave-match-data ... (setq t1 0) (loop for l from level to (1- lmax) do (= > aset ltimes l 0)) > (while (re-search-backward re nil t) (cond ((match-end 2) (setq ts (match= > -string 2) te (match-string 3) ts (org-float-time (apply (quote encode-time= > ) (org-parse-time-string ts))) te (org-float-time (apply (quote encode-time= > ) (org-parse-time-string te))) ts (if tstart (max ts tstart) ts) te (if ten= > d (min te tend) te) dt (- te ts) t1 (if (> dt 0) (+ t1 (floor (
Re: [O] How to debug "org-clock-display: Args out of range: [48230 48230 48230 38618 38618 0 0 0 0 0 ...], 61"
Hi Bernt, org-mode developers, * Bernt Hansen [05. Jan. 2012]: > Gregor Zattler writes: >> I use org-mode to record my working time. If I want to know the >> total time worked on a project I do a M-X org-clock-display. >> >> But this suddenly gives me this error message: >> >> org-clock-display: Args out of range: [48230 48230 48230 38618 38618 0 0 0 0 >> 0 ...], 61 >> >> I checked the org file but do not find any irregularities in the >> clock tables. I even deleted all individual `=> HH:MM' time >> ranges but this did not help. With something like bisecting I narrowed the problem down to a few headlines consisting of subheadings, bullet lists, checkboxed lists a few inline tasks etc. All in all 253 lines of text. It looks totally harmless to me. >> This happens with emacs23.3, org-mode 6.33 as with Emacs-snapshot >> and newest org-mode so I assume it is something like a syntax >> error in my org file. In both cases I startet Emacs with -Q so this is not a configuration issue -- besides a few #+STARTUP lines at the beginning orf the org file. >> Any idea where to look for the cause of the error? > > If you generate a backtrace with uncompiled org source files you should > get an indication of where the problem is. I did as you said but the backtrace is totally opaque to me: Debugger entered--Lisp error: (args-out-of-range [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) 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) (> (aref ltimes level) 0) (or (> t1 0) (> (aref ltimes level) 0)) (if (or (> t1 0) (> (aref ltimes level) 0)) (progn (when (or headline-included headline-forced) (if headline-included (loop for l from 0 to level do (aset ltimes l (+ (aref ltimes l) t1 (setq time (aref ltimes level)) (goto-char (match-beginning 0)) (put-text-property (point) (point-at-eol) :org-clock-minutes time) (if headline-filter (save-excursion (save-match-data (while (> ... 1) (outline-up-heading 1 t) (put-text-property ... ... :org-clock-force-headline-inclusion t)) (setq t1 0) (loop for l from level to (1- lmax) do (aset ltimes l 0 (when (or (> t1 0) (> (aref ltimes level) 0)) (when (or headline-included headline-forced) (if headline-included (loop for l from 0 to level do (aset ltimes l (+ (aref ltimes l) t1 (setq time (aref ltimes level)) (goto-char (match-beginning 0)) (put-text-property (point) (point-at-eol) :org-clock-minutes time) (if headline-filter (save-excursion (save-match-data (while (> (funcall outline-level) 1) (outline-up-heading 1 t) (put-text-property (point) (point-at-eol) :org-clock-force-headline-inclusion t)) (setq t1 0) (loop for l from level to (1- lmax) do (aset ltimes l 0))) (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))) (when (or (> t1 0) (> (aref ltimes level) 0)) (when (or headline-included headline-forced) (if headline-included (loop for l from 0 to level do (aset ltimes l (+ (aref ltimes l) t1 (setq time (aref ltimes level)) (goto-char (match-beginning 0)) (put-text-property (point) (point-at-eol) :org-clock-minutes time) (if headline-filter (save-excursion (save-match-data (while (> ... 1) (outline-up-heading 1 t) (put-text-property ... ... :org-clock-force-headline-inclusion t)) (setq t1 0) (loop for l from level to (1- lmax) do (aset ltimes l 0 (cond ((match-end 2) (setq ts (match-string 2) te (match-string 3) ts (org-float-time (apply (quote encode-time) (org-parse-time-string ts))) te (org-float-time (apply (quote encode-time) (org-parse-time-string te))) ts (if tstart (max ts tstart) ts) te (if tend (min te tend) te) dt (- te ts) t1 (if (> dt 0) (+ t1 (floor (/ dt 60))) t1))) ((match-end 4) (setq t1 (+ t1 (string-to-number (match-string 5)) (* 60 (string-to-number (match-string 4)) (t (when (and org-clock-report-include-clocking-task (equal (org-clocking-buffer) (current-buffer)) (equal (marker-position org-clock-hd-marker) (point)) tstart tend (>= (org-float-time org-clock-start-time) tstart) (<= (org-float-time org-clock-start-time) tend)) (let ((time (floor (- ... ...) 60))) (setq t1 (+ t1 time (let* ((headline-forced (get-text-property (point) :org-clock-force-headline-inclusion)) (headline-included (or (null headline-filter) (save-excursion (save-match-data ...) (setq level (- (match-end 1) (match-beginning 1))) (when (or (> t1 0) (> (aref ltimes level) 0)) (when (or headline-included headline-forced) (if headline-included (loop for l from 0 to level do (aset ltimes l ...))) (setq time (aref ltimes level)) (goto-char (match-beginning 0)) (put-text-property (point) (point-at-eol) :org-clock-minutes time) (if headline-filter (save-excursion (save-match-data ... (setq t1 0) (loop for
Re: [O] How to debug "org-clock-display: Args out of range: [48230 48230 48230 38618 38618 0 0 0 0 0 ...], 61"
Gregor Zattler writes: > Hi org-mode developers and -users, > > I use org-mode to record my working time. If I wnt to know the > total time worked on a project I do a M-X org-clock-display. > > But this suddenly gives me this error message: > > org-clock-display: Args out of range: [48230 48230 48230 38618 38618 0 0 0 0 > 0 ...], 61 > > I checked the org file but do not find any irregularities in the > clock tables. I even deleted all individual `=> HH:MM' time > ranges but this did not help. > > This happens with emacs23.3, org-mode 6.33 as with Emacs-snapshot > and newest org-mode so I assume it is something like a syntax > error in my org file. > > Any idea where to look for the cause of the error? If you generate a backtrace with uncompiled org source files you should get an indication of where the problem is. Regards, Bernt
[O] How to debug "org-clock-display: Args out of range: [48230 48230 48230 38618 38618 0 0 0 0 0 ...], 61"
Hi org-mode developers and -users, I use org-mode to record my working time. If I wnt to know the total time worked on a project I do a M-X org-clock-display. But this suddenly gives me this error message: org-clock-display: Args out of range: [48230 48230 48230 38618 38618 0 0 0 0 0 ...], 61 I checked the org file but do not find any irregularities in the clock tables. I even deleted all individual `=> HH:MM' time ranges but this did not help. This happens with emacs23.3, org-mode 6.33 as with Emacs-snapshot and newest org-mode so I assume it is something like a syntax error in my org file. Any idea where to look for the cause of the error? Ciao, Gregor -- -... --- .-. . -.. ..--.. ...-.-