skeeto / elfeed

An Emacs web feeds client
The Unlicense
1.52k stars 121 forks source link

elfeed update mkdir error on emacs 29.1 #514

Open ratnesh1729 opened 5 months ago

ratnesh1729 commented 5 months ago

Thank you for the nice package. Running elfeed-update gives me this error (vanilla elfeed setup)

[2024-06-17 06:54:17] [error]: http://nullprogram.com/feed/: (wrong-number-of-arguments (lambda (dir) Make directory `dir' and don't signal error if it already exists. (if (not (file-directory-p dir)) (progn (make-directory dir)))) 2)
[2024-06-17 06:54:17] [error]: http://nedroid.com/feed/: (wrong-number-of-arguments (lambda (dir) Make directory `dir' and don't signal error if it already exists. (if (not (file-directory-p dir)) (progn (make-directory dir)))) 2)
[2024-06-17 06:54:17] [error]: http://www.50ply.com/atom.xml: (wrong-number-of-arguments (lambda (dir) Make directory `dir' and don't signal error if it already exists. (if (not (file-directory-p dir)) (progn (make-directory dir)))) 2)

I traced this is coming from mkdir in elfeed-db.el

Debugger entered--Lisp error: (wrong-number-of-arguments (lambda (dir) "Make directory `dir' and don't signal error if it ..." (if (not (file-directory-p dir)) (progn (make-directory dir)))) 2)
  mkdir("~/.elfeed" t)
  elfeed-db-save()
  elfeed-update()
  funcall-interactively(elfeed-update)
  command-execute(elfeed-update record)
  #<subr execute-extended-command>(nil "elfeed-update" nil)
  ad-Advice-execute-extended-command(#<subr execute-extended-command> nil "elfeed-update" nil)
  apply(ad-Advice-execute-extended-command #<subr execute-extended-command> (nil "elfeed-update" nil))
  execute-extended-command(nil "elfeed-update" nil)
  funcall-interactively(execute-extended-command nil "elfeed-update" nil)
  command-execute(execute-extended-command)

Seeking pointers etc here.

Thank you!

skeeto commented 5 months ago

The mkdir docstring in your trace appears nowhere in Emacs, and I can't find a single instance of that string when searching online. Someone or something, which has never been published to the internet, is redefining your mkdir function. The redefinition is not even byte-compiled, so it's not part of your Emacs installation.

(I was concerned that upstream Emacs development broke this interface, but fortunately that's not the case.)

skeeto commented 5 months ago

Managed to find a near-match here: https://github.com/netromdk/.emacs.d/blob/26739c81/lisp/2-functions.el#L235-L238

Seems your local definition was copied from here and changed, vice versa, or there's some original common source. Aside from having the wrong number of arguments, this definition also comes with a TOCTOU race condition.

ratnesh1729 commented 5 months ago

Thanks! I have been using identical one. I must have copied from his file. I will purge this.

Thank you again!