GNU bug report logs - #24315
icalendar--read-element uses inefficient regexp

Previous Next

Package: emacs;

Reported by: peder <at> klingenberg.no (Peder O. Klingenberg)

Date: Fri, 26 Aug 2016 20:19:02 UTC

Severity: normal

Tags: fixed, patch

Found in version 25.1.50

Fixed in version 25.2

Done: npostavs <at> users.sourceforge.net

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 24315 in the body.
You can then email your comments to 24315 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#24315; Package emacs. (Fri, 26 Aug 2016 20:19:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to peder <at> klingenberg.no (Peder O. Klingenberg):
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 26 Aug 2016 20:19:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: peder <at> klingenberg.no (Peder O. Klingenberg)
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1.50; re-search-forward errors with "Variable binding depth exceeds
 max-specpdl-size"
Date: Fri, 26 Aug 2016 22:17:30 +0200
[Message part 1 (text/plain, inline)]
I recently started using gnus-icalendar to handle meeting invitations.
Someone sent me an invitation that included a rather long email thread
in typical outlook style, and gnus errored out when trying to display
the article.

The backtrace showed that the error comes from the call
  (re-search-forward  "\\(.*\\)\\(\r?\n[ \t].*\\)*" nil t)
in icalendar--read-element (nil nil).

I reduced and anonymized the contents of the message, the problematic
section is attached to this bug report.  The problem is reproducible for
me from emacs -Q by the following recipe:

  C-x C-f calendar-event-problem.txt
  <make sure cursor is somewhere in the first couple of lines>
  M-: (re-search-forward  "\\(.*\\)\\(\r?\n[ \t].*\\)*" nil t)

Result:
Debugger entered--Lisp error: (error "Variable binding depth exceeds max-specpdl-size")
  re-search-forward("\\(.*\\)\\(?\n[ 	].*\\)*" nil t)
  eval((re-search-forward "\\(.*\\)\\(?\n[ 	].*\\)*" nil t) nil)
  eval-expression((re-search-forward "\\(.*\\)\\(?\n[ 	].*\\)*" nil t) nil)
  funcall-interactively(eval-expression (re-search-forward "\\(.*\\)\\(?\n[ 	].*\\)*" nil t) nil)
  call-interactively(eval-expression nil nil)
  command-execute(eval-expression)

Reducing the text size by about 1/3, or just moving the cursor a ways
down the buffer before evaling, eliminates the error.

From the same emacs -Q session:

max-specpdl-size is a variable defined in ‘C source code’.
Its value is 2930
Original value was 1300

Increasing max-specpdl-size to 20000 does not help, the problem still
occurs.

Strangely, the same recipe does not reproduce the error on os x, with a
build from master from 2016-08-12, but on my GNU/Linux machine, which is
where I run gnus and need this to work, it is 100% reproducible.  I am
on Kubuntu 14.04.5, emacs is compiled with gcc (Ubuntu
4.8.4-2ubuntu1~14.04.3) 4.8.4.

Is this reproducible for anyone else, or do I need to dig deeper into my
environment?  Any ideas on where to start digging?



In GNU Emacs 25.1.50.2 (x86_64-unknown-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2016-08-11 built on luna
Repository revision: 36a57c55f2b855bca704c26bf7d787b7b471fe16
Windowing system distributor 'The X.Org Foundation', version 11.0.11604000
System Description:	Ubuntu 14.04.5 LTS

Recent messages:
scroll-down-command: Beginning of buffer [3 times]
(Shell command succeeded with no output) [91 times]
Back to top level
When done with this frame, type C-x 5 0
Undo! [3 times]
calendar-event-problem.txt changed on disk; really edit the buffer? (y, n, r or C-h) r
ask-user-about-supersession-threat: File reverted: /home/pok/tmp/calendar-event-problem.txt
previous-line: Beginning of buffer [3 times]
Entering debugger...
Back to top level

Configured using:
 'configure --prefix=/usr/local/emacs-git
 --enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/site-lisp/:/usr/share/emacs/site-lisp
 --with-x=yes --with-x-toolkit=lucid --with-toolkit-scroll-bars
 --with-pop=yes'

Configured features:
XAW3D XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF
GSETTINGS NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT
ZLIB TOOLKIT_SCROLL_BARS LUCID X11

Important settings:
  value of $LC_MONETARY: en_US.UTF-8
  value of $LC_NUMERIC: en_US.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Text

Minor modes in effect:
  csv-field-index-mode: t
  magit-auto-revert-mode: t
  global-git-commit-mode: t
  async-bytecomp-package-mode: t
  shell-dirtrack-mode: t
  diff-auto-refine-mode: t
  show-paren-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  ido-everywhere: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  auto-fill-function: do-auto-fill
  transient-mark-mode: t

Load-path shadows:
/home/pok/.emacs.d/elpa/org-20160822/org-macs hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-macs
/home/pok/.emacs.d/elpa/org-20160822/ob-dot hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-dot
/home/pok/.emacs.d/elpa/org-20160822/ob-mscgen hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-mscgen
/home/pok/.emacs.d/elpa/org-20160822/ob-clojure hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-clojure
/home/pok/.emacs.d/elpa/org-20160822/org-install hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-install
/home/pok/.emacs.d/elpa/org-20160822/org-faces hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-faces
/home/pok/.emacs.d/elpa/org-20160822/ob-scheme hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-scheme
/home/pok/.emacs.d/elpa/org-20160822/ob-haskell hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-haskell
/home/pok/.emacs.d/elpa/org-20160822/ob-sqlite hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-sqlite
/home/pok/.emacs.d/elpa/org-20160822/ox-texinfo hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ox-texinfo
/home/pok/.emacs.d/elpa/org-20160822/ob-perl hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-perl
/home/pok/.emacs.d/elpa/org-20160822/ob-makefile hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-makefile
/home/pok/.emacs.d/elpa/org-20160822/ob-io hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-io
/home/pok/.emacs.d/elpa/org-20160822/org-docview hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-docview
/home/pok/.emacs.d/elpa/org-20160822/org-irc hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-irc
/home/pok/.emacs.d/elpa/org-20160822/ob-C hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-C
/home/pok/.emacs.d/elpa/org-20160822/ox-man hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ox-man
/home/pok/.emacs.d/elpa/org-20160822/org-capture hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-capture
/home/pok/.emacs.d/elpa/org-20160822/ob-table hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-table
/home/pok/.emacs.d/elpa/org-20160822/ob-sql hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-sql
/home/pok/.emacs.d/elpa/org-20160822/org-list hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-list
/home/pok/.emacs.d/elpa/org-20160822/org-crypt hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-crypt
/home/pok/.emacs.d/elpa/org-20160822/org-attach hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-attach
/home/pok/.emacs.d/elpa/org-20160822/org-colview hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-colview
/home/pok/.emacs.d/elpa/org-20160822/org-id hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-id
/home/pok/.emacs.d/elpa/org-20160822/ob-plantuml hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-plantuml
/home/pok/.emacs.d/elpa/org-20160822/ox-publish hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ox-publish
/home/pok/.emacs.d/elpa/org-20160822/ob-tangle hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-tangle
/home/pok/.emacs.d/elpa/org-20160822/org hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org
/home/pok/.emacs.d/elpa/org-20160822/org-indent hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-indent
/home/pok/.emacs.d/elpa/org-20160822/ox-ascii hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ox-ascii
/home/pok/.emacs.d/elpa/org-20160822/ob-matlab hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-matlab
/home/pok/.emacs.d/elpa/org-20160822/org-gnus hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-gnus
/home/pok/.emacs.d/elpa/org-20160822/org-feed hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-feed
/home/pok/.emacs.d/elpa/org-20160822/org-clock hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-clock
/home/pok/.emacs.d/elpa/org-20160822/org-element hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-element
/home/pok/.emacs.d/elpa/org-20160822/ob-screen hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-screen
/home/pok/.emacs.d/elpa/org-20160822/ob hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob
/home/pok/.emacs.d/elpa/org-20160822/org-mobile hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-mobile
/home/pok/.emacs.d/elpa/org-20160822/ox-latex hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ox-latex
/home/pok/.emacs.d/elpa/org-20160822/ob-lisp hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-lisp
/home/pok/.emacs.d/elpa/org-20160822/ob-calc hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-calc
/home/pok/.emacs.d/elpa/org-20160822/org-bibtex hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-bibtex
/home/pok/.emacs.d/elpa/org-20160822/org-macro hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-macro
/home/pok/.emacs.d/elpa/org-20160822/org-agenda hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-agenda
/home/pok/.emacs.d/elpa/org-20160822/org-entities hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-entities
/home/pok/.emacs.d/elpa/org-20160822/ob-css hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-css
/home/pok/.emacs.d/elpa/org-20160822/ob-R hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-R
/home/pok/.emacs.d/elpa/org-20160822/org-mouse hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-mouse
/home/pok/.emacs.d/elpa/org-20160822/org-timer hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-timer
/home/pok/.emacs.d/elpa/org-20160822/ob-java hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-java
/home/pok/.emacs.d/elpa/org-20160822/ob-gnuplot hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-gnuplot
/home/pok/.emacs.d/elpa/org-20160822/ob-keys hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-keys
/home/pok/.emacs.d/elpa/org-20160822/ob-python hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-python
/home/pok/.emacs.d/elpa/org-20160822/org-compat hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-compat
/home/pok/.emacs.d/elpa/org-20160822/ob-fortran hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-fortran
/home/pok/.emacs.d/elpa/org-20160822/ob-exp hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-exp
/home/pok/.emacs.d/elpa/org-20160822/ox-html hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ox-html
/home/pok/.emacs.d/elpa/org-20160822/ob-comint hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-comint
/home/pok/.emacs.d/elpa/org-20160822/org-src hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-src
/home/pok/.emacs.d/elpa/org-20160822/ob-scala hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-scala
/home/pok/.emacs.d/elpa/org-20160822/org-version hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-version
/home/pok/.emacs.d/elpa/org-20160822/org-loaddefs hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-loaddefs
/home/pok/.emacs.d/elpa/org-20160822/ob-emacs-lisp hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-emacs-lisp
/home/pok/.emacs.d/elpa/org-20160822/org-datetree hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-datetree
/home/pok/.emacs.d/elpa/org-20160822/ob-asymptote hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-asymptote
/home/pok/.emacs.d/elpa/org-20160822/ox-org hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ox-org
/home/pok/.emacs.d/elpa/org-20160822/org-habit hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-habit
/home/pok/.emacs.d/elpa/org-20160822/ox hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ox
/home/pok/.emacs.d/elpa/org-20160822/org-w3m hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-w3m
/home/pok/.emacs.d/elpa/org-20160822/ob-lob hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-lob
/home/pok/.emacs.d/elpa/org-20160822/org-protocol hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-protocol
/home/pok/.emacs.d/elpa/org-20160822/ob-shen hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-shen
/home/pok/.emacs.d/elpa/org-20160822/ob-maxima hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-maxima
/home/pok/.emacs.d/elpa/org-20160822/ob-ref hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-ref
/home/pok/.emacs.d/elpa/org-20160822/ob-org hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-org
/home/pok/.emacs.d/elpa/org-20160822/ob-latex hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-latex
/home/pok/.emacs.d/elpa/org-20160822/ox-md hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ox-md
/home/pok/.emacs.d/elpa/org-20160822/org-mhe hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-mhe
/home/pok/.emacs.d/elpa/org-20160822/ob-ledger hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-ledger
/home/pok/.emacs.d/elpa/org-20160822/org-archive hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-archive
/home/pok/.emacs.d/elpa/org-20160822/org-ctags hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-ctags
/home/pok/.emacs.d/elpa/org-20160822/org-info hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-info
/home/pok/.emacs.d/elpa/org-20160822/ob-octave hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-octave
/home/pok/.emacs.d/elpa/org-20160822/org-pcomplete hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-pcomplete
/home/pok/.emacs.d/elpa/org-20160822/ob-ditaa hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-ditaa
/home/pok/.emacs.d/elpa/org-20160822/org-plot hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-plot
/home/pok/.emacs.d/elpa/org-20160822/ob-eval hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-eval
/home/pok/.emacs.d/elpa/org-20160822/org-table hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-table
/home/pok/.emacs.d/elpa/org-20160822/ox-beamer hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ox-beamer
/home/pok/.emacs.d/elpa/org-20160822/ox-odt hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ox-odt
/home/pok/.emacs.d/elpa/org-20160822/ob-core hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-core
/home/pok/.emacs.d/elpa/org-20160822/org-inlinetask hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-inlinetask
/home/pok/.emacs.d/elpa/org-20160822/org-rmail hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-rmail
/home/pok/.emacs.d/elpa/org-20160822/ox-icalendar hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ox-icalendar
/home/pok/.emacs.d/elpa/org-20160822/ob-lilypond hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-lilypond
/home/pok/.emacs.d/elpa/org-20160822/ob-picolisp hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-picolisp
/home/pok/.emacs.d/elpa/org-20160822/ob-sass hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-sass
/home/pok/.emacs.d/elpa/org-20160822/org-eshell hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-eshell
/home/pok/.emacs.d/elpa/org-20160822/ob-awk hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-awk
/home/pok/.emacs.d/elpa/org-20160822/ob-ruby hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-ruby
/home/pok/.emacs.d/elpa/org-20160822/ob-ocaml hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-ocaml
/home/pok/.emacs.d/elpa/org-20160822/ob-js hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-js
/home/pok/.emacs.d/elpa/org-20160822/org-footnote hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-footnote
/home/pok/.emacs.d/elpa/org-20160822/org-bbdb hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-bbdb
/usr/share/emacs24/site-lisp/latex-cjk-thai/thai-word hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/language/thai-word

Features:
(shadow emacsbug gnus-dup gnus-draft nndoc cus-edit ess-omg-l
ess-toolbar ess-mouse mouseme ess-menu ess-swv ess-noweb essd-els
ess-sas-d ess-sas-l ess-sas-a ess-sta-d ess-sta-l make-regexp ess-sp6-d
ess-dde ess-sp3-d ess-julia julia-mode ess-r-d ess-r-syntax
ess-r-completion ess-roxy essddr hideshow ess-help reporter
ess-r-package ess-s-l ess-site ess ess-inf ess-tracebug ess-mode
ess-noweb-mode ess-custom executable ess-generics ess-utils ess-bugs-l
ess-compat ess-lsp-l map esh-var esh-io esh-cmd esh-opt esh-ext esh-proc
esh-arg esh-groups eshell esh-module esh-mode esh-util dired-x autoload
tar-mode ffap php-mode flymake cc-mode cc-fonts cc-guess cc-menus
cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs hippie-exp vc
vc-dispatcher url-queue grep pulse vc-cvs slime-indentation
slime-cl-indent cl-indent slime-fancy slime-trace-dialog
slime-fontifying-fu slime-package-fu slime-references
slime-compiler-notes-tree slime-scratch slime-presentations bridge
slime-macrostep macrostep slime-mdot-fu slime-enclosing-context
slime-fuzzy slime-fancy-trace slime-fancy-inspector slime-c-p-c
slime-editing-commands slime-autodoc slime-repl elp slime-parse slime
lisp-mnt gud apropos etags xref project arc-mode archive-mode hyperspec
csv-mode magit-blame magit-stash magit-bisect magit-remote magit-commit
magit-sequence magit magit-apply magit-wip magit-log magit-diff
smerge-mode magit-core magit-autorevert autorevert filenotify
magit-process magit-popup magit-mode magit-git magit-section magit-utils
git-commit log-edit pcvs-util with-editor async-bytecomp async tramp-sh
tramp tramp-compat tramp-loaddefs trampver ucs-normalize shell dash
eieio-opt speedbar sb-image ezimage dframe cal-china lunar solar cal-dst
cal-bahai cal-islam cal-hebrew holidays hol-loaddefs cal-iso bookmark pp
tabify org-rmail org-mhe org-irc org-info org-gnus org-docview doc-view
jka-compr image-mode org-bbdb org-w3m org-table org-archive org-clock
org-indent ob-ditaa ob-plantuml org-bibtex org-element avl-tree bibtex
org-colview org-crypt org-habit org-agenda help-fns radix-tree misearch
multi-isearch thingatpt debbugs-gnu add-log debbugs soap-client warnings
rng-xsd rng-dt rng-util xsd-regexp debug cus-start cus-load mailalias
bbdb-message footnote ecomplete flow-fill vc-git diff-mode sort
gnus-cite shr-color color shr svg dom browse-url mail-extr gnus-async
gnus-bcklg qp gnus-ml disp-table gnus-topic mm-archive url-http url-gw
url-cache url-auth pop3 nnrss xml mm-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie url-domsuf url-util
nndraft nnmh nnml utf-7 bbdb-gnus epa-file network-stream nsm starttls
gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg nntp
gnus-cache pok-gnus gnus-icalendar org-capture gnus-art mm-uu mml2015
mm-view mml-smime smime dig mailcap icalendar diary-lib diary-loaddefs
nnir gnus-sum gnus-group gnus-undo bbdb-mua bbdb-com crm bbdb bbdb-site
timezone gnus-start gnus-cloud nnimap nnmail mail-source tls gnutls utf7
netrc nnoo parse-time gnus-spec gnus-int gnus-range message sendmail
puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
gnus-win gnus nnheader subr-x gnus-util rmail rmail-loaddefs rfc2047
rfc2045 ietf-drums mail-utils wid-edit linum paren paredit pok-init
bugz-mode yasnippet org advice org-macro org-footnote org-pcomplete
pcomplete org-list org-faces org-entities time-date noutline outline
org-version ob-emacs-lisp ob ob-tangle ob-ref ob-lob ob-table ob-exp
org-src ob-keys ob-comint ob-core ob-eval org-compat org-macs
org-loaddefs format-spec find-func cal-menu calendar cal-loaddefs gedcom
slime-autoloads reftex reftex-loaddefs reftex-vars edmacro kmacro ido
server filladapt dmacro mm-util mail-prsvr cl compile comint ansi-color
ring finder-inf tex-site info package epg-config url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache url-vars seq byte-opt gv bytecomp byte-compile cl-extra
help-mode easymenu cconv cl-loaddefs pcase cl-lib emacs-goodies-el
emacs-goodies-custom emacs-goodies-loaddefs easy-mmode mule-util tooltip
eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel
term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame
cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian
slovak czech european ethiopic indian cyrillic chinese charscript
case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote dbusbind inotify
dynamic-setting system-font-setting font-render-setting x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 2485829 182861)
 (symbols 48 72236 91)
 (miscs 40 3269 4672)
 (strings 32 298119 63000)
 (string-bytes 1 12887713)
 (vectors 16 103720)
 (vector-slots 8 2448384 49706)
 (floats 8 4985 2034)
 (intervals 56 225770 627)
 (buffers 976 190)
 (heap 1024 299121 -1842968))
