The below patch fixes the bug of infinite looping.
diff --git a/lisp/files.el b/lisp/files.el
index ee5efe4..c680d32 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3120,8 +3120,9 @@ If the file is in a registered project, a cons from
`project-directory-alist' is returned.
Otherwise this returns nil."
(let ((dir (file-name-directory file))
+ (root (expand-file-name "/"))
(result nil))
- (while (and (not (string= dir "/"))
+ (while (and (not (string= dir root))
(not result))
(cond
((setq result (assoc dir project-directory-alist))