From unknown Sat Jun 21 03:26:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25391: 24.5; ffap-guesser "stack overflow in regexp matcher" error may crash emacs. Resent-From: Thierry Volpiatto Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Jan 2017 07:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 25391 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 25391@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.148386071521907 (code B ref -1); Sun, 08 Jan 2017 07:32:01 +0000 Received: (at submit) by debbugs.gnu.org; 8 Jan 2017 07:31:55 +0000 Received: from localhost ([127.0.0.1]:46448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQ7xK-0005hG-Kd for submit@debbugs.gnu.org; Sun, 08 Jan 2017 02:31:55 -0500 Received: from eggs.gnu.org ([208.118.235.92]:33909) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQ7xI-0005h2-IG for submit@debbugs.gnu.org; Sun, 08 Jan 2017 02:31:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cQ7xA-0000sF-EP for submit@debbugs.gnu.org; Sun, 08 Jan 2017 02:31:47 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:59272) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cQ7xA-0000sA-B6 for submit@debbugs.gnu.org; Sun, 08 Jan 2017 02:31:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53095) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cQ7x7-0001y3-Fj for bug-gnu-emacs@gnu.org; Sun, 08 Jan 2017 02:31:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cQ7x4-0000rG-9z for bug-gnu-emacs@gnu.org; Sun, 08 Jan 2017 02:31:41 -0500 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]:37589) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cQ7x3-0000pg-Ui for bug-gnu-emacs@gnu.org; Sun, 08 Jan 2017 02:31:38 -0500 Received: by mail-wm0-x235.google.com with SMTP id t79so81336184wmt.0 for ; Sat, 07 Jan 2017 23:31:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=user-agent:from:to:subject:date:message-id:mime-version; bh=AkBlE7hfUipkJzMm5ZqKMIrVTMuDEpFBVR0TT8g1wCo=; b=gdLnw9xXmpecK6jpSvzWnB6wZQq5psLoyA6UbB4PhkMPYS6nL0EqHZYM/fzabkKWJU pDbXLPBjtyTLcMKbFOiDTQtJx2zfnZ9MgGyUwYNbOOdCz5basmtf35nKYZy4JrObVVRQ txr2uv9Qmz/K+8ZgzUlOPyNfNiTJAJSnVGpvq2aRb982wcY7qJgFp7C8DyMB4h1Z1dy7 qOkgdcI6Kb0JVGzaRhASR4GUQE/l49AqDlGthrl0N25XY8WsBSYszKbpm14Ju1FxN2PL TiO5F/iH8ATffal4JWWLDC4fMTFyUHCbaCPI/u9KbpSSww8zRETOOA0cJ0dy9wxwm2QS 552A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:user-agent:from:to:subject:date:message-id :mime-version; bh=AkBlE7hfUipkJzMm5ZqKMIrVTMuDEpFBVR0TT8g1wCo=; b=EZpBapahS3ialp2MAlPzaJXGMr9SBkJmSjytIw6Mmdc8dg8703uVkdHLlzM5cNubm0 +DBnVA79eAojw2GQNCvnZgM2mwDXpCW2zPRL8umuU5SAEk7HBLqeyk7opaeQafulPVjS WAv2exccuJMxh9XIJlXFbcIF7TxC1o8Z5A3vEMVJM6jT+I6ZRermqMDn4FK8R4zaEAQ0 1NGkoQpHnHEQCHV+u3tsCJWDfIMw3ieadPXMCoLfdjUuMGS5IAkeSbjHTU6hkA6Tzc3q MbxZyrvpJB1a2jNucNh9SVyJFFYpTreX8Mqz197Vfdn4GKyDP9wbvTX++TTiO5B/GJxw 0TCA== X-Gm-Message-State: AIkVDXIlgRgUFliw67C+H3RsqYJWZYsfm7+xBt0wnZUJxqZwBmjGXfj04eWp7Kfbl3eghg== X-Received: by 10.28.232.16 with SMTP id f16mr2101162wmh.103.1483860694816; Sat, 07 Jan 2017 23:31:34 -0800 (PST) Received: from dell-14z ([37.161.106.149]) by smtp.gmail.com with ESMTPSA id yo9sm6229668wjc.14.2017.01.07.23.31.32 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sat, 07 Jan 2017 23:31:33 -0800 (PST) User-agent: mu4e 0.9.19; emacs 24.5.1 From: Thierry Volpiatto Date: Sun, 08 Jan 2017 08:31:30 +0100 Message-ID: <87vatqc8j1.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) Reproduce from emacs -Q: 1) require ffap. 2) Open a file of about 560k containing only one line, e.g "~/emacs.d/elpa/archives/archive-contents" 3) M-: (ffap-guesser) Debugger entered--Lisp error: (error "Variable binding depth exceeds max-specpdl-size") looking-at("^.*\\<\\(Type\\|Name\\|Path\\|Host\\|Port\\) *= *\\(.*\\) *$") ffap-gopher-at-point() ffap-guesser() eval((ffap-guesser) nil) eval-expression((ffap-guesser) nil) funcall-interactively(eval-expression (ffap-guesser) nil) call-interactively(eval-expression nil nil) command-execute(eval-expression) This is reproductible from emacs-26 as well. In GNU Emacs 24.5.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.8) of 2016-11-09 on dell-14z Windowing system distributor `The X.Org Foundation', version 11.0.11701000 System Description: Linux Mint 17.3 Rosa Configured using: `configure CFLAGS=-O3' Important settings: value of $LC_MONETARY: fr_FR.UTF-8 value of $LC_NUMERIC: fr_FR.UTF-8 value of $LC_TIME: fr_FR.UTF-8 value of $LANG: fr_FR.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: global-disable-mouse-mode: t global-git-gutter-mode: t eldoc-in-minibuffer-mode: t global-undo-tree-mode: t undo-tree-mode: t diff-auto-refine-mode: t magit-auto-revert-mode: t global-git-commit-mode: t psession-mode: t dired-async-mode: t display-time-mode: t winner-mode: t auto-image-file-mode: t savehist-mode: t show-paren-mode: t helm-descbinds-mode: t helm-top-poll-mode: t helm-push-mark-mode: t eldoc-mode: t helm-mode: t shell-dirtrack-mode: t helm-adaptive-mode: t helm-popup-tip-mode: t async-bytecomp-package-mode: t minibuffer-depth-indicate-mode: t override-global-mode: t tooltip-mode: t mouse-wheel-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 column-number-mode: t line-number-mode: t transient-mark-mode: t Recent messages: uncompressing window.el.gz...done Setting up indent for shell type bash Indentation variables are now local. Indentation setup for shell type bash uncompressing reposition.el.gz...done Restoring buffers...77% Configuring package slime...done Restoring buffers...82% uncompressing imenu.el.gz...done Restoring buffers...done Load-path shadows: /home/thierry/.emacs.d/elpa/org-20161224/ob-keys hides /usr/local/share/emacs/24.5/lisp/org/ob-keys /home/thierry/.emacs.d/elpa/org-20161224/ob-ref hides /usr/local/share/emacs/24.5/lisp/org/ob-ref /home/thierry/.emacs.d/elpa/org-20161224/ox-org hides /usr/local/share/emacs/24.5/lisp/org/ox-org /home/thierry/.emacs.d/elpa/org-20161224/ob-sass hides /usr/local/share/emacs/24.5/lisp/org/ob-sass /home/thierry/.emacs.d/elpa/org-20161224/org-bbdb hides /usr/local/share/emacs/24.5/lisp/org/org-bbdb /home/thierry/.emacs.d/elpa/org-20161224/ox-latex hides /usr/local/share/emacs/24.5/lisp/org/ox-latex /home/thierry/.emacs.d/elpa/org-20161224/ox-beamer hides /usr/local/share/emacs/24.5/lisp/org/ox-beamer /home/thierry/.emacs.d/elpa/org-20161224/org-crypt hides /usr/local/share/emacs/24.5/lisp/org/org-crypt /home/thierry/.emacs.d/elpa/org-20161224/ob-maxima hides /usr/local/share/emacs/24.5/lisp/org/ob-maxima /home/thierry/.emacs.d/elpa/org-20161224/ob-R hides /usr/local/share/emacs/24.5/lisp/org/ob-R /home/thierry/.emacs.d/elpa/org-20161224/ob-eval hides /usr/local/share/emacs/24.5/lisp/org/ob-eval /home/thierry/.emacs.d/elpa/org-20161224/org-datetree hides /usr/local/share/emacs/24.5/lisp/org/org-datetree /home/thierry/.emacs.d/elpa/org-20161224/org-element hides /usr/local/share/emacs/24.5/lisp/org/org-element /home/thierry/.emacs.d/elpa/org-20161224/ob-core hides /usr/local/share/emacs/24.5/lisp/org/ob-core /home/thierry/.emacs.d/elpa/org-20161224/ox-md hides /usr/local/share/emacs/24.5/lisp/org/ox-md /home/thierry/.emacs.d/elpa/org-20161224/org-indent hides /usr/local/share/emacs/24.5/lisp/org/org-indent /home/thierry/.emacs.d/elpa/org-20161224/ox hides /usr/local/share/emacs/24.5/lisp/org/ox /home/thierry/.emacs.d/elpa/org-20161224/ob-fortran hides /usr/local/share/emacs/24.5/lisp/org/ob-fortran /home/thierry/.emacs.d/elpa/org-20161224/ob-matlab hides /usr/local/share/emacs/24.5/lisp/org/ob-matlab /home/thierry/.emacs.d/elpa/org-20161224/org-macro hides /usr/local/share/emacs/24.5/lisp/org/org-macro /home/thierry/.emacs.d/elpa/org-20161224/ox-texinfo hides /usr/local/share/emacs/24.5/lisp/org/ox-texinfo /home/thierry/.emacs.d/elpa/org-20161224/ob-sqlite hides /usr/local/share/emacs/24.5/lisp/org/ob-sqlite /home/thierry/.emacs.d/elpa/org-20161224/org-faces hides /usr/local/share/emacs/24.5/lisp/org/org-faces /home/thierry/.emacs.d/elpa/org-20161224/org-pcomplete hides /usr/local/share/emacs/24.5/lisp/org/org-pcomplete /home/thierry/.emacs.d/elpa/org-20161224/org-mouse hides /usr/local/share/emacs/24.5/lisp/org/org-mouse /home/thierry/.emacs.d/elpa/org-20161224/ob-emacs-lisp hides /usr/local/share/emacs/24.5/lisp/org/ob-emacs-lisp /home/thierry/.emacs.d/elpa/org-20161224/org-archive hides /usr/local/share/emacs/24.5/lisp/org/org-archive /home/thierry/.emacs.d/elpa/org-20161224/org-capture hides /usr/local/share/emacs/24.5/lisp/org/org-capture /home/thierry/.emacs.d/elpa/org-20161224/ob-awk hides /usr/local/share/emacs/24.5/lisp/org/ob-awk /home/thierry/.emacs.d/elpa/org-20161224/ob-octave hides /usr/local/share/emacs/24.5/lisp/org/ob-octave /home/thierry/.emacs.d/elpa/org-20161224/org-timer hides /usr/local/share/emacs/24.5/lisp/org/org-timer /home/thierry/.emacs.d/elpa/org-20161224/ob-sql hides /usr/local/share/emacs/24.5/lisp/org/ob-sql /home/thierry/.emacs.d/elpa/org-20161224/ob-latex hides /usr/local/share/emacs/24.5/lisp/org/ob-latex /home/thierry/.emacs.d/elpa/org-20161224/org-macs hides /usr/local/share/emacs/24.5/lisp/org/org-macs /home/thierry/.emacs.d/elpa/org-20161224/org-rmail hides /usr/local/share/emacs/24.5/lisp/org/org-rmail /home/thierry/.emacs.d/elpa/org-20161224/org-w3m hides /usr/local/share/emacs/24.5/lisp/org/org-w3m /home/thierry/.emacs.d/elpa/org-20161224/ob-io hides /usr/local/share/emacs/24.5/lisp/org/ob-io /home/thierry/.emacs.d/elpa/org-20161224/ob hides /usr/local/share/emacs/24.5/lisp/org/ob /home/thierry/.emacs.d/elpa/org-20161224/ob-perl hides /usr/local/share/emacs/24.5/lisp/org/ob-perl /home/thierry/.emacs.d/elpa/org-20161224/ob-mscgen hides /usr/local/share/emacs/24.5/lisp/org/ob-mscgen /home/thierry/.emacs.d/elpa/org-20161224/ob-lilypond hides /usr/local/share/emacs/24.5/lisp/org/ob-lilypond /home/thierry/.emacs.d/elpa/org-20161224/org-footnote hides /usr/local/share/emacs/24.5/lisp/org/org-footnote /home/thierry/.emacs.d/elpa/org-20161224/ob-java hides /usr/local/share/emacs/24.5/lisp/org/ob-java /home/thierry/.emacs.d/elpa/org-20161224/ox-html hides /usr/local/share/emacs/24.5/lisp/org/ox-html /home/thierry/.emacs.d/elpa/org-20161224/ob-haskell hides /usr/local/share/emacs/24.5/lisp/org/ob-haskell /home/thierry/.emacs.d/elpa/org-20161224/org-docview hides /usr/local/share/emacs/24.5/lisp/org/org-docview /home/thierry/.emacs.d/elpa/org-20161224/ob-comint hides /usr/local/share/emacs/24.5/lisp/org/ob-comint /home/thierry/.emacs.d/elpa/org-20161224/ob-css hides /usr/local/share/emacs/24.5/lisp/org/ob-css /home/thierry/.emacs.d/elpa/org-20161224/ob-ditaa hides /usr/local/share/emacs/24.5/lisp/org/ob-ditaa /home/thierry/.emacs.d/elpa/org-20161224/ob-scala hides /usr/local/share/emacs/24.5/lisp/org/ob-scala /home/thierry/.emacs.d/elpa/org-20161224/org hides /usr/local/share/emacs/24.5/lisp/org/org /home/thierry/.emacs.d/elpa/org-20161224/org-mobile hides /usr/local/share/emacs/24.5/lisp/org/org-mobile /home/thierry/.emacs.d/elpa/org-20161224/ob-lisp hides /usr/local/share/emacs/24.5/lisp/org/ob-lisp /home/thierry/.emacs.d/elpa/org-20161224/ob-gnuplot hides /usr/local/share/emacs/24.5/lisp/org/ob-gnuplot /home/thierry/.emacs.d/elpa/org-20161224/org-src hides /usr/local/share/emacs/24.5/lisp/org/org-src /home/thierry/.emacs.d/elpa/org-20161224/ox-ascii hides /usr/local/share/emacs/24.5/lisp/org/ox-ascii /home/thierry/.emacs.d/elpa/org-20161224/ob-calc hides /usr/local/share/emacs/24.5/lisp/org/ob-calc /home/thierry/.emacs.d/elpa/org-20161224/org-irc hides /usr/local/share/emacs/24.5/lisp/org/org-irc /home/thierry/.emacs.d/elpa/org-20161224/org-loaddefs hides /usr/local/share/emacs/24.5/lisp/org/org-loaddefs /home/thierry/.emacs.d/elpa/org-20161224/org-install hides /usr/local/share/emacs/24.5/lisp/org/org-install /home/thierry/.emacs.d/elpa/org-20161224/org-info hides /usr/local/share/emacs/24.5/lisp/org/org-info /home/thierry/.emacs.d/elpa/org-20161224/ob-plantuml hides /usr/local/share/emacs/24.5/lisp/org/ob-plantuml /home/thierry/.emacs.d/elpa/org-20161224/org-feed hides /usr/local/share/emacs/24.5/lisp/org/org-feed /home/thierry/.emacs.d/elpa/org-20161224/org-version hides /usr/local/share/emacs/24.5/lisp/org/org-version /home/thierry/.emacs.d/elpa/org-20161224/ob-makefile hides /usr/local/share/emacs/24.5/lisp/org/ob-makefile /home/thierry/.emacs.d/elpa/org-20161224/org-entities hides /usr/local/share/emacs/24.5/lisp/org/org-entities /home/thierry/.emacs.d/elpa/org-20161224/ob-python hides /usr/local/share/emacs/24.5/lisp/org/ob-python /home/thierry/.emacs.d/elpa/org-20161224/ob-ledger hides /usr/local/share/emacs/24.5/lisp/org/ob-ledger /home/thierry/.emacs.d/elpa/org-20161224/ox-man hides /usr/local/share/emacs/24.5/lisp/org/ox-man /home/thierry/.emacs.d/elpa/org-20161224/ob-shen hides /usr/local/share/emacs/24.5/lisp/org/ob-shen /home/thierry/.emacs.d/elpa/org-20161224/org-inlinetask hides /usr/local/share/emacs/24.5/lisp/org/org-inlinetask /home/thierry/.emacs.d/elpa/org-20161224/org-list hides /usr/local/share/emacs/24.5/lisp/org/org-list /home/thierry/.emacs.d/elpa/org-20161224/ox-publish hides /usr/local/share/emacs/24.5/lisp/org/ox-publish /home/thierry/.emacs.d/elpa/org-20161224/org-gnus hides /usr/local/share/emacs/24.5/lisp/org/org-gnus /home/thierry/.emacs.d/elpa/org-20161224/org-agenda hides /usr/local/share/emacs/24.5/lisp/org/org-agenda /home/thierry/.emacs.d/elpa/org-20161224/org-id hides /usr/local/share/emacs/24.5/lisp/org/org-id /home/thierry/.emacs.d/elpa/org-20161224/org-plot hides /usr/local/share/emacs/24.5/lisp/org/org-plot /home/thierry/.emacs.d/elpa/org-20161224/ob-C hides /usr/local/share/emacs/24.5/lisp/org/ob-C /home/thierry/.emacs.d/elpa/org-20161224/org-clock hides /usr/local/share/emacs/24.5/lisp/org/org-clock /home/thierry/.emacs.d/elpa/org-20161224/org-attach hides /usr/local/share/emacs/24.5/lisp/org/org-attach /home/thierry/.emacs.d/elpa/org-20161224/ob-ruby hides /usr/local/share/emacs/24.5/lisp/org/ob-ruby /home/thierry/.emacs.d/elpa/org-20161224/org-habit hides /usr/local/share/emacs/24.5/lisp/org/org-habit /home/thierry/.emacs.d/elpa/org-20161224/org-eshell hides /usr/local/share/emacs/24.5/lisp/org/org-eshell /home/thierry/.emacs.d/elpa/org-20161224/ob-ocaml hides /usr/local/share/emacs/24.5/lisp/org/ob-ocaml /home/thierry/.emacs.d/elpa/org-20161224/ox-odt hides /usr/local/share/emacs/24.5/lisp/org/ox-odt /home/thierry/.emacs.d/elpa/org-20161224/ob-exp hides /usr/local/share/emacs/24.5/lisp/org/ob-exp /home/thierry/.emacs.d/elpa/org-20161224/ob-dot hides /usr/local/share/emacs/24.5/lisp/org/ob-dot /home/thierry/.emacs.d/elpa/org-20161224/ob-scheme hides /usr/local/share/emacs/24.5/lisp/org/ob-scheme /home/thierry/.emacs.d/elpa/org-20161224/ob-org hides /usr/local/share/emacs/24.5/lisp/org/ob-org /home/thierry/.emacs.d/elpa/org-20161224/org-bibtex hides /usr/local/share/emacs/24.5/lisp/org/org-bibtex /home/thierry/.emacs.d/elpa/org-20161224/org-compat hides /usr/local/share/emacs/24.5/lisp/org/org-compat /home/thierry/.emacs.d/elpa/org-20161224/ox-icalendar hides /usr/local/share/emacs/24.5/lisp/org/ox-icalendar /home/thierry/.emacs.d/elpa/org-20161224/org-colview hides /usr/local/share/emacs/24.5/lisp/org/org-colview /home/thierry/.emacs.d/elpa/org-20161224/ob-picolisp hides /usr/local/share/emacs/24.5/lisp/org/ob-picolisp /home/thierry/.emacs.d/elpa/org-20161224/org-mhe hides /usr/local/share/emacs/24.5/lisp/org/org-mhe /home/thierry/.emacs.d/elpa/org-20161224/org-table hides /usr/local/share/emacs/24.5/lisp/org/org-table /home/thierry/.emacs.d/elpa/org-20161224/ob-clojure hides /usr/local/share/emacs/24.5/lisp/org/ob-clojure /home/thierry/.emacs.d/elpa/org-20161224/ob-tangle hides /usr/local/share/emacs/24.5/lisp/org/ob-tangle /home/thierry/.emacs.d/elpa/org-20161224/ob-table hides /usr/local/share/emacs/24.5/lisp/org/ob-table /home/thierry/.emacs.d/elpa/org-20161224/ob-asymptote hides /usr/local/share/emacs/24.5/lisp/org/ob-asymptote /home/thierry/.emacs.d/elpa/org-20161224/org-ctags hides /usr/local/share/emacs/24.5/lisp/org/org-ctags /home/thierry/.emacs.d/elpa/org-20161224/ob-screen hides /usr/local/share/emacs/24.5/lisp/org/ob-screen /home/thierry/.emacs.d/elpa/org-20161224/org-protocol hides /usr/local/share/emacs/24.5/lisp/org/org-protocol /home/thierry/.emacs.d/elpa/org-20161224/ob-js hides /usr/local/share/emacs/24.5/lisp/org/ob-js /home/thierry/.emacs.d/elpa/org-20161224/ob-lob hides /usr/local/share/emacs/24.5/lisp/org/ob-lob /home/thierry/.emacs.d/elpa/soap-client-3.1.1/soap-client hides /usr/local/share/emacs/24.5/lisp/net/soap-client /home/thierry/.emacs.d/elpa/soap-client-3.1.1/soap-inspect hides /usr/local/share/emacs/24.5/lisp/net/soap-inspect Features: (shadow epa-mail face-remap emacsbug helm-command js imenu slime-xref-browser tree-widget slime-banner slime-tramp slime-asdf slime-fancy slime-trace-dialog slime-fontifying-fu slime-package-fu slime-references slime-compiler-notes-tree slime-scratch slime-presentations bridge slime-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 slime-parse slime etags arc-mode archive-mode hyperspec make-mode cc-awk conf-mode macrostep-c subr-x cmacexp macrostep cc-langs cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs vc-rcs ledger-config ledger vc-git naquadah-theme view mule-util solar cal-dst holidays hol-loaddefs em-unix em-term term disp-table ehelp em-script em-prompt em-ls em-hist em-pred em-glob em-dirs em-cmpl em-basic em-banner em-alias tv-utils gh gh-users gh-issues gh-pulls gh-repos gh-comments gh-gist gh-oauth gh-api logito gh-cache pcache eieio-base gh-auth gh-url url-http tls url-auth url-gw disable-mouse powerline powerline-separators color powerline-themes windmove benchmark-init toc-org ert ewoc debug elp cl-indent esh-var esh-io esh-cmd esh-opt esh-ext esh-proc esh-arg esh-groups eshell esh-module esh-mode esh-util markdown-mode addressbook-bookmark mu4e-config org-mu4e helm-mu mu4e-contrib mu4e desktop frameset mu4e-speedbar speedbar sb-image ezimage dframe mu4e-main mu4e-context mu4e-view epa derived epg mu4e-headers mu4e-compose mu4e-draft mu4e-actions ido rfc2368 smtpmail sendmail mu4e-mark mu4e-message html2text mu4e-proc mu4e-utils mu4e-lists mu4e-vars hl-line cl mu4e-meta config-w3m w3m-search w3m doc-view jka-compr image-mode timezone w3m-hist w3m-fb bookmark-w3m w3m-ems w3m-ccl ccl w3m-favicon w3m-image w3m-proc w3m-util git-gutter cus-edit wid-edit appt diary-lib diary-loaddefs ange-ftp xdvi-search eldoc-eval undo-tree diff magit-obsolete magit-blame magit-stash magit-bisect magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-branch magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log magit-diff smerge-mode diff-mode magit-core magit-autorevert autorevert filenotify magit-process magit-margin magit-mode help-mode magit-git crm magit-section magit-popup git-commit magit-utils log-edit message rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log with-editor tramp-sh server pcomplete-extension pcmpl-unix pcmpl-gnu psession iterator iedit iedit-lib dired-extension org-config-thierry ob-sh org-crypt org-element avl-tree org-location-google-maps org-agenda google-maps google-maps-static google-maps-geocode google-maps-base org org-macro org-footnote org-pcomplete org-list org-faces org-entities noutline outline org-version ob-emacs-lisp ob ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp ob-comint ob-core ob-eval org-compat org-macs org-loaddefs find-func cal-menu calendar cal-loaddefs dired-async net-utils time winner w3m-wget wget wget-sysdep cmake-mode autotest-mode autoconf-mode sh-script smie executable ps-print ps-def lpr rst image-file savehist paren woman man ediff-merg ediff-wind ediff-diff ediff-mult ediff-help ediff-init ediff-util ediff init-helm-thierry helm-descbinds helm-sys popup helm-ring helm-elisp helm-eval edebug eldoc helm-mode helm-files image-dired tramp tramp-compat tramp-loaddefs trampver shell pcomplete format-spec dired-x dired-aux ffap thingatpt helm-buffers helm-elscreen helm-tags helm-bookmark helm-adaptive helm-info bookmark pp helm-locate helm-grep wgrep-helm wgrep grep helm-regexp helm-external helm-net browse-url xml url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap helm-utils compile comint ansi-color ring helm-help helm-types helm helm-source helm-multi-match helm-lib dired helm-extensions-autoloads helm-config helm-autoloads helm-easymenu cl-macs gv async-bytecomp advice async mb-depth edmacro kmacro use-package diminish bind-key easy-mmode tex-site gh-common gh-profile url-parse auth-source gnus-util mm-util help-fns mail-prsvr password-cache url-vars rx s ucs-normalize marshal ht json dash eieio byte-opt bytecomp byte-compile cl-extra cconv eieio-core slime-autoloads info easymenu package epg-config time-date avoid cus-start cus-load cl-loaddefs cl-lib tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer 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 make-network-process dbusbind gfilenotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) Memory information: ((conses 16 785234 224980) (symbols 48 66492 2) (miscs 40 369 2735) (strings 32 189134 114480) (string-bytes 1 5580098) (vectors 16 88824) (vector-slots 8 1295163 62942) (floats 8 2470 841) (intervals 56 2763 783) (buffers 960 162) (heap 1024 88807 14786)) -- Thierry From unknown Sat Jun 21 03:26:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25391: 24.5; ffap-guesser "stack overflow in regexp matcher" error may crash emacs. Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Jan 2017 15:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25391 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Thierry Volpiatto Cc: 25391@debbugs.gnu.org Received: via spool by 25391-submit@debbugs.gnu.org id=B25391.148388807415031 (code B ref 25391); Sun, 08 Jan 2017 15:08:02 +0000 Received: (at 25391) by debbugs.gnu.org; 8 Jan 2017 15:07:54 +0000 Received: from localhost ([127.0.0.1]:47009 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQF4b-0003uN-S6 for submit@debbugs.gnu.org; Sun, 08 Jan 2017 10:07:54 -0500 Received: from mail-it0-f41.google.com ([209.85.214.41]:35028) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQF4a-0003u8-Vm for 25391@debbugs.gnu.org; Sun, 08 Jan 2017 10:07:53 -0500 Received: by mail-it0-f41.google.com with SMTP id c20so40845694itb.0 for <25391@debbugs.gnu.org>; Sun, 08 Jan 2017 07:07:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=u58dTnF6p15WVF8F99PPkeofupZx9x0ku1asJrv13cc=; b=QgJtbGxWC3xAEjXzrDxa2tR1SLNDCikChCUONvwaQMD9LOGQ5hJcljaSGfjaVP5Tuc T9zQA2WZHnQ8n/99S24+iTJz6O2en/6bdVdqRlYsMdEk0nR+FXUnhfihfEZatJ+AeYnT R5Sxb2hEO4hw1vSIOo7oy44pSYejFzFv94SPtUOLhcZwcwtKptlWfd+jX+//w7c3RVFS FJ6hkk4KXBtG1bWvVWGpJ4DnwJFKVgL1IL3DzUgxkVngm+pIB8PBmQeA3GBZMDM3X1aU l18AuvE5VjTzEKI+SpOwoEQb407GgI5UkfxsqX4FrQuDEJOnRP3Qwn1KDt+oFkl4bzFQ Pzpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=u58dTnF6p15WVF8F99PPkeofupZx9x0ku1asJrv13cc=; b=RfBjxR61vEl/4Ug+2tEv1pSEL2HggEzj53VRQ+X1j07p7Dw2U7V1mdz6FNfVEhap9A WHZbze20xioPlWWUqmEriVsY3KV1gM+zbgcxso7lHsLVe4+GcCNcyIKQRgYW+qi97D+d d/oKhhYqpJsZrgaKzMQalhO26JsciXoCAosqRNnaL8AYrjPGFijcxDWRccPzKV2e1t/R 6vD6KfPoiiIkm+1/oPjMODmNdVxsdlJ8Bmj/TFi5P5vLCPkv4t1fAw3BVHJr216dxeq1 XAKieOl+n7LJMdB5M+jau4okTZEKvEgwAvsgDSkvvfUlLPp1Jo4QLISxpu8oYgLPFhhn vc/Q== X-Gm-Message-State: AIkVDXI+nBfqMjjnLF7d7GHm4TzXrbIZOK/7eoavHzYUtuAm6xunzV4HIXdtT1fKyR+QQQ== X-Received: by 10.36.68.146 with SMTP id o140mr6101280ita.33.1483888067443; Sun, 08 Jan 2017 07:07:47 -0800 (PST) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id f187sm4787519ita.7.2017.01.08.07.07.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 08 Jan 2017 07:07:46 -0800 (PST) From: npostavs@users.sourceforge.net References: <87vatqc8j1.fsf@gmail.com> Date: Sun, 08 Jan 2017 10:08:50 -0500 In-Reply-To: <87vatqc8j1.fsf@gmail.com> (Thierry Volpiatto's message of "Sun, 08 Jan 2017 08:31:30 +0100") Message-ID: <87y3yl1tdp.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) Thierry Volpiatto writes: > Reproduce from emacs -Q: > > 1) require ffap. > 2) Open a file of about 560k containing only one line, e.g > "~/emacs.d/elpa/archives/archive-contents" > 3) M-: (ffap-guesser) > > Debugger entered--Lisp error: (error "Variable binding depth exceeds max-specpdl-size") > looking-at("^.*\\<\\(Type\\|Name\\|Path\\|Host\\|Port\\) *= *\\(.*\\) *$") [...] > > This is reproductible from emacs-26 as well. The max-specpdl-size error looks like #24751 (I was planning to push the patch for that today), but as far as I know, that's only in emacs-26. emacs-25 and earlier correctly throw "stack overflow in regexp matcher". Unless you have REL_ALLOC enabled (which is the default for GNU/Linux distributions with the latest glibc), in which case any buffer search may crash emacs instead. That's #24358, occurs in 25.1 (and probably earlier), but it's already fixed in the emacs-25 branch. Also fixable by configuring with REL_ALLOC=no. From unknown Sat Jun 21 03:26:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25391: 24.5; ffap-guesser "stack overflow in regexp matcher" error may crash emacs. Resent-From: Thierry Volpiatto Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Jan 2017 17:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25391 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: npostavs@users.sourceforge.net Cc: 25391@debbugs.gnu.org Received: via spool by 25391-submit@debbugs.gnu.org id=B25391.14838965333385 (code B ref 25391); Sun, 08 Jan 2017 17:29:02 +0000 Received: (at 25391) by debbugs.gnu.org; 8 Jan 2017 17:28:53 +0000 Received: from localhost ([127.0.0.1]:47053 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQHH3-0000sW-Fy for submit@debbugs.gnu.org; Sun, 08 Jan 2017 12:28:53 -0500 Received: from mail-wm0-f42.google.com ([74.125.82.42]:37030) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQHH1-0000sK-Q8 for 25391@debbugs.gnu.org; Sun, 08 Jan 2017 12:28:52 -0500 Received: by mail-wm0-f42.google.com with SMTP id c206so3574799wme.0 for <25391@debbugs.gnu.org>; Sun, 08 Jan 2017 09:28:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=uRSTDxj3DTxdeB/VAU1YXvVSE31Dj3fgs10jh4/S5mg=; b=e9DZKc4HyjMBMJS4gUZ75Z6l548SfxVYFIP2ikDN3fK3187bKnCDMyIe28hfvaFDEK kzq5aHjAKkvX4hiL1PZANB5cD5DIgCoY9pAKyeAlcHISWnx+5aVr6+qmbuAG8i7N29nO HnhKwi3pJcZIffsZUNjbGuGnhHt4GauCu/YO/lf6hrHmFeq1OlX1KPsdViqSBTu++3Bv LjeBXWpq2LkCAO6Q2Mx2KWBHf5NrrO+GaoDj7ySP/ld5nxjt4Yckkcx67l9ADrvhJjTc ite51kl35zsPowrHujZ8MH/Ldkk2Pwv2bzOePuIZCm9pLnDbbsRV+86o1MyW87WzCC/A Nndw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=uRSTDxj3DTxdeB/VAU1YXvVSE31Dj3fgs10jh4/S5mg=; b=TrTDnc0wyJ8l5q5gHMlOApZ2wPPseAhGezgFZaUWtJrhxoYherWmEfmK+fSp3zUJx8 iqwcjOjHm+pywA84SI8djsphAXMApKJWC9sMDnIKJhLgVh2EHqCMS/nAWcGxLp6irMO7 jqPeAxxD/pJsB0Nn9rfN9isKn29sdmHU+Q9dwfKgfCjcM1TaWnrFUCUkD3edAq9cuCXm UK/ucnhwlJMMclfZf17mZ31WR2jJl728NKoMjKlWH7DdvG9mPhGCcD3NrJFPy9V2KBgA 8wO/uJsLpLpIhoBMD/sAFKVdrXLk0eOkut1z43UdRuaxhOejZzYLaxjd4dk1QVwx9F0H TJZw== X-Gm-Message-State: AIkVDXItGv2Wx035tMKlouqjfA6XXvpNedC1AJBJ/PN1jGWvSbmQVktR/XAMZ4Hz1PAOMA== X-Received: by 10.223.171.195 with SMTP id s61mr10551068wrc.23.1483896526046; Sun, 08 Jan 2017 09:28:46 -0800 (PST) Received: from dell-14z ([37.161.106.149]) by smtp.gmail.com with ESMTPSA id i10sm119842567wjd.15.2017.01.08.09.28.44 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sun, 08 Jan 2017 09:28:45 -0800 (PST) References: <87vatqc8j1.fsf@gmail.com> <87y3yl1tdp.fsf@users.sourceforge.net> User-agent: mu4e 0.9.19; emacs 26.0.50.2 From: Thierry Volpiatto In-reply-to: <87y3yl1tdp.fsf@users.sourceforge.net> Date: Sun, 08 Jan 2017 18:28:40 +0100 Message-ID: <8760lp8nqv.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) npostavs@users.sourceforge.net writes: > Thierry Volpiatto writes: > >> Reproduce from emacs -Q: >> >> 1) require ffap. >> 2) Open a file of about 560k containing only one line, e.g >> "~/emacs.d/elpa/archives/archive-contents" >> 3) M-: (ffap-guesser) >> >> Debugger entered--Lisp error: (error "Variable binding depth exceeds max-specpdl-size") >> looking-at("^.*\\<\\(Type\\|Name\\|Path\\|Host\\|Port\\) *= *\\(.*\\) *$") > [...] >> >> This is reproductible from emacs-26 as well. > > The max-specpdl-size error looks like #24751 (I was planning to push the > patch for that today), but as far as I know, that's only in emacs-26. > emacs-25 and earlier correctly throw "stack overflow in regexp matcher". > Unless you have REL_ALLOC enabled (which is the default for GNU/Linux > distributions with the latest glibc), in which case any buffer search > may crash emacs instead. That's #24358, occurs in 25.1 (and probably > earlier), but it's already fixed in the emacs-25 branch. Also fixable > by configuring with REL_ALLOC=no. Good to know thanks. However, this handle the problem with "Stack overflow in regexp matcher" generally, but perhaps regexps such as `ffap-gopher-regexp` could be avoided when possible in emacs source code. IIUC regexps like "^.*\\(this\\|that etc...\\)" create an incredible number of travels between bol and eol (which may sometimes be eob) and lead to a stack overflow inevitably on long lines (perhaps not so long in this case). Thanks. -- Thierry From unknown Sat Jun 21 03:26:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25391: 24.5; ffap-guesser "stack overflow in regexp matcher" error may crash emacs. Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Jan 2017 23:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25391 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Thierry Volpiatto Cc: 25391@debbugs.gnu.org Received: via spool by 25391-submit@debbugs.gnu.org id=B25391.148391809231110 (code B ref 25391); Sun, 08 Jan 2017 23:29:02 +0000 Received: (at 25391) by debbugs.gnu.org; 8 Jan 2017 23:28:12 +0000 Received: from localhost ([127.0.0.1]:47239 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQMsm-00085d-90 for submit@debbugs.gnu.org; Sun, 08 Jan 2017 18:28:12 -0500 Received: from mail-io0-f193.google.com ([209.85.223.193]:33010) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQMsk-00085H-IL; Sun, 08 Jan 2017 18:28:10 -0500 Received: by mail-io0-f193.google.com with SMTP id 101so1264881iom.0; Sun, 08 Jan 2017 15:28:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=xrhG7WdgJRV8cI2XE1NltsizOCFnUQ28sW0jGoKyz0k=; b=gM6MsDGNwL7qW6EIS1J3vbfPlimN9Tvvik6TADCdCyrHCHdB/nAD+nKoADQAeNH3FV 9S/349jFkSFxUv0rG2hXNrDcU1wpHCCUCaA9+vTv+QQUYSxOttgJ9ShMea4/f3ScXskH XmDngkX2YkH57usZxtX1BKIkVa5QUSXQ5XnI+YdOGuWlO8njW2J+fsIjbep3VzgGZpnV 5Es1YTDpSgC85oTlZ7f0XrBVS/eyJxfLisfyR/HNmt5ZxB7ENirrbOQ5rnjTwc9DlXXn 7rp/33P3ZJLJbD+PvfDSwMSBEPSzwdwFNFPPbLG47FE8FW1Z1LEJsyPRC+PRUNQtbmz+ I1WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=xrhG7WdgJRV8cI2XE1NltsizOCFnUQ28sW0jGoKyz0k=; b=uLnuIE0lbaNUvp8pUp1UlgLoGMkDJAEeIu/KUdoCyzFPPNLb7uMPX2TMycfZD960eg J+CeDphQhye5jX+hcFmrWxbqP8jyRxM6WCkcxXRrUloAJ/cncTMmC35mbhK5zdUUZip5 gQ+4XqehA+lvxrGPohtg6GcpVTk/WrrntCEYYcFjQjXL8f0aig0b8SbuMy+NfLrkUP/P wFdIUFu+xkgkOJqWBhR/CcQV/M0f4mdllkiqN8U1oBAZoZfUkwj82EhnvffQzA1VcEXn 6lBr3GeTZwz2/+eirO9SYUNQBvF0X5pJ84XmP9hgd9BUWdsAvhp/MxQ0xfliBg0LfPkD U+fg== X-Gm-Message-State: AIkVDXI8EU83MofMUO/Flc+jda8v4wv29QhZnOtjYSFGZzMUxKWObiiEYn1V05X8gUWaQg== X-Received: by 10.107.190.6 with SMTP id o6mr70388716iof.95.1483918084985; Sun, 08 Jan 2017 15:28:04 -0800 (PST) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id p187sm8096938iop.23.2017.01.08.15.28.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 08 Jan 2017 15:28:04 -0800 (PST) From: npostavs@users.sourceforge.net References: <87vatqc8j1.fsf@gmail.com> <87y3yl1tdp.fsf@users.sourceforge.net> <8760lp8nqv.fsf@gmail.com> Date: Sun, 08 Jan 2017 18:29:08 -0500 In-Reply-To: <8760lp8nqv.fsf@gmail.com> (Thierry Volpiatto's message of "Sun, 08 Jan 2017 18:28:40 +0100") Message-ID: <87lgul167v.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.6 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) --=-=-= Content-Type: text/plain tags 25391 patch quit Thierry Volpiatto writes: > > However, this handle the problem with "Stack overflow in regexp matcher" > generally, but perhaps regexps such as `ffap-gopher-regexp` could be > avoided when possible in emacs source code. Ah, so by "crash" you meant throw an error. > > IIUC regexps like "^.*\\(this\\|that etc...\\)" create an incredible > number of travels between bol and eol (which may sometimes be eob) and > lead to a stack overflow inevitably on long lines (perhaps not so long > in this case). Right, and ffap-gopher-at-point is also using `set' on local variables, icky. Here's a patch: --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=v1-0001-Improve-ffap-gopher-at-point-handling-of-long-lin.patch Content-Description: patch >From 589054b197ab4a9778454efd0192bdd45ce38518 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 8 Jan 2017 18:19:32 -0500 Subject: [PATCH v1] Improve ffap-gopher-at-point handling of long lines * lisp/ffap.el (ffap-gopher-regexp): Remove. (ffap--gopher-var-on-line): New function. (ffap-gopher-at-point): Use it instead of ffap-gopher-regexp which could overflow the regexp stack on long lines (Bug#25391). Use `let-alist' instead of calling `set' on local variables. * test/lisp/ffap-tests.el (ffap-gopher-at-point): New test. --- lisp/ffap.el | 61 ++++++++++++++++++++++++------------------------- test/lisp/ffap-tests.el | 15 ++++++++++++ 2 files changed, 45 insertions(+), 31 deletions(-) diff --git a/lisp/ffap.el b/lisp/ffap.el index 8144d41..1ef2b10 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1193,10 +1193,17 @@ ffap-url-at-point (list (car bounds) (cdr bounds))))) val)))) -(defvar ffap-gopher-regexp - "^.*\\<\\(Type\\|Name\\|Path\\|Host\\|Port\\) *= *\\(.*\\) *$" - "Regexp matching a line in a gopher bookmark (maybe indented). -The two subexpressions are the KEY and VALUE.") +(defun ffap--gopher-var-on-line () + "Return (KEY . VALUE) of gopher bookmark on current line." + (save-excursion + (let ((bol (progn (beginning-of-line) (point))) + (eol (progn (end-of-line) (skip-chars-backward " ") (point)))) + (goto-char bol) + (when (re-search-forward + "\\<\\(Type\\|Name\\|Path\\|Host\\|Port\\) *= *" eol t) + (let ((key (match-string 1)) + (val (buffer-substring-no-properties (match-end 0) eol))) + (cons (intern (downcase key)) val)))))) (defun ffap-gopher-at-point () "If point is inside a gopher bookmark block, return its URL. @@ -1204,33 +1211,25 @@ ffap-gopher-at-point Sets the variable `ffap-string-at-point-region' to the bounds of URL, if any." ;; `gopher-parse-bookmark' from gopher.el is not so robust (save-excursion - (beginning-of-line) - (if (looking-at ffap-gopher-regexp) - (progn - (while (and (looking-at ffap-gopher-regexp) (not (bobp))) - (forward-line -1)) - (or (looking-at ffap-gopher-regexp) (forward-line 1)) - (setq ffap-string-at-point-region (list (point) (point))) - (let ((type "1") path host (port "70")) - (while (looking-at ffap-gopher-regexp) - (let ((var (intern - (downcase - (buffer-substring (match-beginning 1) - (match-end 1))))) - (val (buffer-substring (match-beginning 2) - (match-end 2)))) - (set var val) - (forward-line 1))) - (setcdr ffap-string-at-point-region (list (point))) - (if (and path (string-match "^ftp:.*@" path)) - (concat "ftp://" - (substring path 4 (1- (match-end 0))) - (substring path (match-end 0))) - (and (= (length type) 1) - host;; (ffap-machine-p host) - (concat "gopher://" host - (if (equal port "70") "" (concat ":" port)) - "/" type path)))))))) + (let* ((beg (progn (beginning-of-line) + (while (and (not (bobp)) (ffap--gopher-var-on-line)) + (forward-line -1)) + (point))) + (bookmark (cl-loop for keyval = (ffap--gopher-var-on-line) + while keyval collect keyval + do (forward-line 1)))) + (when bookmark + (setq ffap-string-at-point-region (list beg (point))) + (let-alist (nconc bookmark '((type . "1") (port . "70"))) + (if (and .path (string-match "\\`ftp:.*@" .path)) + (concat "ftp://" + (substring .path 4 (1- (match-end 0))) + (substring .path (match-end 0))) + (and (= (length .type) 1) + .host ;; (ffap-machine-p host) + (concat "gopher://" .host + (if (equal .port "70") "" (concat ":" .port)) + "/" .type .path)))))))) (defvar ffap-ftp-sans-slash-regexp (and diff --git a/test/lisp/ffap-tests.el b/test/lisp/ffap-tests.el index 1ba5f86..f3414ac 100644 --- a/test/lisp/ffap-tests.el +++ b/test/lisp/ffap-tests.el @@ -49,6 +49,21 @@ (should (equal '(1 1) ffap-string-at-point-region))))) (and (file-exists-p file) (delete-file file))))) +(ert-deftest ffap-gopher-at-point () + (with-temp-buffer + (insert "\ +Type = 1 +Name = foo +Path = /the/path +Port = 7070 +Host = example.com\n") + (should-not (ffap-gopher-at-point)) + (goto-char (point-min)) + (should (equal (ffap-gopher-at-point) + "gopher://example.com:7070/1/the/path")) + (should (equal ffap-string-at-point-region + (list (point-min) (point-max)))))) + (provide 'ffap-tests) ;;; ffap-tests.el ends here -- 2.9.3 --=-=-=-- From unknown Sat Jun 21 03:26:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25391: 24.5; ffap-guesser "stack overflow in regexp matcher" error may crash emacs. Resent-From: Thierry Volpiatto Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 09 Jan 2017 07:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25391 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: npostavs@users.sourceforge.net Cc: 25391@debbugs.gnu.org Received: via spool by 25391-submit@debbugs.gnu.org id=B25391.148394524725067 (code B ref 25391); Mon, 09 Jan 2017 07:01:02 +0000 Received: (at 25391) by debbugs.gnu.org; 9 Jan 2017 07:00:47 +0000 Received: from localhost ([127.0.0.1]:47368 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQTwl-0006WF-Fh for submit@debbugs.gnu.org; Mon, 09 Jan 2017 02:00:47 -0500 Received: from mail-wj0-f177.google.com ([209.85.210.177]:36215) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQTwj-0006W1-Al for 25391@debbugs.gnu.org; Mon, 09 Jan 2017 02:00:45 -0500 Received: by mail-wj0-f177.google.com with SMTP id ew7so47166773wjc.3 for <25391@debbugs.gnu.org>; Sun, 08 Jan 2017 23:00:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=ZbjJcWsqtlKPU+7ZTbRtQSFdud8pwQsjR0L4QJS+6sk=; b=bBbUTF4htMqmeSbvinH8PWgfk36HrKbikUvtq3Wp3SIEU4YKNpZtu1z+7/AhQ8xdBN aquRpA+GxiVvvnLJTi87c6m1ytSvIWoPSfYYOS3Z2RejPy2iBL2lXQJmiGHuDOZ3Nz8O +DW2KSM8vN/o+kzTEO9qVSxHdd4wTt0qnMW6S27Y9zbnRf3oKSa1j4S9QZvKt0ec5KgE /vkaIyH0XKWZkqH57kEA/HXPvRWC9dANRZOJrcuOG0i7rVbV7q/4uAe/QavFCbEsIokE EfdvUEFmvhgQHh5pbAqubBtmkONnF/8BCv9YOHmmEhSxKrS82dieq3Sh6U2aqq/EanIz fJ6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=ZbjJcWsqtlKPU+7ZTbRtQSFdud8pwQsjR0L4QJS+6sk=; b=dmq25FXPJkYdNMLHIyzNsNDVGaiFfVn2xI/ltSkGZzD309UJ2HkQYO2bdHG+TQR0gb 5KJA+I0Eb0/rh+sZMxhE7K8C+FpbSL7G4R18xcYcOQurqG4d6iY4VOLKmNaWE9r86Ipb NOCHUynXoCaONp7ZGIIqyHw84pJeR4qnoqsQ7D1yEgjpNf9r6pY3TSwZGgvLGajFFB3l DZvRAnbvLhWotqMLmiVZHXPFosH/JyPgqrY2GCFXWI9wv2ouaO67ImocP5Xp2QQhDjMM iXQKh+ABPwLu+/go7SBzKGNmoWqP8AEnapNhwGW4QjtbkMWrSW+P2YQKAZKxV9sYXGkE a0UQ== X-Gm-Message-State: AIkVDXKYEpDcFN0qACbEpNfnjQtSIppWhnvK6mEb5sGLXNZaZCJYQfd+SesaCZo/bnDUgA== X-Received: by 10.194.117.134 with SMTP id ke6mr64718458wjb.123.1483945239192; Sun, 08 Jan 2017 23:00:39 -0800 (PST) Received: from dell-14z ([37.164.235.156]) by smtp.gmail.com with ESMTPSA id u78sm17106644wma.11.2017.01.08.23.00.37 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sun, 08 Jan 2017 23:00:38 -0800 (PST) References: <87vatqc8j1.fsf@gmail.com> <87y3yl1tdp.fsf@users.sourceforge.net> <8760lp8nqv.fsf@gmail.com> <87lgul167v.fsf@users.sourceforge.net> User-agent: mu4e 0.9.19; emacs 24.5.1 From: Thierry Volpiatto In-reply-to: <87lgul167v.fsf@users.sourceforge.net> Date: Mon, 09 Jan 2017 08:00:35 +0100 Message-ID: <87y3yk67l8.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) npostavs@users.sourceforge.net writes: > tags 25391 patch > quit > > Thierry Volpiatto writes: >> >> However, this handle the problem with "Stack overflow in regexp matcher" >> generally, but perhaps regexps such as `ffap-gopher-regexp` could be >> avoided when possible in emacs source code. > > Ah, so by "crash" you meant throw an error. I had the both, a crash on emacs-26, emacs taking all memory and finally crashing and on emacs-24.5 "Stack overflow in regexp matcher". > Right, and ffap-gopher-at-point is also using `set' on local variables, > icky. Here's a patch: I don't know `let-alist`, but looks good, however keeping `ffap-gopher-regexp` instead of hardcoding it and returning nil when the regexp is nil would allow users to disable the feature. Thanks. -- Thierry From unknown Sat Jun 21 03:26:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25391: 24.5; ffap-guesser "stack overflow in regexp matcher" error may crash emacs. Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 10 Jan 2017 04:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25391 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Thierry Volpiatto Cc: 25391@debbugs.gnu.org Received: via spool by 25391-submit@debbugs.gnu.org id=B25391.148402297011817 (code B ref 25391); Tue, 10 Jan 2017 04:37:02 +0000 Received: (at 25391) by debbugs.gnu.org; 10 Jan 2017 04:36:10 +0000 Received: from localhost ([127.0.0.1]:48322 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQoAL-00034W-Lo for submit@debbugs.gnu.org; Mon, 09 Jan 2017 23:36:09 -0500 Received: from mail-io0-f170.google.com ([209.85.223.170]:36176) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQoAJ-00034B-PS for 25391@debbugs.gnu.org; Mon, 09 Jan 2017 23:36:08 -0500 Received: by mail-io0-f170.google.com with SMTP id j13so41976710iod.3 for <25391@debbugs.gnu.org>; Mon, 09 Jan 2017 20:36:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=02kX5sSJf0a95VpYyoOgdmoeHDJMHuPdGmsgLsy2FNE=; b=DiZ6j7h1mqdjMGYk1qsGoHW0eD0hwqmP2baV1yRku7hJAaP8mNUpMB4SQkei067lwV r+1YNmw2voSSzd8oXONLzpma0S8ZM7EzY9j5haZwFEaNxpc55Q79oR5gM0hwJBb9EVLb ZmkLbzuNEruTfESxqeXxOHYilAhbhKe7T7R6rWQL0fIReYbpgfshekM5BF9UVNopmuP3 XEzgHQZTpcGi8ARXAuoN7MoySpLDH9LfSPBWcRynIU/xnOpzFWfFF2+d7glN+3WKYotj axAJpysngWBRnOHq1ikXdSQwFnxPBDfBPhVnJpsyIzfoDC4ONolL5fI6wQtS8bO/V0pL yHBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=02kX5sSJf0a95VpYyoOgdmoeHDJMHuPdGmsgLsy2FNE=; b=XQ+BV8mRTx+6/CTx+nxuryzEOrC6UR1q1YdfySMXOtsTo/k0wjyvxCNH11K9RFZNN/ g59TrX00CqIMI3BnDpUbj7XeSFsD3GHXeicrTBFcXQ0qMQSyATwinpVheNJBBSi/TqOm DlI+04nAC7rXiBwchSnHgquFybOpevhG8yr3SfGT0rx6dlbwAFA+FJYR1NBXmMvTrvD1 ttcuZBDRENZ9dIjhMC5Jw20y2XHjBoO+gMl6OF/r6exW+UMqeGSmgbIOW7NhTig/Y+dZ szLERXWLKoO+UtQfUZNXw30Mbo2L1razFvkXzyRZ8aEfAX1kuy4q3MICWj2DN8GMgEX7 hj2g== X-Gm-Message-State: AIkVDXK4ONvUmojIzWC1JeuqIzR/GAwQevFlmeA7uTZeef3H/qe+pb/XcHxJbLh9cGSqyA== X-Received: by 10.107.34.206 with SMTP id i197mr1620183ioi.97.1484022962134; Mon, 09 Jan 2017 20:36:02 -0800 (PST) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id o191sm681365iod.11.2017.01.09.20.36.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Jan 2017 20:36:01 -0800 (PST) From: npostavs@users.sourceforge.net References: <87vatqc8j1.fsf@gmail.com> <87y3yl1tdp.fsf@users.sourceforge.net> <8760lp8nqv.fsf@gmail.com> <87lgul167v.fsf@users.sourceforge.net> <87y3yk67l8.fsf@gmail.com> Date: Mon, 09 Jan 2017 23:37:04 -0500 In-Reply-To: <87y3yk67l8.fsf@gmail.com> (Thierry Volpiatto's message of "Mon, 09 Jan 2017 08:00:35 +0100") Message-ID: <87eg0b1qfj.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.6 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) --=-=-= Content-Type: text/plain Thierry Volpiatto writes: >> >> Thierry Volpiatto writes: >>> >>> However, this handle the problem with "Stack overflow in regexp matcher" >>> generally, but perhaps regexps such as `ffap-gopher-regexp` could be >>> avoided when possible in emacs source code. >> >> Ah, so by "crash" you meant throw an error. > > I had the both, a crash on emacs-26, emacs taking all memory and finally > crashing and on emacs-24.5 "Stack overflow in regexp matcher". Hmm, well I've meanwhile merged the fix for the regex stack limit, if you can still crash emacs this way, open a new bug. > > >> Right, and ffap-gopher-at-point is also using `set' on local variables, >> icky. Here's a patch: > > I don't know `let-alist`, but looks good, however keeping > `ffap-gopher-regexp` instead of hardcoding it and returning nil when the > regexp is nil would allow users to disable the feature. Makes sense, here's an update: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v2-0001-Improve-ffap-gopher-at-point-handling-of-long-lin.patch Content-Description: patch >From 93875e1d9dba4509ddd18ade9b09bf6b258d2174 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 8 Jan 2017 18:19:32 -0500 Subject: [PATCH v2] Improve ffap-gopher-at-point handling of long lines * lisp/ffap.el (ffap-gopher-regexp): Only match the KEY part. (ffap--gopher-var-on-line): New function. (ffap-gopher-at-point): Use it instead of the old ffap-gopher-regexp which could overflow the regexp stack on long lines (Bug#25391). Use `let-alist' instead of calling `set' on local variables. * test/lisp/ffap-tests.el (ffap-gopher-at-point): New test. --- lisp/ffap.el | 61 +++++++++++++++++++++++++------------------------ test/lisp/ffap-tests.el | 15 ++++++++++++ 2 files changed, 46 insertions(+), 30 deletions(-) diff --git a/lisp/ffap.el b/lisp/ffap.el index 8144d41..bcc8911 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1194,9 +1194,18 @@ ffap-url-at-point val)))) (defvar ffap-gopher-regexp - "^.*\\<\\(Type\\|Name\\|Path\\|Host\\|Port\\) *= *\\(.*\\) *$" - "Regexp matching a line in a gopher bookmark (maybe indented). -The two subexpressions are the KEY and VALUE.") + "\\<\\(Type\\|Name\\|Path\\|Host\\|Port\\) *= *" + "Regexp matching a key in a gopher bookmark.") + +(defun ffap--gopher-var-on-line () + "Return (KEY . VALUE) of gopher bookmark on current line." + (save-excursion + (let ((eol (progn (end-of-line) (skip-chars-backward " ") (point))) + (bol (progn (beginning-of-line) (point)))) + (when (re-search-forward ffap-gopher-regexp eol t) + (let ((key (match-string 1)) + (val (buffer-substring-no-properties (match-end 0) eol))) + (cons (intern (downcase key)) val)))))) (defun ffap-gopher-at-point () "If point is inside a gopher bookmark block, return its URL. @@ -1204,33 +1213,25 @@ ffap-gopher-at-point Sets the variable `ffap-string-at-point-region' to the bounds of URL, if any." ;; `gopher-parse-bookmark' from gopher.el is not so robust (save-excursion - (beginning-of-line) - (if (looking-at ffap-gopher-regexp) - (progn - (while (and (looking-at ffap-gopher-regexp) (not (bobp))) - (forward-line -1)) - (or (looking-at ffap-gopher-regexp) (forward-line 1)) - (setq ffap-string-at-point-region (list (point) (point))) - (let ((type "1") path host (port "70")) - (while (looking-at ffap-gopher-regexp) - (let ((var (intern - (downcase - (buffer-substring (match-beginning 1) - (match-end 1))))) - (val (buffer-substring (match-beginning 2) - (match-end 2)))) - (set var val) - (forward-line 1))) - (setcdr ffap-string-at-point-region (list (point))) - (if (and path (string-match "^ftp:.*@" path)) - (concat "ftp://" - (substring path 4 (1- (match-end 0))) - (substring path (match-end 0))) - (and (= (length type) 1) - host;; (ffap-machine-p host) - (concat "gopher://" host - (if (equal port "70") "" (concat ":" port)) - "/" type path)))))))) + (let* ((beg (progn (beginning-of-line) + (while (and (not (bobp)) (ffap--gopher-var-on-line)) + (forward-line -1)) + (point))) + (bookmark (cl-loop for keyval = (ffap--gopher-var-on-line) + while keyval collect keyval + do (forward-line 1)))) + (when bookmark + (setq ffap-string-at-point-region (list beg (point))) + (let-alist (nconc bookmark '((type . "1") (port . "70"))) + (if (and .path (string-match "\\`ftp:.*@" .path)) + (concat "ftp://" + (substring .path 4 (1- (match-end 0))) + (substring .path (match-end 0))) + (and (= (length .type) 1) + .host ;; (ffap-machine-p host) + (concat "gopher://" .host + (if (equal .port "70") "" (concat ":" .port)) + "/" .type .path)))))))) (defvar ffap-ftp-sans-slash-regexp (and diff --git a/test/lisp/ffap-tests.el b/test/lisp/ffap-tests.el index 1ba5f86..f3414ac 100644 --- a/test/lisp/ffap-tests.el +++ b/test/lisp/ffap-tests.el @@ -49,6 +49,21 @@ (should (equal '(1 1) ffap-string-at-point-region))))) (and (file-exists-p file) (delete-file file))))) +(ert-deftest ffap-gopher-at-point () + (with-temp-buffer + (insert "\ +Type = 1 +Name = foo +Path = /the/path +Port = 7070 +Host = example.com\n") + (should-not (ffap-gopher-at-point)) + (goto-char (point-min)) + (should (equal (ffap-gopher-at-point) + "gopher://example.com:7070/1/the/path")) + (should (equal ffap-string-at-point-region + (list (point-min) (point-max)))))) + (provide 'ffap-tests) ;;; ffap-tests.el ends here -- 2.9.3 --=-=-=-- From unknown Sat Jun 21 03:26:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25391: 24.5; ffap-guesser "stack overflow in regexp matcher" error may crash emacs. Resent-From: Thierry Volpiatto Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 10 Jan 2017 07:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25391 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: npostavs@users.sourceforge.net Cc: 25391@debbugs.gnu.org Received: via spool by 25391-submit@debbugs.gnu.org id=B25391.148403265827709 (code B ref 25391); Tue, 10 Jan 2017 07:18:01 +0000 Received: (at 25391) by debbugs.gnu.org; 10 Jan 2017 07:17:38 +0000 Received: from localhost ([127.0.0.1]:48357 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQqgc-0007Cr-7f for submit@debbugs.gnu.org; Tue, 10 Jan 2017 02:17:38 -0500 Received: from mail-wj0-f178.google.com ([209.85.210.178]:33557) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQqga-0007Ce-Or for 25391@debbugs.gnu.org; Tue, 10 Jan 2017 02:17:37 -0500 Received: by mail-wj0-f178.google.com with SMTP id kq3so31756174wjc.0 for <25391@debbugs.gnu.org>; Mon, 09 Jan 2017 23:17:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=37fRGvMPDAjYG49al80kb2e6ZGjVYGC8QMeWqd8uSrA=; b=CWcYnqQm1ewTVlrdf07cOnGtt8FGY0Os0zPkM4Oep/7s+t05aIVJWLTNyY7qfPccCF siII6vgVFHdDePDxvAlN13U2+MAmtMsfIYhzxLbLdQHoa3hnLpkQTFUOiLbZPsJG8H+L Lb90PM9Alnf6jB+aFlh8RxnwrKUAPQWukS2KuTOEMqqLpvTQmeO/+z7IHgqv+vIfipwI hUzukuDNeiw+Am/BGktCcQaaJ5QNOQnzZ2PcEHcJ1gmzGh2oJLD0B3NMj5ByDNMqa/Q/ XV6ehGFVCrwIHQyPFY+8oYILlwjmWMybl41LsEq4FQlL17jJpzj4/yViTHikrQFU28dy X+5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=37fRGvMPDAjYG49al80kb2e6ZGjVYGC8QMeWqd8uSrA=; b=nlOLo29pn70z972GqHraCgGHdKXf6XITV6LXkKbe3BSzuMjemnVRN/QuswQBhPIxDq GBbjxqoBMSE4lj0meW8c4TtbZ1w47s3EMYG9zU3t5QFHmAKb+Guz/MkTg/pGj5Am3lvb 6l2Mb85+UTFonMsm2C/jEg7sSYZ/Zd2p4Sd7PnOoIerKFslbvn2EmiovalgATrcGxt9v GF1aZFTsyt0iRDBg9gTDw5tGuJR0Z2qvrB6nHh2yUqtK7ZoymnfiWTXExI4P35kjoIOk KXuSJuThqrXAW7auCdx6I7slUbg97lKTGZ0gDMCXyd+WUeeXl9hDq1U5HO+XxPQLrcny ioig== X-Gm-Message-State: AIkVDXLu7v77udM9MDLU5F/qyZSYAJs1onPDFHc8OvNC625m7tuaQAt5wLh/Yy4xLsg8Bg== X-Received: by 10.194.94.132 with SMTP id dc4mr797060wjb.231.1484032651151; Mon, 09 Jan 2017 23:17:31 -0800 (PST) Received: from dell-14z ([37.167.8.80]) by smtp.gmail.com with ESMTPSA id 204sm22878855wmj.7.2017.01.09.23.17.29 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 09 Jan 2017 23:17:30 -0800 (PST) References: <87vatqc8j1.fsf@gmail.com> <87y3yl1tdp.fsf@users.sourceforge.net> <8760lp8nqv.fsf@gmail.com> <87lgul167v.fsf@users.sourceforge.net> <87y3yk67l8.fsf@gmail.com> <87eg0b1qfj.fsf@users.sourceforge.net> User-agent: mu4e 0.9.19; emacs 24.5.1 From: Thierry Volpiatto In-reply-to: <87eg0b1qfj.fsf@users.sourceforge.net> Date: Tue, 10 Jan 2017 08:17:27 +0100 Message-ID: <87mveztmd4.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) npostavs@users.sourceforge.net writes: > Hmm, well I've meanwhile merged the fix for the regex stack limit, if > you can still crash emacs this way, open a new bug. Ok. >> I don't know `let-alist`, but looks good, however keeping >> `ffap-gopher-regexp` instead of hardcoding it and returning nil when the >> regexp is nil would allow users to disable the feature. > > Makes sense, here's an update: Thanks, however AFAIU your patch, when `ffap-gopher-regexp` is nil, `ffap-gopher-at-point` will return with an error but not nil isn't it ? -- Thierry From unknown Sat Jun 21 03:26:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25391: 24.5; ffap-guesser "stack overflow in regexp matcher" error may crash emacs. Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 10 Jan 2017 13:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25391 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Thierry Volpiatto Cc: 25391@debbugs.gnu.org Received: via spool by 25391-submit@debbugs.gnu.org id=B25391.14840553855910 (code B ref 25391); Tue, 10 Jan 2017 13:37:02 +0000 Received: (at 25391) by debbugs.gnu.org; 10 Jan 2017 13:36:25 +0000 Received: from localhost ([127.0.0.1]:48459 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQwbB-0001XE-Hh for submit@debbugs.gnu.org; Tue, 10 Jan 2017 08:36:25 -0500 Received: from mail-io0-f182.google.com ([209.85.223.182]:36559) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQwb9-0001X0-L4 for 25391@debbugs.gnu.org; Tue, 10 Jan 2017 08:36:23 -0500 Received: by mail-io0-f182.google.com with SMTP id j13so49963025iod.3 for <25391@debbugs.gnu.org>; Tue, 10 Jan 2017 05:36:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=7nMhHw71vf5ALpj7t3CSOkEQXtNytCjLUKTs6MJKo98=; b=hgnJc1aKUIvpDRWW7rTYGTGEMSTG3X3gBORHWRVrg4sYX2P0nWFXFFoL+G2nD24mn2 y0T0wak/nnqKjxderUTRHyZgKB9cjKA84wlYkxikPP7dTfOYcolVoKgn8zOlyTcd3pti lmIW+cSdJnGSi4MwXWvqXAEQIslgBNrCQayBDVeuo/Sxk6qOyMTgHeWOF6SoHs+3zt0v ftkGYwlab1BUWdVwvqof1FPkM9VCRhGujr40/8CNxDGyKYTy26yHaI6e/p3iTKqgUkJK pZDXEyYnSsZKbO8cutehvoQE7EEnhz976HqMwZ3WnRuuEhNSWhRPioNd1I4qNx8QzZQ/ FwUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=7nMhHw71vf5ALpj7t3CSOkEQXtNytCjLUKTs6MJKo98=; b=HfQBXGh2NXm7DA/+Jv+lUyRkj25PKtretsMy74z5dwkyGtXxk7MaiX914KjMrVYzVD +IJxOWekqfkvrVfS2UHTfHZnN6cDJUc2THrn++gfEztaMY/6dAVuQWsJTtWZHWqv1dEb 3nGgakMkGfFv5aPehpR1rD+6Q0Y9z4DrI48pg9qFeut/vcvH+aPW3f96wK1hoCxKjlDh q5RriwBdIGv2GJn1kCIANTlIOWohYDWagf/WDiusSp+iuH6HQFYYdb7Nz67kDhoMs7az amUGpnrNs+PHULrncKDO+FfubnP8jVkKBUBn6+OZrJiMEEQxjSLIKhjxtvPKZLsZ2AOq WfWQ== X-Gm-Message-State: AIkVDXIqlhPAut1Uym+iPAPXQx9RpjD3qTkSQYe8fEsbruneMpUTEPIfYYtfGHZ05Nkjrg== X-Received: by 10.107.18.201 with SMTP id 70mr3638223ios.33.1484055377813; Tue, 10 Jan 2017 05:36:17 -0800 (PST) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id 184sm313907itx.0.2017.01.10.05.36.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Jan 2017 05:36:17 -0800 (PST) From: npostavs@users.sourceforge.net References: <87vatqc8j1.fsf@gmail.com> <87y3yl1tdp.fsf@users.sourceforge.net> <8760lp8nqv.fsf@gmail.com> <87lgul167v.fsf@users.sourceforge.net> <87y3yk67l8.fsf@gmail.com> <87eg0b1qfj.fsf@users.sourceforge.net> <87mveztmd4.fsf@gmail.com> Date: Tue, 10 Jan 2017 08:37:20 -0500 In-Reply-To: <87mveztmd4.fsf@gmail.com> (Thierry Volpiatto's message of "Tue, 10 Jan 2017 08:17:27 +0100") Message-ID: <8760ln11f3.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.6 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) --=-=-= Content-Type: text/plain Thierry Volpiatto writes: >>> I don't know `let-alist`, but looks good, however keeping >>> `ffap-gopher-regexp` instead of hardcoding it and returning nil when the >>> regexp is nil would allow users to disable the feature. >> >> Makes sense, here's an update: > > Thanks, however AFAIU your patch, when `ffap-gopher-regexp` is nil, > `ffap-gopher-at-point` will return with an error but not nil isn't it ? Yes, although that's also true before my patch. So `ffap-gopher-regexp' never actually supported being changed. I'm not sure if it's a good idea to add support for that. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v3-0001-Improve-ffap-gopher-at-point-handling-of-long-lin.patch Content-Description: patch >From ed145acaeb5446e004fc6a38ff6411967a6a2222 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 8 Jan 2017 18:19:32 -0500 Subject: [PATCH v3] Improve ffap-gopher-at-point handling of long lines * lisp/ffap.el (ffap-gopher-regexp): Only match the KEY part. (ffap--gopher-var-on-line): New function. (ffap-gopher-at-point): Use it instead of the old ffap-gopher-regexp which could overflow the regexp stack on long lines (Bug#25391). Use `let-alist' instead of calling `set' on local variables. * test/lisp/ffap-tests.el (ffap-gopher-at-point): New test. --- lisp/ffap.el | 64 +++++++++++++++++++++++++------------------------ test/lisp/ffap-tests.el | 17 +++++++++++++ 2 files changed, 50 insertions(+), 31 deletions(-) diff --git a/lisp/ffap.el b/lisp/ffap.el index 8144d41..182694a 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1194,43 +1194,45 @@ ffap-url-at-point val)))) (defvar ffap-gopher-regexp - "^.*\\<\\(Type\\|Name\\|Path\\|Host\\|Port\\) *= *\\(.*\\) *$" - "Regexp matching a line in a gopher bookmark (maybe indented). -The two subexpressions are the KEY and VALUE.") + "\\<\\(Type\\|Name\\|Path\\|Host\\|Port\\) *= *" + "Regexp matching a key in a gopher bookmark.") + +(defun ffap--gopher-var-on-line () + "Return (KEY . VALUE) of gopher bookmark on current line." + (save-excursion + (let ((eol (progn (end-of-line) (skip-chars-backward " ") (point))) + (bol (progn (beginning-of-line) (point)))) + (when (re-search-forward ffap-gopher-regexp eol t) + (let ((key (match-string 1)) + (val (buffer-substring-no-properties (match-end 0) eol))) + (cons (intern (downcase key)) val)))))) (defun ffap-gopher-at-point () "If point is inside a gopher bookmark block, return its URL. Sets the variable `ffap-string-at-point-region' to the bounds of URL, if any." ;; `gopher-parse-bookmark' from gopher.el is not so robust - (save-excursion - (beginning-of-line) - (if (looking-at ffap-gopher-regexp) - (progn - (while (and (looking-at ffap-gopher-regexp) (not (bobp))) - (forward-line -1)) - (or (looking-at ffap-gopher-regexp) (forward-line 1)) - (setq ffap-string-at-point-region (list (point) (point))) - (let ((type "1") path host (port "70")) - (while (looking-at ffap-gopher-regexp) - (let ((var (intern - (downcase - (buffer-substring (match-beginning 1) - (match-end 1))))) - (val (buffer-substring (match-beginning 2) - (match-end 2)))) - (set var val) - (forward-line 1))) - (setcdr ffap-string-at-point-region (list (point))) - (if (and path (string-match "^ftp:.*@" path)) - (concat "ftp://" - (substring path 4 (1- (match-end 0))) - (substring path (match-end 0))) - (and (= (length type) 1) - host;; (ffap-machine-p host) - (concat "gopher://" host - (if (equal port "70") "" (concat ":" port)) - "/" type path)))))))) + (when (stringp ffap-gopher-regexp) + (save-excursion + (let* ((beg (progn (beginning-of-line) + (while (and (not (bobp)) (ffap--gopher-var-on-line)) + (forward-line -1)) + (point))) + (bookmark (cl-loop for keyval = (ffap--gopher-var-on-line) + while keyval collect keyval + do (forward-line 1)))) + (when bookmark + (setq ffap-string-at-point-region (list beg (point))) + (let-alist (nconc bookmark '((type . "1") (port . "70"))) + (if (and .path (string-match "\\`ftp:.*@" .path)) + (concat "ftp://" + (substring .path 4 (1- (match-end 0))) + (substring .path (match-end 0))) + (and (= (length .type) 1) + .host ;; (ffap-machine-p host) + (concat "gopher://" .host + (if (equal .port "70") "" (concat ":" .port)) + "/" .type .path))))))))) (defvar ffap-ftp-sans-slash-regexp (and diff --git a/test/lisp/ffap-tests.el b/test/lisp/ffap-tests.el index 1ba5f86..a3fe350 100644 --- a/test/lisp/ffap-tests.el +++ b/test/lisp/ffap-tests.el @@ -49,6 +49,23 @@ (should (equal '(1 1) ffap-string-at-point-region))))) (and (file-exists-p file) (delete-file file))))) +(ert-deftest ffap-gopher-at-point () + (with-temp-buffer + (insert "\ +Type = 1 +Name = foo +Path = /the/path +Port = 7070 +Host = example.com\n") + (should-not (ffap-gopher-at-point)) + (goto-char (point-min)) + (should (equal (ffap-gopher-at-point) + "gopher://example.com:7070/1/the/path")) + (should (equal ffap-string-at-point-region + (list (point-min) (point-max)))) + (let ((ffap-gopher-regexp nil)) + (should-not (ffap-gopher-at-point))))) + (provide 'ffap-tests) ;;; ffap-tests.el ends here -- 2.9.3 --=-=-=-- From unknown Sat Jun 21 03:26:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25391: 24.5; ffap-guesser "stack overflow in regexp matcher" error may crash emacs. Resent-From: Thierry Volpiatto Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 10 Jan 2017 14:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25391 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: npostavs@users.sourceforge.net Cc: 25391@debbugs.gnu.org Received: via spool by 25391-submit@debbugs.gnu.org id=B25391.148405935312239 (code B ref 25391); Tue, 10 Jan 2017 14:43:02 +0000 Received: (at 25391) by debbugs.gnu.org; 10 Jan 2017 14:42:33 +0000 Received: from localhost ([127.0.0.1]:48485 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQxdB-0003BL-Ju for submit@debbugs.gnu.org; Tue, 10 Jan 2017 09:42:33 -0500 Received: from mail-wm0-f45.google.com ([74.125.82.45]:35819) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQxd9-0003B2-I2 for 25391@debbugs.gnu.org; Tue, 10 Jan 2017 09:42:31 -0500 Received: by mail-wm0-f45.google.com with SMTP id a197so130220094wmd.0 for <25391@debbugs.gnu.org>; Tue, 10 Jan 2017 06:42:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=0Dn5i5cRdYpRGRiwL8aq40+Wy9dQhZVW9F0sV+JEPDo=; b=JqE7L0tm1ZSmFcP8Vp9SxXxaGCCY2QfFpJJDcxJ3LiGS3lFzrWtpbc/NuSa6SYXV9Z MsPZ9SHFRVhSOfjxAT4uyBrv90s70fwovhmKHqOElDzIUE6GKoGM8wdSSJGTXugOU68x ajXrVutcc5UhscvG02eDXcjgakVt+i/HyWA91KLPH5YABkiGyY++t0VINPuyc3PJdt0a 27AnFF7eJ5+xjiCgBkPz4O2TqZUWVN7GVW212CZQDA/rCyGuAMDyTQQuMlWxadFaGyyf 13deftguS6JG8tD8QHxXNMW1RUMZB0EHd6DqsVY0eTJA2CwqRKhEkdw7hx2H6Z0UqM2r 8rOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=0Dn5i5cRdYpRGRiwL8aq40+Wy9dQhZVW9F0sV+JEPDo=; b=qHllCNXsSWcThJ24/EmIpfcaPu+73ElbDFfPftoi1dBl4l6ukftls9OO35tzieBXuk x4RkokKXqv2dCmZ3v53k+liLrPjVulV9HX/NgIYDlJC0tKVM6CZ9gAG6xAiFNvA+/FDC XGhoGqWgM4ftuq12UM7bg3qF4OnTUrMavRIhTQMrAMIHY621MVBqvu1hUiS5x7e0FqJD caFcU2HPZ3TrDlBgRdhjEER70vUCDcrctizkfOAo8sppS0Nd1ZMg3nhxqi6ad3bUDxtq XH7kZrtbFqlVygi2jgDPrAqbD8D0Q6dr1sEozlI5n/z7HhcZHrOWlwHwLpSH7hkY9+uP eIEw== X-Gm-Message-State: AIkVDXJYtlw6VFsYqf2NCZA4Ddaea2IHqMbuqJ2JRhr+rSygnNQQaUdszXO+xMR4ud4kEA== X-Received: by 10.28.66.7 with SMTP id p7mr2212588wma.64.1484059345740; Tue, 10 Jan 2017 06:42:25 -0800 (PST) Received: from dell-14z ([37.164.114.18]) by smtp.gmail.com with ESMTPSA id c187sm4108488wmd.13.2017.01.10.06.42.24 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 10 Jan 2017 06:42:24 -0800 (PST) References: <87vatqc8j1.fsf@gmail.com> <87y3yl1tdp.fsf@users.sourceforge.net> <8760lp8nqv.fsf@gmail.com> <87lgul167v.fsf@users.sourceforge.net> <87y3yk67l8.fsf@gmail.com> <87eg0b1qfj.fsf@users.sourceforge.net> <87mveztmd4.fsf@gmail.com> <8760ln11f3.fsf@users.sourceforge.net> User-agent: mu4e 0.9.19; emacs 24.5.1 From: Thierry Volpiatto In-reply-to: <8760ln11f3.fsf@users.sourceforge.net> Date: Tue, 10 Jan 2017 15:42:22 +0100 Message-ID: <87r34bx9gx.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.5 (/) npostavs@users.sourceforge.net writes: > Yes, although that's also true before my patch. So `ffap-gopher-regexp' > never actually supported being changed. I'm not sure if it's a good > idea to add support for that. I think it is, gopher is not widely used AFAIK, and allowing disabling it would avoid needless search in most cases, thus it make it consistent with other ffap* fns that can be disabled; I have a lot of complains at helm with ffap annoyances and having more flexibility on this is interesting. > + (when (stringp ffap-gopher-regexp) That's what I expected. Thanks. -- Thierry From unknown Sat Jun 21 03:26:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25391: 24.5; ffap-guesser "stack overflow in regexp matcher" error may crash emacs. Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Jan 2017 02:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25391 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Thierry Volpiatto Cc: 25391@debbugs.gnu.org Received: via spool by 25391-submit@debbugs.gnu.org id=B25391.148436069711836 (code B ref 25391); Sat, 14 Jan 2017 02:25:02 +0000 Received: (at 25391) by debbugs.gnu.org; 14 Jan 2017 02:24:57 +0000 Received: from localhost ([127.0.0.1]:53217 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cSE1Y-00034q-SN for submit@debbugs.gnu.org; Fri, 13 Jan 2017 21:24:57 -0500 Received: from mail-io0-f175.google.com ([209.85.223.175]:34125) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cSE1X-00034f-Qa for 25391@debbugs.gnu.org; Fri, 13 Jan 2017 21:24:56 -0500 Received: by mail-io0-f175.google.com with SMTP id l66so57552305ioi.1 for <25391@debbugs.gnu.org>; Fri, 13 Jan 2017 18:24:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=8lltspD6HaWWXF/V+BliTCZ5Wg0+/arVAAZxqA6QIC4=; b=Nnzj2sL7H33O8xXwK1csU+6R+bjCC6pP4dG5MlkQeW4djJK3avxDh2RbLGaz5R9TwJ bKwarqfwMvhDldKxG8srBZW9ZOc0+QSERbzg05A2p70xnOwk1PXvxZ9rxZLTfUEXxr1y b9ouLtYhBkT0LdKGmefRfUVhTk5wMKDo98AgnRaWldoEDFbxfg9GQtZbdd0KXdKQuVEm SXHF6fyUH3Zp/DKtbq0O1GP/KG+x/zCssGF3Df5QCBF404cQE0JxQ1CN05bxByKtHc3V DJmUFUBoCYJcGMRcOWhzOMpOyCA9atxfoiNuC1wkNcONXGsFibIra+lTL7i5rC2jkYM7 yl0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=8lltspD6HaWWXF/V+BliTCZ5Wg0+/arVAAZxqA6QIC4=; b=k34WgDgyhxU2jkAQNqCRTv3zZiU/g4lqMsR5jW98sM7YSwnKOGjf2kHWXm7OoYHNfd dLiu7GzkNmgbvibKCJ6ZjAB6PDL+PcvazNyI3mt3YVvMzhWcLYf6zVfiJ28VP2qFavSE hTF3Dhj+VUWKwuwE2nrqugDpESeEhSK8KQDCZWH/4PuKLQaBdD1Wm5rVdIOLySCzSyR0 fzx4BUButTmE6trB1ao/tgdaKlOveZTHv5QWa0OKjD+WIrGLOaFX3eU+53y0CAW/xpKU x/HwGelhn105/fDKuiAE6gwTl7yzyxowawoN0uBss0UYorDCParYgZA3dTYc2vCgRk4B JW7Q== X-Gm-Message-State: AIkVDXKWNOV6PCUSKJsMFPXpEKgbgNrluVJLQqlPbClCx0PAL/xKhzuTr+mTce4xC526AA== X-Received: by 10.107.197.133 with SMTP id v127mr3371002iof.119.1484360690282; Fri, 13 Jan 2017 18:24:50 -0800 (PST) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id z42sm1982798ita.6.2017.01.13.18.24.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Jan 2017 18:24:49 -0800 (PST) From: npostavs@users.sourceforge.net References: <87vatqc8j1.fsf@gmail.com> <87y3yl1tdp.fsf@users.sourceforge.net> <8760lp8nqv.fsf@gmail.com> <87lgul167v.fsf@users.sourceforge.net> <87y3yk67l8.fsf@gmail.com> <87eg0b1qfj.fsf@users.sourceforge.net> <87mveztmd4.fsf@gmail.com> <8760ln11f3.fsf@users.sourceforge.net> <87r34bx9gx.fsf@gmail.com> Date: Fri, 13 Jan 2017 21:25:54 -0500 In-Reply-To: <87r34bx9gx.fsf@gmail.com> (Thierry Volpiatto's message of "Tue, 10 Jan 2017 15:42:22 +0100") Message-ID: <874m12z8b1.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.6 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) --=-=-= Content-Type: text/plain Thierry Volpiatto writes: > npostavs@users.sourceforge.net writes: > >> Yes, although that's also true before my patch. So `ffap-gopher-regexp' >> never actually supported being changed. I'm not sure if it's a good >> idea to add support for that. > > I think it is, gopher is not widely used AFAIK, and allowing disabling > it would avoid needless search in most cases, thus it make it consistent > with other ffap* fns that can be disabled; I have a lot of complains at > helm with ffap annoyances and having more flexibility on this is interesting. Oh, yes, if the other regexps can be disabled like that, we should make it consistent. I've added a note about it to the docstring and toplevel comments; I'll push to master in a couple of days. --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=v4-0001-Improve-ffap-gopher-at-point-handling-of-long-lin.patch Content-Description: patch >From e4904a9c5c871780b94ffd2cf433637e5d75755a Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 8 Jan 2017 18:19:32 -0500 Subject: [PATCH v4] Improve ffap-gopher-at-point handling of long lines * lisp/ffap.el (ffap-gopher-regexp): Only match the KEY part. Note setting to nil is now supported. (ffap--gopher-var-on-line): New function. (ffap-gopher-at-point): Use it instead of the old ffap-gopher-regexp which could overflow the regexp stack on long lines (Bug#25391). Use `let-alist' instead of calling `set' on local variables. * test/lisp/ffap-tests.el (ffap-gopher-at-point): New test. --- lisp/ffap.el | 66 ++++++++++++++++++++++++++----------------------- test/lisp/ffap-tests.el | 17 +++++++++++++ 2 files changed, 52 insertions(+), 31 deletions(-) diff --git a/lisp/ffap.el b/lisp/ffap.el index 8144d41..0baf52b 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -76,6 +76,7 @@ ;; (setq ffap-machine-p-known 'accept) ; no pinging ;; (setq ffap-url-regexp nil) ; disable URL features in ffap ;; (setq ffap-shell-prompt-regexp nil) ; disable shell prompt stripping +;; (setq ffap-gopher-regexp nil) ; disable gopher bookmark matching ;; ;; ffap uses `browse-url' (if found, else `w3-fetch') to fetch URL's. ;; For a hairier `ffap-url-fetcher', try ffap-url.el (same ftp site). @@ -1194,43 +1195,46 @@ ffap-url-at-point val)))) (defvar ffap-gopher-regexp - "^.*\\<\\(Type\\|Name\\|Path\\|Host\\|Port\\) *= *\\(.*\\) *$" - "Regexp matching a line in a gopher bookmark (maybe indented). -The two subexpressions are the KEY and VALUE.") + "\\<\\(Type\\|Name\\|Path\\|Host\\|Port\\) *= *" + "Regexp matching a key in a gopher bookmark. +Set to nil to disable matching gopher bookmarks." + +(defun ffap--gopher-var-on-line () + "Return (KEY . VALUE) of gopher bookmark on current line." + (save-excursion + (let ((eol (progn (end-of-line) (skip-chars-backward " ") (point))) + (bol (progn (beginning-of-line) (point)))) + (when (re-search-forward ffap-gopher-regexp eol t) + (let ((key (match-string 1)) + (val (buffer-substring-no-properties (match-end 0) eol))) + (cons (intern (downcase key)) val)))))) (defun ffap-gopher-at-point () "If point is inside a gopher bookmark block, return its URL. Sets the variable `ffap-string-at-point-region' to the bounds of URL, if any." ;; `gopher-parse-bookmark' from gopher.el is not so robust - (save-excursion - (beginning-of-line) - (if (looking-at ffap-gopher-regexp) - (progn - (while (and (looking-at ffap-gopher-regexp) (not (bobp))) - (forward-line -1)) - (or (looking-at ffap-gopher-regexp) (forward-line 1)) - (setq ffap-string-at-point-region (list (point) (point))) - (let ((type "1") path host (port "70")) - (while (looking-at ffap-gopher-regexp) - (let ((var (intern - (downcase - (buffer-substring (match-beginning 1) - (match-end 1))))) - (val (buffer-substring (match-beginning 2) - (match-end 2)))) - (set var val) - (forward-line 1))) - (setcdr ffap-string-at-point-region (list (point))) - (if (and path (string-match "^ftp:.*@" path)) - (concat "ftp://" - (substring path 4 (1- (match-end 0))) - (substring path (match-end 0))) - (and (= (length type) 1) - host;; (ffap-machine-p host) - (concat "gopher://" host - (if (equal port "70") "" (concat ":" port)) - "/" type path)))))))) + (when (stringp ffap-gopher-regexp) + (save-excursion + (let* ((beg (progn (beginning-of-line) + (while (and (not (bobp)) (ffap--gopher-var-on-line)) + (forward-line -1)) + (point))) + (bookmark (cl-loop for keyval = (ffap--gopher-var-on-line) + while keyval collect keyval + do (forward-line 1)))) + (when bookmark + (setq ffap-string-at-point-region (list beg (point))) + (let-alist (nconc bookmark '((type . "1") (port . "70"))) + (if (and .path (string-match "\\`ftp:.*@" .path)) + (concat "ftp://" + (substring .path 4 (1- (match-end 0))) + (substring .path (match-end 0))) + (and (= (length .type) 1) + .host ;; (ffap-machine-p host) + (concat "gopher://" .host + (if (equal .port "70") "" (concat ":" .port)) + "/" .type .path))))))))) (defvar ffap-ftp-sans-slash-regexp (and diff --git a/test/lisp/ffap-tests.el b/test/lisp/ffap-tests.el index 1ba5f86..a3fe350 100644 --- a/test/lisp/ffap-tests.el +++ b/test/lisp/ffap-tests.el @@ -49,6 +49,23 @@ (should (equal '(1 1) ffap-string-at-point-region))))) (and (file-exists-p file) (delete-file file))))) +(ert-deftest ffap-gopher-at-point () + (with-temp-buffer + (insert "\ +Type = 1 +Name = foo +Path = /the/path +Port = 7070 +Host = example.com\n") + (should-not (ffap-gopher-at-point)) + (goto-char (point-min)) + (should (equal (ffap-gopher-at-point) + "gopher://example.com:7070/1/the/path")) + (should (equal ffap-string-at-point-region + (list (point-min) (point-max)))) + (let ((ffap-gopher-regexp nil)) + (should-not (ffap-gopher-at-point))))) + (provide 'ffap-tests) ;;; ffap-tests.el ends here -- 2.9.3 --=-=-=-- From unknown Sat Jun 21 03:26:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25391: 24.5; ffap-guesser "stack overflow in regexp matcher" error may crash emacs. Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Jan 2017 06:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25391 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Thierry Volpiatto Cc: 25391@debbugs.gnu.org Received: via spool by 25391-submit@debbugs.gnu.org id=B25391.14843770043300 (code B ref 25391); Sat, 14 Jan 2017 06:57:01 +0000 Received: (at 25391) by debbugs.gnu.org; 14 Jan 2017 06:56:44 +0000 Received: from localhost ([127.0.0.1]:53281 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cSIGa-0000r8-1G for submit@debbugs.gnu.org; Sat, 14 Jan 2017 01:56:44 -0500 Received: from mail-it0-f53.google.com ([209.85.214.53]:38303) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cSIGY-0000qw-5x for 25391@debbugs.gnu.org; Sat, 14 Jan 2017 01:56:42 -0500 Received: by mail-it0-f53.google.com with SMTP id x2so53465398itf.1 for <25391@debbugs.gnu.org>; Fri, 13 Jan 2017 22:56:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=npjRCT2uPF9S9aDpGLi4bKpJMVApo/wRVdzT20x0a9I=; b=uchxX1IsH6rgseMieHIQ8QLAE47DVNHzoRlmYemamyb472VkQr6HZskIm5D0roLWWu BNcVFi/BWZngqq3pWM4+b78+AYTeVukV9kD4XXhJykid0PuBv85b/xxymZ73OxTEX7AC aVQ0o0uWZ7svc0+fdgxpF1A0bG8ckuoHsUpYpGBXp84ErgcElpwvE+GTWmAWkKxBgbtm 04COm58g4x777QWza0Jy3e6D7GOdRuDc7Ty+dCf8mTjoyUomQ+FO0en9FKD5ppUF2QlQ T8g6rm59MeiqzOuvpABHvtKUUDrciTBCXqtzFDBa8oeLJsE+rLnDSCeOb9LZXSHL+ucm vf6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=npjRCT2uPF9S9aDpGLi4bKpJMVApo/wRVdzT20x0a9I=; b=DW0GDQQ5HbL4IpTG87lYgl2tNaRzOSrF72ab13jKXusO5jNTZvvLdKw1T6JPrMR8ix C0nG1MS/RTk5CcIwhmBoCDlGHKBF1c6Ar10AuRmOae8vNEQSt3INV6Me8GpCUzbf8wer 2n6krUJlmw4rbUdyYWCBXMO3bqtg4ts3H2gm/Fc42VO5CROCuURFhZl+Bq5tYJHotPBs yfqN9yzAhaFWbjaRT9s1WNz2SCNOxtsLv/s8EfEsN+LJ0jttiemxXz2/M+7NUWSLspX2 3B5F6GTeRK6Cbq2V+9tJQS34z4gjdp5zuNP0mZhIkW6/e+qrBYGQy4s48s3gLNCV3DGf X7SQ== X-Gm-Message-State: AIkVDXLL6Nk9J39Ni51kJ8plJwPz19pIzgq3XqbIy2czdhVEFKfROK9Pj27uUI6sFLPg3Q== X-Received: by 10.36.50.78 with SMTP id j75mr6442737ita.58.1484376996502; Fri, 13 Jan 2017 22:56:36 -0800 (PST) Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id w192sm2293723itw.3.2017.01.13.22.56.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Jan 2017 22:56:35 -0800 (PST) From: npostavs@users.sourceforge.net References: <87vatqc8j1.fsf@gmail.com> <87y3yl1tdp.fsf@users.sourceforge.net> <8760lp8nqv.fsf@gmail.com> <87lgul167v.fsf@users.sourceforge.net> <87y3yk67l8.fsf@gmail.com> <87eg0b1qfj.fsf@users.sourceforge.net> <87mveztmd4.fsf@gmail.com> <8760ln11f3.fsf@users.sourceforge.net> <87r34bx9gx.fsf@gmail.com> <874m12z8b1.fsf@users.sourceforge.net> Date: Sat, 14 Jan 2017 01:57:40 -0500 In-Reply-To: <874m12z8b1.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net's message of "Fri, 13 Jan 2017 21:25:54 -0500") Message-ID: <87vatixh5n.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.2 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.2 (/) --=-=-= Content-Type: text/plain npostavs@users.sourceforge.net writes: > (defvar ffap-gopher-regexp > - "^.*\\<\\(Type\\|Name\\|Path\\|Host\\|Port\\) *= *\\(.*\\) *$" > - "Regexp matching a line in a gopher bookmark (maybe indented). > -The two subexpressions are the KEY and VALUE.") > + "\\<\\(Type\\|Name\\|Path\\|Host\\|Port\\) *= *" > + "Regexp matching a key in a gopher bookmark. > +Set to nil to disable matching gopher bookmarks." Oops, lost a close paren. --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=v5-0001-Improve-ffap-gopher-at-point-handling-of-long-lin.patch Content-Description: patch >From 98e9ff3cb73acc5e177abc907f05bb8e3ff09712 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 8 Jan 2017 18:19:32 -0500 Subject: [PATCH v5] Improve ffap-gopher-at-point handling of long lines * lisp/ffap.el (ffap-gopher-regexp): Only match the KEY part. Note setting to nil is now supported. (ffap--gopher-var-on-line): New function. (ffap-gopher-at-point): Use it instead of the old ffap-gopher-regexp which could overflow the regexp stack on long lines (Bug#25391). Use `let-alist' instead of calling `set' on local variables. * test/lisp/ffap-tests.el (ffap-gopher-at-point): New test. --- lisp/ffap.el | 66 ++++++++++++++++++++++++++----------------------- test/lisp/ffap-tests.el | 17 +++++++++++++ 2 files changed, 52 insertions(+), 31 deletions(-) diff --git a/lisp/ffap.el b/lisp/ffap.el index 8144d41..068897b 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -76,6 +76,7 @@ ;; (setq ffap-machine-p-known 'accept) ; no pinging ;; (setq ffap-url-regexp nil) ; disable URL features in ffap ;; (setq ffap-shell-prompt-regexp nil) ; disable shell prompt stripping +;; (setq ffap-gopher-regexp nil) ; disable gopher bookmark matching ;; ;; ffap uses `browse-url' (if found, else `w3-fetch') to fetch URL's. ;; For a hairier `ffap-url-fetcher', try ffap-url.el (same ftp site). @@ -1194,43 +1195,46 @@ ffap-url-at-point val)))) (defvar ffap-gopher-regexp - "^.*\\<\\(Type\\|Name\\|Path\\|Host\\|Port\\) *= *\\(.*\\) *$" - "Regexp matching a line in a gopher bookmark (maybe indented). -The two subexpressions are the KEY and VALUE.") + "\\<\\(Type\\|Name\\|Path\\|Host\\|Port\\) *= *" + "Regexp matching a key in a gopher bookmark. +Set to nil to disable matching gopher bookmarks.") + +(defun ffap--gopher-var-on-line () + "Return (KEY . VALUE) of gopher bookmark on current line." + (save-excursion + (let ((eol (progn (end-of-line) (skip-chars-backward " ") (point))) + (bol (progn (beginning-of-line) (point)))) + (when (re-search-forward ffap-gopher-regexp eol t) + (let ((key (match-string 1)) + (val (buffer-substring-no-properties (match-end 0) eol))) + (cons (intern (downcase key)) val)))))) (defun ffap-gopher-at-point () "If point is inside a gopher bookmark block, return its URL. Sets the variable `ffap-string-at-point-region' to the bounds of URL, if any." ;; `gopher-parse-bookmark' from gopher.el is not so robust - (save-excursion - (beginning-of-line) - (if (looking-at ffap-gopher-regexp) - (progn - (while (and (looking-at ffap-gopher-regexp) (not (bobp))) - (forward-line -1)) - (or (looking-at ffap-gopher-regexp) (forward-line 1)) - (setq ffap-string-at-point-region (list (point) (point))) - (let ((type "1") path host (port "70")) - (while (looking-at ffap-gopher-regexp) - (let ((var (intern - (downcase - (buffer-substring (match-beginning 1) - (match-end 1))))) - (val (buffer-substring (match-beginning 2) - (match-end 2)))) - (set var val) - (forward-line 1))) - (setcdr ffap-string-at-point-region (list (point))) - (if (and path (string-match "^ftp:.*@" path)) - (concat "ftp://" - (substring path 4 (1- (match-end 0))) - (substring path (match-end 0))) - (and (= (length type) 1) - host;; (ffap-machine-p host) - (concat "gopher://" host - (if (equal port "70") "" (concat ":" port)) - "/" type path)))))))) + (when (stringp ffap-gopher-regexp) + (save-excursion + (let* ((beg (progn (beginning-of-line) + (while (and (not (bobp)) (ffap--gopher-var-on-line)) + (forward-line -1)) + (point))) + (bookmark (cl-loop for keyval = (ffap--gopher-var-on-line) + while keyval collect keyval + do (forward-line 1)))) + (when bookmark + (setq ffap-string-at-point-region (list beg (point))) + (let-alist (nconc bookmark '((type . "1") (port . "70"))) + (if (and .path (string-match "\\`ftp:.*@" .path)) + (concat "ftp://" + (substring .path 4 (1- (match-end 0))) + (substring .path (match-end 0))) + (and (= (length .type) 1) + .host ;; (ffap-machine-p host) + (concat "gopher://" .host + (if (equal .port "70") "" (concat ":" .port)) + "/" .type .path))))))))) (defvar ffap-ftp-sans-slash-regexp (and diff --git a/test/lisp/ffap-tests.el b/test/lisp/ffap-tests.el index 1ba5f86..a3fe350 100644 --- a/test/lisp/ffap-tests.el +++ b/test/lisp/ffap-tests.el @@ -49,6 +49,23 @@ (should (equal '(1 1) ffap-string-at-point-region))))) (and (file-exists-p file) (delete-file file))))) +(ert-deftest ffap-gopher-at-point () + (with-temp-buffer + (insert "\ +Type = 1 +Name = foo +Path = /the/path +Port = 7070 +Host = example.com\n") + (should-not (ffap-gopher-at-point)) + (goto-char (point-min)) + (should (equal (ffap-gopher-at-point) + "gopher://example.com:7070/1/the/path")) + (should (equal ffap-string-at-point-region + (list (point-min) (point-max)))) + (let ((ffap-gopher-regexp nil)) + (should-not (ffap-gopher-at-point))))) + (provide 'ffap-tests) ;;; ffap-tests.el ends here -- 2.9.3 --=-=-=-- From unknown Sat Jun 21 03:26:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25391: 24.5; ffap-guesser "stack overflow in regexp matcher" error may crash emacs. Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Jan 2017 14:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25391 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Thierry Volpiatto Cc: 25391@debbugs.gnu.org Received: via spool by 25391-submit@debbugs.gnu.org id=B25391.148440504418162 (code B ref 25391); Sat, 14 Jan 2017 14:45:02 +0000 Received: (at 25391) by debbugs.gnu.org; 14 Jan 2017 14:44:04 +0000 Received: from localhost ([127.0.0.1]:53446 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cSPYq-0004is-CF for submit@debbugs.gnu.org; Sat, 14 Jan 2017 09:44:04 -0500 Received: from mail-ot0-f174.google.com ([74.125.82.174]:35813) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cSPYp-0004iG-1z for 25391@debbugs.gnu.org; Sat, 14 Jan 2017 09:44:03 -0500 Received: by mail-ot0-f174.google.com with SMTP id 65so19362006otq.2 for <25391@debbugs.gnu.org>; Sat, 14 Jan 2017 06:44:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=7mrMGxCOuqHfGr3uVHY/CRM7dk6eyicJQ+fgmuO4uHo=; b=KyraXF2lxoab/mSGqEBIMnj2i/LLDoVtLWKXqLgkr2cdJ4cvCs20yfpq93v3WuPdpG 6IaHerwOUEp+MluUMayxDVUfQM4rrLd63CIhlOPpELCcg8F0OA/BR6xFuhuxk1VeKQf0 GmhqIlE4pzvvZLI846hNoNt7ORwoM+eCfAuP/HYV04WMVJC0l8bkjm5RQ2RJtdB0kJr9 mM9szj9sAeCFFqTVpvfIZYzk/6GaLeQuziw2Wzq+uzPZjumjvpb2SKcXs2IWYjYjVQ8J YJqY8GCighpQcSCpo8l5dBQuNbw8nkqTLHX9YwLa/JIhuNixsqtSFW17NsB+FcwXixyV 99BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=7mrMGxCOuqHfGr3uVHY/CRM7dk6eyicJQ+fgmuO4uHo=; b=gvpO+k6tRINEV8pohRVX2MOp8EH6xz+eiepfjGOyPiTVfhD9UO4GMDoPTjqSmAX4q6 aBPnLwd+gHV9gDsukCKinJD4K2aLsrzYWmIoG/N6JqPLbcFxSkjkKyNh4HVzMYvkUFiF EJtZohAalDRGNIHCCsqNlRD8hGgCcXvRUX3VjorbJlnFsnajGLsFw7gCo4X9fJnMID+E VwCRpuzerN3RYBm8/tvyziKXnPqAhGs6rwLiKDoxyFckE5Cn0P/KMs5wjG43bRqIQBsK BlNqp2/qb8AuZS6T7PgKYRolGxLTF39InLGTGJ+BjNj6TriOHekHhhsQCQXFamehd5vl u7mQ== X-Gm-Message-State: AIkVDXLq70GawKbxpUTdhs619a7UL+gTUtzA4ptISYfu9D1UsuH7y/N5diiZLC7HSCkDKVd4sHlTqlWdwSZeSg== X-Received: by 10.157.35.98 with SMTP id k31mr11301518otd.109.1484405037103; Sat, 14 Jan 2017 06:43:57 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.21.117 with HTTP; Sat, 14 Jan 2017 06:43:56 -0800 (PST) In-Reply-To: <874m12t57f.fsf@gmail.com> References: <87vatqc8j1.fsf@gmail.com> <87y3yl1tdp.fsf@users.sourceforge.net> <8760lp8nqv.fsf@gmail.com> <87lgul167v.fsf@users.sourceforge.net> <87y3yk67l8.fsf@gmail.com> <87eg0b1qfj.fsf@users.sourceforge.net> <87mveztmd4.fsf@gmail.com> <8760ln11f3.fsf@users.sourceforge.net> <87r34bx9gx.fsf@gmail.com> <874m12z8b1.fsf@users.sourceforge.net> <874m12t57f.fsf@gmail.com> From: Noam Postavsky Date: Sat, 14 Jan 2017 09:43:56 -0500 X-Google-Sender-Auth: 6Cmw77RE8g_cXT_ABBjy_HcS6a8 Message-ID: Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) On Sat, Jan 14, 2017 at 3:29 AM, Thierry Volpiatto wrote: > > npostavs@users.sourceforge.net writes: > >> Oh, yes, if the other regexps can be disabled like that, we should make it >> consistent. I've added a note about it to the docstring and toplevel >> comments; I'll push to master in a couple of days. > > Great thanks, perhaps you can notify also about ffap-alist==nil which > helps too to disable ffap. There is already this at the top of the file: ;; (setq ffap-alist nil) ; faster, dumber prompting Did you have something else in mind? From unknown Sat Jun 21 03:26:21 2025 X-Loop: help-debbugs@gnu.org Subject: bug#25391: 24.5; ffap-guesser "stack overflow in regexp matcher" error may crash emacs. Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Jan 2017 19:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25391 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Thierry Volpiatto Cc: 25391@debbugs.gnu.org Received: via spool by 25391-submit@debbugs.gnu.org id=B25391.148450730327370 (code B ref 25391); Sun, 15 Jan 2017 19:09:02 +0000 Received: (at 25391) by debbugs.gnu.org; 15 Jan 2017 19:08:23 +0000 Received: from localhost ([127.0.0.1]:55007 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cSqAB-00077N-HI for submit@debbugs.gnu.org; Sun, 15 Jan 2017 14:08:23 -0500 Received: from mail-ot0-f194.google.com ([74.125.82.194]:32930) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cSqA9-000775-S8 for 25391@debbugs.gnu.org; Sun, 15 Jan 2017 14:08:22 -0500 Received: by mail-ot0-f194.google.com with SMTP id f9so4777768otd.0 for <25391@debbugs.gnu.org>; Sun, 15 Jan 2017 11:08:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=l/BDXpYXSzCoqY/ex7U7EphjYA3HMCzAsJ72Pt7nEvM=; b=TGnquZSWQpPMa9FvaP5s31si13CTx5gvWJ7o6SYiz/u8oXgsINDCiG2qhHohmaxOgO vaQIz/JjcZYpwZm0jqK9HoM8tlOWXLgeTY4y7PmAMmVr1UUamKRXsL3MuDUviJR/8BYa zD94T+WK03HRRtE4Qa0b8e3aVlyZf0ad245ALqDgUMhPBfCdlR2dyOmMnsELfE9YImXY 7acdkXwPcuLRrSUI4XyAx1DZHq+kpRhExlaEh7MfGvL5UxE7nBl8TkBNQJEYi4cNxCkG qn3Rki/Rdfzgs0pxG5zo04k1B6SpGEBUocOmEmaPPfuOIIpyA5L0XNvH92QTeMqipEaz t0Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=l/BDXpYXSzCoqY/ex7U7EphjYA3HMCzAsJ72Pt7nEvM=; b=PYDUNkzoY+KzYFcZzdKEGiyDXi72iToD94KbD7NUeD9uGBcNwO3oDkjCKymbB+1l8b NHykf8BKV2RJ/Um4CiI+I6fR8uBNl22rAhqhkapgUdvAANYIx8UNhisN2mR/uXhsaUv4 Ugl0o121gRaaZL7sq0aTdCYNdQJKIDb/hWPzKfz/H57Z3+KZGaZgzpPSa5awyJEQ6ozL hr4ZeJDf1JLkiplQaN0eV688w8hXK5K1TKiw/KraV2oNqvFFzrBBGnLEtbDP9yXxMQ4e QVde0p+mdFodIkpikE5dvHzEIE1v+OqRWxyJ9+FyASHsszZ6IPBgp8JJy7PbiLFMYr1n 30sg== X-Gm-Message-State: AIkVDXJ+EyTybY4HxMMw1f9RvV28BpJUbPUkj5cPsCckSkK1mgrEDRSW0qvLK3RSaP3mnFjstx0+ksckHaHXAg== X-Received: by 10.157.40.76 with SMTP id h12mr34862otd.139.1484507296212; Sun, 15 Jan 2017 11:08:16 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.21.117 with HTTP; Sun, 15 Jan 2017 11:08:15 -0800 (PST) In-Reply-To: <8737gltvw8.fsf@gmail.com> References: <87vatqc8j1.fsf@gmail.com> <87y3yl1tdp.fsf@users.sourceforge.net> <8760lp8nqv.fsf@gmail.com> <87lgul167v.fsf@users.sourceforge.net> <87y3yk67l8.fsf@gmail.com> <87eg0b1qfj.fsf@users.sourceforge.net> <87mveztmd4.fsf@gmail.com> <8760ln11f3.fsf@users.sourceforge.net> <87r34bx9gx.fsf@gmail.com> <874m12z8b1.fsf@users.sourceforge.net> <874m12t57f.fsf@gmail.com> <8737gltvw8.fsf@gmail.com> From: Noam Postavsky Date: Sun, 15 Jan 2017 14:08:15 -0500 X-Google-Sender-Auth: 0lRMBzNIRZddnDq17vw4J9VwVFQ Message-ID: Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) tag 25391 fixed close 25391 26.1 quit On Sat, Jan 14, 2017 at 12:05 PM, Thierry Volpiatto wrote: > >>> >>> Great thanks, perhaps you can notify also about ffap-alist==nil which >>> helps too to disable ffap. >> >> There is already this at the top of the file: >> >> ;; (setq ffap-alist nil) ; faster, dumber prompting > > Ah, good sorry I mess it. > >> Did you have something else in mind? > > No, think it's good now. > > Thanks. > > -- > Thierry I've pushed to master [1: fd6b829] 1: 2017-01-15 13:04:54 -0500 fd6b829d91da73a945643b5916ee6d79c992e030 Improve ffap-gopher-at-point handling of long lines