[calendar-event-problem.txt (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24315; Package emacs. (Sat, 27 Aug 2016 03:36:02 GMT) Full text and rfc822 format available.

Message #8 received at 24315 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: peder <at> klingenberg.no (Peder O. Klingenberg)
Cc: 24315 <at> debbugs.gnu.org
Subject: Re: bug#24315: 25.1.50;
 re-search-forward errors with "Variable binding depth exceeds
 max-specpdl-size"
Date: Fri, 26 Aug 2016 23:35:51 -0400
peder <at> klingenberg.no (Peder O. Klingenberg) writes:

> I recently started using gnus-icalendar to handle meeting invitations.
> Someone sent me an invitation that included a rather long email thread
> in typical outlook style, and gnus errored out when trying to display
> the article.
>
> The backtrace showed that the error comes from the call
>   (re-search-forward  "\\(.*\\)\\(\r?\n[ \t].*\\)*" nil t)
> in icalendar--read-element (nil nil).

This looks like it would be an inefficient regexp, since it has nested
stars.  I suspect searching for "^[ \t]" multiple times would be more
efficient than trying to match multiple lines in a single regexp.

>
> Strangely, the same recipe does not reproduce the error on os x, with a
> build from master from 2016-08-12, but on my GNU/Linux machine, which is
> where I run gnus and need this to work, it is 100% reproducible.  I am
> on Kubuntu 14.04.5, emacs is compiled with gcc (Ubuntu
> 4.8.4-2ubuntu1~14.04.3) 4.8.4.
>
> Is this reproducible for anyone else, or do I need to dig deeper into my
> environment?  Any ideas on where to start digging?

(I'm also on GNU/Linux, Arch) I get the same max-specpdl-size error with
25.1.50, with 24.5 (and below) I get (error "Stack overflow in regexp
matcher") and with 25.1-rc1 I get an assertion failure:

character.h:703: Emacs fatal error: assertion failed: CHAR_VALID_P (ch)

Thread 1 "emacs" hit Breakpoint 1, terminate_due_to_signal (sig=6, backtrace_limit=2147483647)
    at emacs.c:354
354	  signal (sig, SIG_DFL);
(gdb) bt
#0  terminate_due_to_signal (sig=6, backtrace_limit=2147483647) at emacs.c:354
#1  0x00000000005fa92d in die (msg=0x722518 "CHAR_VALID_P (ch)", file=0x72250c "character.h", 
    line=703) at alloc.c:7223
#2  0x000000000056b841 in char_table_translate (obj=20656133, ch=4194341) at character.h:703
#3  0x00000000005e9d33 in re_match_2_internal (bufp=0xd68260 <searchbufs+32>, 
    string1=0x1a9a970 " \202\245\001", size1=0, string2=0x1a9a970 " \202\245\001", size2=40918, 
    pos=0, regs=0xd69e70 <search_regs>, stop=40918) at regex.c:5430
#4  0x00000000005e782c in re_search_2 (bufp=0xd68260 <searchbufs+32>, str1=0x1a9a970 " \202\245\001", 
    size1=0, str2=0x1a9a970 " \202\245\001", size2=40918, startpos=0, range=40918, 
    regs=0xd69e70 <search_regs>, stop=40918) at regex.c:4446
#5  0x00000000005d6447 in search_buffer (string=14974596, pos=1, pos_byte=1, lim=40891, 
    lim_byte=40919, n=1, RE=1, trt=20656133, inverse_trt=20532565, posix=false) at search.c:1265
