-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segfault in c module on invalid characters with consult-buffer #9
Comments
Thanks for reporting this issue. It is caused by the code not handling errors raised by |
I am now using this code: (defadvice! hotfuzz--filter-c-simple-string (orig-fun string candidates &optional ignore-case)
:around #'hotfuzz--filter-c
(with-demoted-errors "Error in hotfuzz--filter-c-simple-string: %S"
(let*
(
(table (make-hash-table :test #'eq :size (length candidates)))
(cands
(--keep
(when (stringp it)
(let ((encoded (encode-coding-string it 'no-conversion 'nocopy)))
(setf (gethash encoded table) it)
(and (< (length encoded) hotfuzz--max-haystack-len) encoded)))
candidates))
(raw-str (encode-coding-string string 'no-conversion 'nocopy))
(ans
(let
(
(gc-cons-threshold most-positive-fixnum)
(gc-cons-percentage 1.0))
(funcall orig-fun raw-str cands ignore-case))))
(--keep (gethash it table) ans))))
(defadvice! hotfuzz-filter-advice (string _candidates)
:before-while #'hotfuzz-filter
(and
(not (string= string ""))
(< (length (encode-coding-string string 'no-conversion 'nocopy)) hotfuzz--max-needle-len))) Nonetheless, I get segfaults every so often. ASAN has this to say:
Miraculously I have yet to get a segfault/error under ASAN + |
if this helps
|
Consult apparently tags strings with invalid character; see https://www.reddit.com/r/emacs/comments/n43mdo/problem_with_narrowing_minibuffer_items_with/
Minimal example:
(hotfuzz--filter-c "tet" (list (concat "test" (char-to-string #x200000))))
The text was updated successfully, but these errors were encountered: