unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#18165: 24.3.92; cedet: semanticdb-needs-refresh-p sometimes report (wrong-type-argument number-or-marker-p nil) error
@ 2014-08-01  9:06 Kan-Ru Chen
  2014-09-15  4:00 ` bug#18165: [PATCH] Fix error when semanticdb-needs-refresh-p is called on a non-existing file Kan-Ru Chen
  0 siblings, 1 reply; 4+ messages in thread
From: Kan-Ru Chen @ 2014-08-01  9:06 UTC (permalink / raw)
  To: 18165

[-- Attachment #1: Type: text/plain, Size: 1713 bytes --]

Sometimes when semanticdb-needs-refresh-p is called on a non-existing
file it will report (wrong-type-argument number-or-marker-p nil)

The backtrace is too large so I attached a cropped image instead.

Tentative patch:

diff --git a/lisp/cedet/semantic/db.el b/lisp/cedet/semantic/db.el
index 76a49dd..0e68cb5 100644
*** a/lisp/cedet/semantic/db.el
--- b/lisp/cedet/semantic/db.el
***************
*** 593,609 ****
  	  )
        ;; Buffer isn't loaded.  The only clue we have is if the file
        ;; is somehow different from our mark in the semanticdb table.
        (let* ((stats (file-attributes ff))
  	     (actualsize (nth 7 stats))
  	     (actualmod (nth 5 stats))
  	     )
  
! 	(or (not (slot-boundp obj 'tags))
  	    ;; (not (oref obj tags)) -->  not needed anymore?
  	    (/= (or (oref obj fsize) 0) actualsize)
  	    (not (equal (oref obj lastmodtime) actualmod))
  	    )
  	))))
  
  \f
  ;;; Synchronization
--- 593,610 ----
  	  )
        ;; Buffer isn't loaded.  The only clue we have is if the file
        ;; is somehow different from our mark in the semanticdb table.
        (let* ((stats (file-attributes ff))
  	     (actualsize (nth 7 stats))
  	     (actualmod (nth 5 stats))
  	     )
  
! 	(or (not stats)
! 	    (not (slot-boundp obj 'tags))
  	    ;; (not (oref obj tags)) -->  not needed anymore?
  	    (/= (or (oref obj fsize) 0) actualsize)
  	    (not (equal (oref obj lastmodtime) actualmod))
  	    )
  	))))
  
  \f
  ;;; Synchronization


In GNU Emacs 24.3.92.3 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.10)
 of 2014-08-01 on kanru-mozilla
Windowing system distributor `The X.Org Foundation', version 11.0.11204000
System Description:	Debian GNU/Linux 7.6 (wheezy)