#6  0x00000000005d5be2 in search_command (string=14974596, bound=0, noerror=44448, count=0, 
    direction=1, RE=1, posix=false) at search.c:1058
#7  0x00000000005d99a7 in Fre_search_forward (regexp=14974596, bound=0, noerror=44448, count=0)
    at search.c:2264
#8  0x000000000061cac3 in eval_sub (form=26022259) at eval.c:2176
#9  0x000000000061c124 in Feval (form=26022259, lexical=0) at eval.c:1988
#10 0x000000000061e052 in Ffuncall (nargs=3, args=0x7fffffffd678) at eval.c:2696
#11 0x0000000000668285 in exec_byte_code (bytestr=10946844, vector=10946877, maxdepth=30, 
    args_template=2054, nargs=2, args=0x7fffffffdc90) at bytecode.c:880
#12 0x000000000061e958 in funcall_lambda (fun=10946789, nargs=2, arg_vector=0x7fffffffdc80)
    at eval.c:2855
#13 0x000000000061e2a1 in Ffuncall (nargs=3, args=0x7fffffffdc78) at eval.c:2742
#14 0x000000000061488d in Ffuncall_interactively (nargs=3, args=0x7fffffffdc78) at callint.c:252
#15 0x000000000061dee7 in Ffuncall (nargs=4, args=0x7fffffffdc70) at eval.c:2673
#16 0x000000000061d338 in Fapply (nargs=3, args=0x7fffffffdd50) at eval.c:2321
#17 0x0000000000614d93 in Fcall_interactively (function=4198576, record_flag=0, keys=14640533)
    at callint.c:389
#18 0x000000000061e08d in Ffuncall (nargs=4, args=0x7fffffffdfd8) at eval.c:2700
#19 0x0000000000668285 in exec_byte_code (bytestr=10951116, vector=10951149, maxdepth=54, 
    args_template=4102, nargs=1, args=0x7fffffffe530) at bytecode.c:880
#20 0x000000000061e958 in funcall_lambda (fun=10951069, nargs=1, arg_vector=0x7fffffffe528)
    at eval.c:2855
#21 0x000000000061e2a1 in Ffuncall (nargs=2, args=0x7fffffffe520) at eval.c:2742
#22 0x000000000061d9e5 in call1 (fn=14784, arg1=4198576) at eval.c:2552
#23 0x00000000005734ce in command_loop_1 () at keyboard.c:1479
#24 0x000000000061a7c1 in internal_condition_case (bfun=0x572cb4 <command_loop_1>, handlers=19056, 
    hfun=0x572346 <cmd_error>) at eval.c:1309
#25 0x00000000005728f6 in command_loop_2 (ignore=0) at keyboard.c:1107
#26 0x0000000000619d90 in internal_catch (tag=45840, func=0x5728cd <command_loop_2>, arg=0)
    at eval.c:1074
#27 0x0000000000572898 in command_loop () at keyboard.c:1086
#28 0x0000000000571e36 in recursive_edit_1 () at keyboard.c:692
#29 0x0000000000572036 in Frecursive_edit () at keyboard.c:763
#30 0x000000000056fde3 in main (argc=3, argv=0x7fffffffe9d8) at emacs.c:1626

Lisp Backtrace:
"re-search-forward" (0xffffd470)
"eval" (0xffffd680)
"eval-expression" (0xffffdc80)
"funcall-interactively" (0xffffdc78)
"call-interactively" (0xffffdfe0)
"command-execute" (0xffffe528)


