emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Cc: nicholas.dokos@hp.com
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:12:04 -0500	[thread overview]
Message-ID: <4047.1326406324@alphaville1> (raw)
In-Reply-To: Message from Gregor Zattler <telegraph@gmx.net> of "Thu, 12 Jan 2012 22:41:11 +0100." <20120112214110.GB29496@shi.workgroup>

Gregor Zattler <telegraph@gmx.net> 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 (/ dt 60))) t=
> 1))) ((match-end 4) (setq t1 (+ t1 (string-to-number (match-string 5)) (* 6=
> 0 (string-to-number (match-string 4)))))) (t (when (and org-clock-report-in=
> clude-clocking-task (equal (org-clocking-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-ti=
> me) tend)) (let ((time (floor ... 60))) (setq t1 (+ t1 time)))) (let* ((hea=
> dline-forced (get-text-property (point) :org-clock-force-headline-inclusion=
> )) (headline-included (or (null headline-filter) (save-excursion ...)))) (s=
> etq level (- (match-end 1) (match-beginning 1))) (when (or (> t1 0) (> (are=
> f ltimes level) 0)) (when (or headline-included headline-forced) (if headli=
> ne-included (loop for l from 0 to level do ...)) (setq time (aref ltimes le=
> vel)) (goto-char (match-beginning 0)) (put-text-property (point) (point-at-=
> eol) :org-clock-minutes time) (if headline-filter (save-excursion ...))) (s=
> etq t1 0) (loop for l from level to (1- lmax) do (aset ltimes l 0)))))))
>   (save-excursion (goto-char (point-max)) (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 tend (min te tend) te) dt (- te ts) t1=
>  (if (> dt 0) (+ t1 (floor ...)) t1))) ((match-end 4) (setq t1 (+ t1 (strin=
> g-to-number (match-string 5)) (* 60 (string-to-number ...))))) (t (when (an=
> d org-clock-report-include-clocking-task (equal (org-clocking-buffer) (curr=
> ent-buffer)) (equal (marker-position org-clock-hd-marker) (point)) tstart t=
> end (>=3D (org-float-time org-clock-start-time) tstart) (<=3D (org-float-ti=
> me org-clock-start-time) tend)) (let ((time ...)) (setq t1 (+ t1 time)))) (=
> let* ((headline-forced (get-text-property ... :org-clock-force-headline-inc=
> lusion)) (headline-included (or ... ...))) (setq level (- (match-end 1) (ma=
> tch-beginning 1))) (when (or (> t1 0) (> ... 0)) (when (or headline-include=
> d headline-forced) (if headline-included ...) (setq time ...) (goto-char ..=
> =2E) (put-text-property ... ... :org-clock-minutes time) (if headline-filte=
> r ...)) (setq t1 0) (loop for l from level to (1- lmax) do (aset ltimes l 0=
> ))))))) (setq org-clock-file-total-minutes (aref ltimes 0)))
>   (let* ((bmp (buffer-modified-p)) (re (concat "^\\(\\*+\\)[ 	]\\|^[ 	]*" o=
> rg-clock-string "[ 	]*\\(?:\\(\\[.*?\\]\\)-+\\(\\[.*?\\]\\)\\|=3D>[ 	]+\\([=
> 0-9]+\\):\\([0-9]+\\)\\)")) (lmax 30) (ltimes (make-vector lmax 0)) (t1 0) =
> (level 0) ts te dt time) (if (stringp tstart) (setq tstart (org-time-string=
> -to-seconds tstart))) (if (stringp tend) (setq tend (org-time-string-to-sec=
> onds tend))) (if (consp tstart) (setq tstart (org-float-time tstart))) (if =
> (consp tend) (setq tend (org-float-time tend))) (remove-text-properties (po=
> int-min) (point-max) (quote (:org-clock-minutes t :org-clock-force-headline=
> -inclusion t))) (save-excursion (goto-char (point-max)) (while (re-search-b=
> ackward re nil t) (cond ((match-end 2) (setq ts (match-string 2) te (match-=
> string 3) ts (org-float-time (apply ... ...)) te (org-float-time (apply ...=
>  ...)) ts (if tstart (max ts tstart) ts) te (if tend (min te tend) te) dt (=
> - te ts) t1 (if (> dt 0) (+ t1 ...) t1))) ((match-end 4) (setq t1 (+ t1 (st=
> ring-to-number ...) (* 60 ...)))) (t (when (and org-clock-report-include-cl=
> ocking-task (equal ... ...) (equal ... ...) tstart tend (>=3D ... tstart) (=
> <=3D ... tend)) (let (...) (setq t1 ...))) (let* ((headline-forced ...) (he=
> adline-included ...)) (setq level (- ... ...)) (when (or ... ...) (when ...=
>  ... ... ... ... ...) (setq t1 0) (loop for l from level to ... do ...)))))=
> ) (setq org-clock-file-total-minutes (aref ltimes 0))) (set-buffer-modified=
> -p bmp))
>   org-clock-sum()
>   (let (time h m p) (org-clock-sum) (unless total-only (save-excursion (got=
> o-char (point-min)) (while (or (and (equal (setq p ...) (point-min)) (get-t=
> ext-property p :org-clock-minutes)) (setq p (next-single-property-change (p=
> oint) :org-clock-minutes))) (goto-char p) (when (setq time (get-text-proper=
> ty p :org-clock-minutes)) (org-clock-put-overlay time (funcall outline-leve=
> l)))) (setq h (/ org-clock-file-total-minutes 60) m (- org-clock-file-total=
> -minutes (* 60 h))) (when org-remove-highlights-with-change (org-add-hook (=
> quote before-change-functions) (quote org-clock-remove-overlays) nil (quote=
>  local))))) (if org-time-clocksum-use-fractional (message (concat "Total fi=
> le time: " org-time-clocksum-fractional-format " (%d hours and %d minutes)"=
> ) (/ (+ (* h 60.0) m) 60.0) h m) (message (concat "Total file time: " org-t=
> ime-clocksum-format " (%d hours and %d minutes)") h m h m)))
>   org-clock-display()
>   call-interactively(org-clock-display t nil)
>   execute-extended-command(nil)
>   call-interactively(execute-extended-command nil nil)
> 
> 
> 
> Any further ideas what to try next?
> 
> Ciao, Gregor
> --=20
>  -... --- .-. . -.. ..--.. ...-.-
> 

  parent reply	other threads:[~2012-01-12 22:38 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-10 19:08 Getting rid of split frame with org-capture Thomas Lockney
2011-11-12 15:57 ` Gregor Zattler
     [not found]   ` <telegraph@gmx.net>
2011-11-13  4:13     ` Nick Dokos
2011-11-13 16:48       ` Tom Prince
2011-11-13 17:57         ` Nick Dokos
2011-11-20 16:16           ` Tom Prince
2011-12-13 23:11             ` Andreas Leha
2011-12-14 16:37               ` Tom Prince
2013-10-04  4:33                 ` Alexander Vorobiev
2013-10-04  7:06                   ` Alan Schmitt
2011-11-25 16:35           ` Eric S Fraga
2012-01-12 22:12     ` Nick Dokos [this message]
2012-01-12 22:56       ` How to debug "org-clock-display: Args out of range: [48230 48230 48230 38618 38618 0 0 0 0 0 ...], 61" Nick Dokos
2012-01-14 16:16         ` [BUG] org-clock-sum cannot handle headings with more than 29 stars (was: Re: How to debug "org-clock-display: Args out of range: [48230 48230) " Gregor Zattler
2012-01-15 15:33         ` How to debug "org-clock-display: Args out of range: [48230 48230 " Stefan Nobis
2012-01-14 18:49     ` [BUG] org-clock-sum cannot handle headings with more than 29 stars (was: Re: How to debug "org-clock-display: Args out of range: [48230 48230) " Nick Dokos
2012-01-22 12:50       ` [BUG][PATCH] document number of stars limitation with respect to org-clock-sum (was: Re: org-clock-sum cannot handle headings with more than 29 stars) Gregor Zattler
2012-01-22 13:15         ` [PATCH 2/3] Document max number of stars in headings in manual Gregor Zattler
2012-01-24 16:10           ` [Accepted] [O, " Bastien Guerry
2012-01-22 13:15         ` [PATCH 1/3] Document max number of stars in headings in docstring of org-inlinetask-minlevel Gregor Zattler
2012-01-24 16:10           ` [Accepted] [O, " Bastien Guerry
2012-01-22 13:30         ` [PATCH 3/3] Document max number of stars in clocking section Gregor Zattler
2012-01-24 16:11           ` [Accepted] [O, " Bastien Guerry
2012-01-24 16:16         ` [BUG][PATCH] document number of stars limitation with respect to org-clock-sum Bastien
2012-10-14  5:31     ` Bug: org-read-date: problem with year in dotted european date input [7.9.2 (release_7.9.2-436-g9b11e6 @ /home/grfz/src/org-mode/lisp/)] Nick Dokos
2013-01-24 18:10     ` How to track down "No heading for this item in buffer or region."? Nick Dokos
2013-01-24 18:31     ` Nick Dokos
2011-11-13 20:41 ` Getting rid of split frame with org-capture Nick Dokos
  -- strict thread matches above, loose matches on Subject: below --
2012-01-06  0:21 How to debug "org-clock-display: Args out of range: [48230 48230 48230 38618 38618 0 0 0 0 0 ...], 61" Gregor Zattler
2012-01-06  1:01 ` Bernt Hansen
2012-01-12 21:41   ` Gregor Zattler
2012-01-15 23:07     ` Bernt Hansen
2012-10-11 12:51 how to customise Emacs to recognise 13.10. as 13th of October this year instead of 2010-10-13? Gregor Zattler
2012-10-11 14:13 ` Memnon Anon
2012-10-11 15:20   ` Gregor Zattler
2012-10-12 15:14 ` Bug: org-read-date: problem with year in dotted european date input [7.9.2 (release_7.9.2-436-g9b11e6 @ /home/grfz/src/org-mode/lisp/)] (was: Re: how to customise Emacs to recognise 13.10. as 13th of October this year instead of 2010-10-13?) Gregor Zattler
2012-10-12 16:24   ` Bug: org-read-date: problem with year in dotted european date input [7.9.2 (release_7.9.2-436-g9b11e6 @ /home/grfz/src/org-mode/lisp/)] Nicolas Goaziou
2012-10-13  8:12     ` Gregor Zattler
2012-10-13 10:10       ` Nicolas Goaziou
2012-10-13 18:44         ` Gregor Zattler
2012-10-14  6:01           ` Carsten Dominik
2012-10-14  7:57             ` Nicolas Goaziou
2012-10-15  6:39               ` Carsten Dominik
2012-10-15 11:06                 ` Nicolas Goaziou
2013-01-24 12:32 How to track down "No heading for this item in buffer or region."? Gregor Zattler
2013-01-24 12:44 ` Bastien
2013-01-24 16:23   ` Gregor Zattler
2013-01-24 19:07     ` Bastien
2013-01-24 19:24     ` Bastien
2013-01-24 19:35       ` Nick Dokos
2013-01-24 20:29         ` Bastien
2013-01-25  5:20           ` Nick Dokos
2013-01-25 16:11             ` J. David Boyd
2013-01-26 10:51             ` Bastien
2013-01-26 16:45               ` Nick Dokos
2013-01-31 10:43                 ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4047.1326406324@alphaville1 \
    --to=nicholas.dokos@hp.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).