[-- Attachment #2: 2014-08-01-153725_659x468_scrot.png --]
[-- Type: image/png, Size: 102437 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#18165: [PATCH] Fix error when semanticdb-needs-refresh-p is called on a non-existing file
  2014-08-01  9:06 bug#18165: 24.3.92; cedet: semanticdb-needs-refresh-p sometimes report (wrong-type-argument number-or-marker-p nil) error Kan-Ru Chen
@ 2014-09-15  4:00 ` Kan-Ru Chen
  2014-09-15 19:40   ` David Engster
  0 siblings, 1 reply; 4+ messages in thread
From: Kan-Ru Chen @ 2014-09-15  4:00 UTC (permalink / raw)
  To: 18165

[-- Attachment #1: Type: text/plain, Size: 62 bytes --]

Could someone help me install this patch to emacs-24 branch?


[-- Attachment #2: 0001-Fix-error-when-semanticdb-needs-refresh-p-is-called-.patch --]
[-- Type: text/x-diff, Size: 1840 bytes --]

From f284dcc3ed0345769ed8863df36800f98af574b7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kan-Ru=20Chen=20=28=E9=99=B3=E4=BE=83=E5=A6=82=29?=
 <kanru@kanru.info>
Date: Mon, 15 Sep 2014 11:47:47 +0800
Subject: Fix error when semanticdb-needs-refresh-p is called on a non-existing
 file. (Bug#18165)

 * semantic/db.el (semanticdb-needs-refresh-p): Ignore nil file
 stats. (Bug#18165)

diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog
index f9f0cf8..626f449 100644
--- a/lisp/cedet/ChangeLog
+++ b/lisp/cedet/ChangeLog
@@ -1,8 +1,13 @@
+2014-09-15  Kan-Ru Chen (陳侃如)  <kanru@kanru.info>
+
+	* semantic/db.el (semanticdb-needs-refresh-p): Ignore nil file
+	stats. (Bug#18165)
+
 2014-05-01  Glenn Morris  <rgm@gnu.org>
 
 	* ede.el (ede-project-directories, ede-check-project-directory):
 	* semantic/ia-sb.el (semantic-ia-sb-show-doc):
 	* semantic/tag.el (semantic-tag-in-buffer-p):
 	* semantic/bovine/c.el (semantic-tag-abstract-p):
 	Doc fixes (replace `iff').
 
diff --git a/lisp/cedet/semantic/db.el b/lisp/cedet/semantic/db.el
index 76a49dd..0e68cb5 100644
--- a/lisp/cedet/semantic/db.el
+++ b/lisp/cedet/semantic/db.el
@@ -593,17 +593,18 @@ The file associated with OBJ does not need to be in a buffer."
 	  )
       ;; Buffer isn't loaded.  The only clue we have is if the file
       ;; is somehow different from our mark in the semanticdb table.
       (let* ((stats (file-attributes ff))
 	     (actualsize (nth 7 stats))
 	     (actualmod (nth 5 stats))
 	     )
 
-	(or (not (slot-boundp obj 'tags))
+	(or (not stats)
+	    (not (slot-boundp obj 'tags))
 	    ;; (not (oref obj tags)) -->  not needed anymore?
 	    (/= (or (oref obj fsize) 0) actualsize)
 	    (not (equal (oref obj lastmodtime) actualmod))
 	    )
 	))))
 
 \f
 ;;; Synchronization
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#18165: [PATCH] Fix error when semanticdb-needs-refresh-p is called on a non-existing file
  2014-09-15  4:00 ` bug#18165: [PATCH] Fix error when semanticdb-needs-refresh-p is called on a non-existing file Kan-Ru Chen
@ 2014-09-15 19:40   ` David Engster
  2020-08-12 18:39     ` Stefan Kangas
  0 siblings, 1 reply; 4+ messages in thread
From: David Engster @ 2014-09-15 19:40 UTC (permalink / raw)
  To: Kan-Ru Chen; +Cc: 18165

Kan-Ru Chen (陳侃如) writes:
> Could someone help me install this patch to emacs-24 branch?

I wonder why semanticdb-needs-refresh-p is called on a non-existing file
in the first place. Could you please provide a recipe to reproduce this
bug?

Thanks,
David





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#18165: [PATCH] Fix error when semanticdb-needs-refresh-p is called on a non-existing file
  2014-09-15 19:40   ` David Engster
@ 2020-08-12 18:39     ` Stefan Kangas
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Kangas @ 2020-08-12 18:39 UTC (permalink / raw)
  To: Kan-Ru Chen, 18165-done

David Engster <deng@randomsample.de> writes:

> Kan-Ru Chen (陳侃如) writes:
>> Could someone help me install this patch to emacs-24 branch?
>
> I wonder why semanticdb-needs-refresh-p is called on a non-existing file
> in the first place. Could you please provide a recipe to reproduce this
> bug?

More information was requested, but none was given within 6 years, so
I'm closing this bug.  If this is still an issue, please reply to this
email (use "Reply to all" in your email client) and we can reopen the
bug report.

Best regards,
Stefan Kangas





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-12 18:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-01  9:06 bug#18165: 24.3.92; cedet: semanticdb-needs-refresh-p sometimes report (wrong-type-argument number-or-marker-p nil) error Kan-Ru Chen
2014-09-15  4:00 ` bug#18165: [PATCH] Fix error when semanticdb-needs-refresh-p is called on a non-existing file Kan-Ru Chen
2014-09-15 19:40   ` David Engster
2020-08-12 18:39     ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).