>
>
>
> In GNU Emacs 25.1.50.2 (x86_64-unknown-linux-gnu, X toolkit, Xaw3d scroll bars)
>  of 2016-08-11 built on luna
> Repository revision: 36a57c55f2b855bca704c26bf7d787b7b471fe16
> Windowing system distributor 'The X.Org Foundation', version 11.0.11604000
> System Description:	Ubuntu 14.04.5 LTS
>
> Recent messages:
> scroll-down-command: Beginning of buffer [3 times]
> (Shell command succeeded with no output) [91 times]
> Back to top level
> When done with this frame, type C-x 5 0
> Undo! [3 times]
> calendar-event-problem.txt changed on disk; really edit the buffer? (y, n, r or C-h) r
> ask-user-about-supersession-threat: File reverted: /home/pok/tmp/calendar-event-problem.txt
> previous-line: Beginning of buffer [3 times]
> Entering debugger...
> Back to top level
>
> Configured using:
>  'configure --prefix=/usr/local/emacs-git
>  --enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/site-lisp/:/usr/share/emacs/site-lisp
>  --with-x=yes --with-x-toolkit=lucid --with-toolkit-scroll-bars
>  --with-pop=yes'
>
> Configured features:
> XAW3D XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF
> GSETTINGS NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT
> ZLIB TOOLKIT_SCROLL_BARS LUCID X11
>
> Important settings:
>   value of $LC_MONETARY: en_US.UTF-8
>   value of $LC_NUMERIC: en_US.UTF-8
>   value of $LANG: en_US.UTF-8
>   locale-coding-system: utf-8-unix
>
> Major mode: Text
>
> Minor modes in effect:
>   csv-field-index-mode: t
>   magit-auto-revert-mode: t
>   global-git-commit-mode: t
>   async-bytecomp-package-mode: t
>   shell-dirtrack-mode: t
>   diff-auto-refine-mode: t
>   show-paren-mode: t
>   yas-global-mode: t
>   yas-minor-mode: t
>   ido-everywhere: t
>   global-eldoc-mode: t
>   electric-indent-mode: t
>   mouse-wheel-mode: t
>   menu-bar-mode: t
>   file-name-shadow-mode: t
>   global-font-lock-mode: t
>   font-lock-mode: t
>   auto-composition-mode: t
>   auto-encryption-mode: t
>   auto-compression-mode: t
>   line-number-mode: t
>   auto-fill-function: do-auto-fill
>   transient-mark-mode: t
>
> Load-path shadows:
> /home/pok/.emacs.d/elpa/org-20160822/org-macs hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-macs
> /home/pok/.emacs.d/elpa/org-20160822/ob-dot hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-dot
> /home/pok/.emacs.d/elpa/org-20160822/ob-mscgen hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-mscgen
> /home/pok/.emacs.d/elpa/org-20160822/ob-clojure hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-clojure
> /home/pok/.emacs.d/elpa/org-20160822/org-install hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-install
> /home/pok/.emacs.d/elpa/org-20160822/org-faces hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-faces
> /home/pok/.emacs.d/elpa/org-20160822/ob-scheme hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-scheme
> /home/pok/.emacs.d/elpa/org-20160822/ob-haskell hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-haskell
> /home/pok/.emacs.d/elpa/org-20160822/ob-sqlite hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-sqlite
> /home/pok/.emacs.d/elpa/org-20160822/ox-texinfo hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ox-texinfo
> /home/pok/.emacs.d/elpa/org-20160822/ob-perl hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-perl
> /home/pok/.emacs.d/elpa/org-20160822/ob-makefile hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-makefile
> /home/pok/.emacs.d/elpa/org-20160822/ob-io hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-io
> /home/pok/.emacs.d/elpa/org-20160822/org-docview hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-docview
> /home/pok/.emacs.d/elpa/org-20160822/org-irc hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-irc
> /home/pok/.emacs.d/elpa/org-20160822/ob-C hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-C
> /home/pok/.emacs.d/elpa/org-20160822/ox-man hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ox-man
> /home/pok/.emacs.d/elpa/org-20160822/org-capture hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-capture
> /home/pok/.emacs.d/elpa/org-20160822/ob-table hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-table
> /home/pok/.emacs.d/elpa/org-20160822/ob-sql hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-sql
> /home/pok/.emacs.d/elpa/org-20160822/org-list hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-list
> /home/pok/.emacs.d/elpa/org-20160822/org-crypt hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-crypt
> /home/pok/.emacs.d/elpa/org-20160822/org-attach hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-attach
> /home/pok/.emacs.d/elpa/org-20160822/org-colview hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-colview
> /home/pok/.emacs.d/elpa/org-20160822/org-id hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-id
> /home/pok/.emacs.d/elpa/org-20160822/ob-plantuml hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-plantuml
> /home/pok/.emacs.d/elpa/org-20160822/ox-publish hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ox-publish
> /home/pok/.emacs.d/elpa/org-20160822/ob-tangle hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-tangle
> /home/pok/.emacs.d/elpa/org-20160822/org hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org
> /home/pok/.emacs.d/elpa/org-20160822/org-indent hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-indent
> /home/pok/.emacs.d/elpa/org-20160822/ox-ascii hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ox-ascii
> /home/pok/.emacs.d/elpa/org-20160822/ob-matlab hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-matlab
> /home/pok/.emacs.d/elpa/org-20160822/org-gnus hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-gnus
> /home/pok/.emacs.d/elpa/org-20160822/org-feed hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-feed
> /home/pok/.emacs.d/elpa/org-20160822/org-clock hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-clock
> /home/pok/.emacs.d/elpa/org-20160822/org-element hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-element
> /home/pok/.emacs.d/elpa/org-20160822/ob-screen hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-screen
> /home/pok/.emacs.d/elpa/org-20160822/ob hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob
> /home/pok/.emacs.d/elpa/org-20160822/org-mobile hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-mobile
> /home/pok/.emacs.d/elpa/org-20160822/ox-latex hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ox-latex
> /home/pok/.emacs.d/elpa/org-20160822/ob-lisp hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-lisp
> /home/pok/.emacs.d/elpa/org-20160822/ob-calc hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-calc
> /home/pok/.emacs.d/elpa/org-20160822/org-bibtex hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-bibtex
> /home/pok/.emacs.d/elpa/org-20160822/org-macro hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-macro
> /home/pok/.emacs.d/elpa/org-20160822/org-agenda hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-agenda
> /home/pok/.emacs.d/elpa/org-20160822/org-entities hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-entities
> /home/pok/.emacs.d/elpa/org-20160822/ob-css hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-css
> /home/pok/.emacs.d/elpa/org-20160822/ob-R hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-R
> /home/pok/.emacs.d/elpa/org-20160822/org-mouse hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-mouse
> /home/pok/.emacs.d/elpa/org-20160822/org-timer hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-timer
> /home/pok/.emacs.d/elpa/org-20160822/ob-java hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-java
> /home/pok/.emacs.d/elpa/org-20160822/ob-gnuplot hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-gnuplot
> /home/pok/.emacs.d/elpa/org-20160822/ob-keys hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-keys
> /home/pok/.emacs.d/elpa/org-20160822/ob-python hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-python
> /home/pok/.emacs.d/elpa/org-20160822/org-compat hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-compat
> /home/pok/.emacs.d/elpa/org-20160822/ob-fortran hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-fortran
> /home/pok/.emacs.d/elpa/org-20160822/ob-exp hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-exp
> /home/pok/.emacs.d/elpa/org-20160822/ox-html hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ox-html
> /home/pok/.emacs.d/elpa/org-20160822/ob-comint hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-comint
> /home/pok/.emacs.d/elpa/org-20160822/org-src hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-src
> /home/pok/.emacs.d/elpa/org-20160822/ob-scala hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-scala
> /home/pok/.emacs.d/elpa/org-20160822/org-version hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-version
> /home/pok/.emacs.d/elpa/org-20160822/org-loaddefs hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-loaddefs
> /home/pok/.emacs.d/elpa/org-20160822/ob-emacs-lisp hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-emacs-lisp
> /home/pok/.emacs.d/elpa/org-20160822/org-datetree hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-datetree
> /home/pok/.emacs.d/elpa/org-20160822/ob-asymptote hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-asymptote
> /home/pok/.emacs.d/elpa/org-20160822/ox-org hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ox-org
> /home/pok/.emacs.d/elpa/org-20160822/org-habit hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-habit
> /home/pok/.emacs.d/elpa/org-20160822/ox hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ox
> /home/pok/.emacs.d/elpa/org-20160822/org-w3m hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-w3m
> /home/pok/.emacs.d/elpa/org-20160822/ob-lob hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-lob
> /home/pok/.emacs.d/elpa/org-20160822/org-protocol hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-protocol
> /home/pok/.emacs.d/elpa/org-20160822/ob-shen hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-shen
> /home/pok/.emacs.d/elpa/org-20160822/ob-maxima hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-maxima
> /home/pok/.emacs.d/elpa/org-20160822/ob-ref hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-ref
> /home/pok/.emacs.d/elpa/org-20160822/ob-org hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-org
> /home/pok/.emacs.d/elpa/org-20160822/ob-latex hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-latex
> /home/pok/.emacs.d/elpa/org-20160822/ox-md hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ox-md
> /home/pok/.emacs.d/elpa/org-20160822/org-mhe hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-mhe
> /home/pok/.emacs.d/elpa/org-20160822/ob-ledger hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-ledger
> /home/pok/.emacs.d/elpa/org-20160822/org-archive hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-archive
> /home/pok/.emacs.d/elpa/org-20160822/org-ctags hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-ctags
> /home/pok/.emacs.d/elpa/org-20160822/org-info hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-info
> /home/pok/.emacs.d/elpa/org-20160822/ob-octave hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-octave
> /home/pok/.emacs.d/elpa/org-20160822/org-pcomplete hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-pcomplete
> /home/pok/.emacs.d/elpa/org-20160822/ob-ditaa hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-ditaa
> /home/pok/.emacs.d/elpa/org-20160822/org-plot hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-plot
> /home/pok/.emacs.d/elpa/org-20160822/ob-eval hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-eval
> /home/pok/.emacs.d/elpa/org-20160822/org-table hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-table
> /home/pok/.emacs.d/elpa/org-20160822/ox-beamer hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ox-beamer
> /home/pok/.emacs.d/elpa/org-20160822/ox-odt hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ox-odt
> /home/pok/.emacs.d/elpa/org-20160822/ob-core hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-core
> /home/pok/.emacs.d/elpa/org-20160822/org-inlinetask hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-inlinetask
> /home/pok/.emacs.d/elpa/org-20160822/org-rmail hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-rmail
> /home/pok/.emacs.d/elpa/org-20160822/ox-icalendar hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ox-icalendar
> /home/pok/.emacs.d/elpa/org-20160822/ob-lilypond hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-lilypond
> /home/pok/.emacs.d/elpa/org-20160822/ob-picolisp hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-picolisp
> /home/pok/.emacs.d/elpa/org-20160822/ob-sass hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-sass
> /home/pok/.emacs.d/elpa/org-20160822/org-eshell hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-eshell
> /home/pok/.emacs.d/elpa/org-20160822/ob-awk hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-awk
> /home/pok/.emacs.d/elpa/org-20160822/ob-ruby hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-ruby
> /home/pok/.emacs.d/elpa/org-20160822/ob-ocaml hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-ocaml
> /home/pok/.emacs.d/elpa/org-20160822/ob-js hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/ob-js
> /home/pok/.emacs.d/elpa/org-20160822/org-footnote hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-footnote
> /home/pok/.emacs.d/elpa/org-20160822/org-bbdb hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/org/org-bbdb
> /usr/share/emacs24/site-lisp/latex-cjk-thai/thai-word hides /usr/local/emacs-git/share/emacs/25.1.50/lisp/language/thai-word
>
> Features:
> (shadow emacsbug gnus-dup gnus-draft nndoc cus-edit ess-omg-l
> ess-toolbar ess-mouse mouseme ess-menu ess-swv ess-noweb essd-els
> ess-sas-d ess-sas-l ess-sas-a ess-sta-d ess-sta-l make-regexp ess-sp6-d
> ess-dde ess-sp3-d ess-julia julia-mode ess-r-d ess-r-syntax
> ess-r-completion ess-roxy essddr hideshow ess-help reporter
> ess-r-package ess-s-l ess-site ess ess-inf ess-tracebug ess-mode
> ess-noweb-mode ess-custom executable ess-generics ess-utils ess-bugs-l
> ess-compat ess-lsp-l map esh-var esh-io esh-cmd esh-opt esh-ext esh-proc
> esh-arg esh-groups eshell esh-module esh-mode esh-util dired-x autoload
> tar-mode ffap php-mode flymake cc-mode cc-fonts cc-guess cc-menus
> cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs hippie-exp vc
> vc-dispatcher url-queue grep pulse vc-cvs slime-indentation
> slime-cl-indent cl-indent slime-fancy slime-trace-dialog
> slime-fontifying-fu slime-package-fu slime-references
> slime-compiler-notes-tree slime-scratch slime-presentations bridge
> slime-macrostep macrostep slime-mdot-fu slime-enclosing-context
> slime-fuzzy slime-fancy-trace slime-fancy-inspector slime-c-p-c
> slime-editing-commands slime-autodoc slime-repl elp slime-parse slime
> lisp-mnt gud apropos etags xref project arc-mode archive-mode hyperspec
> csv-mode magit-blame magit-stash magit-bisect magit-remote magit-commit
> magit-sequence magit magit-apply magit-wip magit-log magit-diff
> smerge-mode magit-core magit-autorevert autorevert filenotify
> magit-process magit-popup magit-mode magit-git magit-section magit-utils
> git-commit log-edit pcvs-util with-editor async-bytecomp async tramp-sh
> tramp tramp-compat tramp-loaddefs trampver ucs-normalize shell dash
> eieio-opt speedbar sb-image ezimage dframe cal-china lunar solar cal-dst
> cal-bahai cal-islam cal-hebrew holidays hol-loaddefs cal-iso bookmark pp
> tabify org-rmail org-mhe org-irc org-info org-gnus org-docview doc-view
> jka-compr image-mode org-bbdb org-w3m org-table org-archive org-clock
> org-indent ob-ditaa ob-plantuml org-bibtex org-element avl-tree bibtex
> org-colview org-crypt org-habit org-agenda help-fns radix-tree misearch
> multi-isearch thingatpt debbugs-gnu add-log debbugs soap-client warnings
> rng-xsd rng-dt rng-util xsd-regexp debug cus-start cus-load mailalias
> bbdb-message footnote ecomplete flow-fill vc-git diff-mode sort
> gnus-cite shr-color color shr svg dom browse-url mail-extr gnus-async
> gnus-bcklg qp gnus-ml disp-table gnus-topic mm-archive url-http url-gw
> url-cache url-auth pop3 nnrss xml mm-url url url-proxy url-privacy
> url-expand url-methods url-history url-cookie url-domsuf url-util
> nndraft nnmh nnml utf-7 bbdb-gnus epa-file network-stream nsm starttls
> gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg nntp
> gnus-cache pok-gnus gnus-icalendar org-capture gnus-art mm-uu mml2015
> mm-view mml-smime smime dig mailcap icalendar diary-lib diary-loaddefs
> nnir gnus-sum gnus-group gnus-undo bbdb-mua bbdb-com crm bbdb bbdb-site
> timezone gnus-start gnus-cloud nnimap nnmail mail-source tls gnutls utf7
> netrc nnoo parse-time gnus-spec gnus-int gnus-range message sendmail
> puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg mm-decode
> mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
> gnus-win gnus nnheader subr-x gnus-util rmail rmail-loaddefs rfc2047
> rfc2045 ietf-drums mail-utils wid-edit linum paren paredit pok-init
> bugz-mode yasnippet org advice org-macro org-footnote org-pcomplete
> pcomplete org-list org-faces org-entities time-date noutline outline
> org-version ob-emacs-lisp ob ob-tangle ob-ref ob-lob ob-table ob-exp
> org-src ob-keys ob-comint ob-core ob-eval org-compat org-macs
> org-loaddefs format-spec find-func cal-menu calendar cal-loaddefs gedcom
> slime-autoloads reftex reftex-loaddefs reftex-vars edmacro kmacro ido
> server filladapt dmacro mm-util mail-prsvr cl compile comint ansi-color
> ring finder-inf tex-site info package epg-config url-handlers url-parse
> auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
> password-cache url-vars seq byte-opt gv bytecomp byte-compile cl-extra
> help-mode easymenu cconv cl-loaddefs pcase cl-lib emacs-goodies-el
> emacs-goodies-custom emacs-goodies-loaddefs easy-mmode mule-util tooltip
> eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel
> term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
> regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode
> prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
> mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame
> cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai
> tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian
> slovak czech european ethiopic indian cyrillic chinese charscript
> case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer
> cl-preloaded nadvice loaddefs button faces cus-face macroexp files
> text-properties overlay sha1 md5 base64 format env code-pages mule
> custom widget hashtable-print-readable backquote dbusbind inotify
> dynamic-setting system-font-setting font-render-setting x-toolkit x
> multi-tty make-network-process emacs)
>
> Memory information:
> ((conses 16 2485829 182861)
>  (symbols 48 72236 91)
>  (miscs 40 3269 4672)
>  (strings 32 298119 63000)
>  (string-bytes 1 12887713)
>  (vectors 16 103720)
>  (vector-slots 8 2448384 49706)
>  (floats 8 4985 2034)
>  (intervals 56 225770 627)
>  (buffers 976 190)
>  (heap 1024 299121 -1842968))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24315; Package emacs. (Tue, 30 Aug 2016 13:10:02 GMT) Full text and rfc822 format available.

Message #11 received at 24315 <at> debbugs.gnu.org (full text, mbox):

From: pok <at> netfonds.no (Peder O. Klingenberg)
To: npostavs <at> users.sourceforge.net
Cc: 24315 <at> debbugs.gnu.org
Subject: Re: bug#24315: 25.1.50;
 re-search-forward errors with "Variable binding depth exceeds
 max-specpdl-size"
Date: Tue, 30 Aug 2016 15:09:34 +0200
[Message part 1 (text/plain, inline)]
On Fri, Aug 26 2016 at 23:35, npostavs <at> users.sourceforge.net wrote:

> This looks like it would be an inefficient regexp, since it has nested
> stars.  I suspect searching for "^[ \t]" multiple times would be more
> efficient than trying to match multiple lines in a single regexp.

Tried that.  It sort of worked, in that it worked when I directly called
`icalendar--read-event' in a buffer containing the event as manually
extracted from the gnus message.

However, parsing the problematic message in gnus still failed.  It turns
out `gnus-icalendar-event-from-buffer' calls
`icalendar--get-unfolded-buffer' before `icalendar--read-event'.

`icalendar--get-unfolded-buffer' takes care of all those pesky line
continuations, and returns a buffer with each element occupying exactly
one line.  So essentially `icalendar--read-event' was using a regexp to
extract the rest of the line, and that failed with a line nearly 40k
characters long.

The only other in-tree caller of `icalendar--read-event' (excluding
itself) also calls `icalendar--get-unfolded-buffer' first, and indeed,
`icalendar-read-event' already relies on this to take care of line
continuations in element parameters (as opposed to values).

Attached is a patch that uses buffer-substring to accomplish the same
thing as the offending regexp, and documents the dependency on
`icalendar--get-unfolded-buffer'.  This fixes the problem for me.

[bug24315.patch (text/x-diff, attachment)]

Added tag(s) patch. Request was from pok <at> netfonds.no (Peder O. Klingenberg) to control <at> debbugs.gnu.org. (Tue, 30 Aug 2016 13:11:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24315; Package emacs. (Fri, 02 Sep 2016 01:59:01 GMT) Full text and rfc822 format available.

Message #16 received at 24315 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: pok <at> netfonds.no (Peder O. Klingenberg)
Cc: 24315 <at> debbugs.gnu.org
Subject: Re: bug#24315: 25.1.50;
 re-search-forward errors with "Variable binding depth exceeds
 max-specpdl-size"
Date: Thu, 01 Sep 2016 21:58:36 -0400
pok <at> netfonds.no (Peder O. Klingenberg) writes:

> `icalendar--get-unfolded-buffer' takes care of all those pesky line
> continuations, and returns a buffer with each element occupying exactly
> one line.  So essentially `icalendar--read-event' was using a regexp to
> extract the rest of the line, and that failed with a line nearly 40k
> characters long.
>
> The only other in-tree caller of `icalendar--read-event' (excluding
> itself) also calls `icalendar--get-unfolded-buffer' first, and indeed,
> `icalendar-read-event' already relies on this to take care of line
> continuations in element parameters (as opposed to values).
>
> Attached is a patch that uses buffer-substring to accomplish the same
> thing as the offending regexp, and documents the dependency on
> `icalendar--get-unfolded-buffer'.  This fixes the problem for me.

If it works without the regexp, that's even better.

> -it finds."
> +it finds. The current buffer should be an unfolded buffer as returned
            ^
Sentences should be double spaced.

> +from `icalendar--get-unfolded-buffer'."
>    (let (element children line name params param param-name param-value
>                  value
>                  (continue t))
> @@ -391,8 +392,8 @@ icalendar--read-element
>        (unless (looking-at ":")
>          (error "Oops"))
>        (forward-char 1)
> -      (re-search-forward  "\\(.*\\)\\(\r?\n[ \t].*\\)*" nil t)
> -      (setq value (icalendar--rris "\r?\n[ \t]" "" (match-string 0)))
> +      (setq value (buffer-substring (point) (line-end-position)))
> +      (end-of-line)

Might be better to avoid finding the end of line twice (since apparently
40k lines do happen, I guess it's worth thinking a bit about
optimizing):

(let ((start (prog1 (point) (end-of-line))))
  (setq value (buffer-substring start (point))))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24315; Package emacs. (Fri, 02 Sep 2016 13:51:02 GMT) Full text and rfc822 format available.

Message #19 received at submit <at> debbugs.gnu.org (full text, mbox):

From: peder <at> klingenberg.no (Peder O. Klingenberg)
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#24315: 25.1.50;
 re-search-forward errors with "Variable binding depth exceeds
 max-specpdl-size"
Date: Fri, 02 Sep 2016 15:45:34 +0200
[Message part 1 (text/plain, inline)]
On Thu, Sep 01 2016 at 21:58, npostavs <at> users.sourceforge.net wrote:

>> -it finds."
>> +it finds. The current buffer should be an unfolded buffer as returned
>             ^
> Sentences should be double spaced.

Gah!  And I'm usually chided for using old-fashioned double spaces in
prose. :)

> Might be better to avoid finding the end of line twice (since apparently
> 40k lines do happen, I guess it's worth thinking a bit about
> optimizing):

Even finding the the end of the line twice was faster than the regexp
method, subjectively.  On my problematic 40k line, it did not take
noticable time, whereas the regexp caused a bit of a delay even on
shorter events.  But I agree, let's not make emacs do more work than
necessary.  Updated patch attached.

[bug24315.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24315; Package emacs. (Sat, 03 Sep 2016 14:22:01 GMT) Full text and rfc822 format available.

Message #22 received at 24315 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: peder <at> klingenberg.no (Peder O. Klingenberg)
Cc: 24315 <at> debbugs.gnu.org
Subject: Re: bug#24315: 25.1.50;
 re-search-forward errors with "Variable binding depth exceeds
 max-specpdl-size"
Date: Sat, 03 Sep 2016 10:21:16 -0400
# the new bug will be about the specdl error
clone 24315 -1
# this bug is about the bad regex in icalendar
retitle 24315 icalendar--read-element uses inefficient regexp
quit

peder <at> klingenberg.no (Peder O. Klingenberg) writes:
>  Updated patch attached.
>
[...]
> Subject: [PATCH] Avoid crash in icalendar--read-element
>
> * lisp/calendar/icalendar.el (icalendar--read-element): Stop crashing
> when parsing overly long event descriptions.  (Bug#24315)

Patch looks good, though I think the description shouldn't say "crash",
since the problem is a regex stack overflow, which is just a normal
Emacs error (I've figured out the reason why it's triggering
max-specpdl-size instead of regex stack overflow in master, and will
address it in a separate bug).




bug 24315 cloned as bug 24358. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sat, 03 Sep 2016 14:22:02 GMT) Full text and rfc822 format available.

Changed bug title to 'icalendar--read-element uses inefficient regexp' from '25.1.50; re-search-forward errors with "Variable binding depth exceeds max-specpdl-size"' Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Sat, 03 Sep 2016 14:22:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24315; Package emacs. (Tue, 06 Sep 2016 08:19:02 GMT) Full text and rfc822 format available.

Message #29 received at 24315 <at> debbugs.gnu.org (full text, mbox):

From: peder <at> klingenberg.no (Peder O. Klingenberg)
To: npostavs <at> users.sourceforge.net
Cc: 24315 <at> debbugs.gnu.org
Subject: Re: bug#24315: 25.1.50;
 re-search-forward errors with "Variable binding depth exceeds
 max-specpdl-size"
Date: Tue, 06 Sep 2016 10:18:13 +0200
[Message part 1 (text/plain, inline)]
On Sat, Sep 03 2016 at 10:21, npostavs <at> users.sourceforge.net wrote:

> Patch looks good, though I think the description shouldn't say "crash",
> since the problem is a regex stack overflow, which is just a normal
> Emacs error

I agree, that was a poor choice of words.  How about this?

[bug24315.patch (text/x-diff, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24315; Package emacs. (Wed, 07 Sep 2016 23:28:02 GMT) Full text and rfc822 format available.

Message #32 received at 24315 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: peder <at> klingenberg.no (Peder O. Klingenberg)
Cc: 24315 <at> debbugs.gnu.org
Subject: Re: bug#24315: 25.1.50;
 re-search-forward errors with "Variable binding depth exceeds
 max-specpdl-size"
Date: Wed, 07 Sep 2016 19:27:56 -0400
tags 24315 fixed
close 24315 25.2
quit

peder <at> klingenberg.no (Peder O. Klingenberg) writes:

> On Sat, Sep 03 2016 at 10:21, npostavs <at> users.sourceforge.net wrote:
>
> I agree, that was a poor choice of words.  How about this?

Thanks, pushed as 55dde6c1





Added tag(s) fixed. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Wed, 07 Sep 2016 23:28:04 GMT) Full text and rfc822 format available.

bug marked as fixed in version 25.2, send any further explanations to 24315 <at> debbugs.gnu.org and peder <at> klingenberg.no (Peder O. Klingenberg) Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Wed, 07 Sep 2016 23:28:04 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 06 Oct 2016 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 314 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.