"Invalid function: 0"

Bug #589635 reported by kjsdb_v2
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nXhtml
Fix Committed
Medium
Unassigned

Bug Description

I keep getting this message "mumamo-do-fontify-2: mumamo-do-fontify m=php-mode, s/e=1465/1586 syn-min/max=1470/5225: Invalid function: 0" for no apparent rhyme or reason.

Revision history for this message
lborgman (lennart-borgman) wrote :

Hi kjsdb_v2,

Thanks for the bug report, but I am afraid you have to give me an example of how to reproduce this if you want me to fix it.

Changed in nxhtml:
importance: Undecided → Medium
status: New → Incomplete
importance: Medium → Undecided
Revision history for this message
kjsdb_v2 (kjsdb) wrote :
Download full text (15.1 KiB)

Maybe some backtrace will help. I removed the syntax tables because they seemed to add little, simply dots.

MU:mumamo-do-fontify-2: mumamo-do-fontify m=php-mode, s/e=1/82 syn-min/max=6/80: Invalid function: 0
** In buffer VLANsConverter-Test.php
  backtrace()
  (let ((standard-output standard-output)) (backtrace))
  (progn (let (...) (backtrace)) (with-current-buffer standard-output (buffer-string)))
  (unwind-protect (progn (let ... ...) (with-current-buffer standard-output ...)) (kill-buffer standard-output))
  (let ((standard-output ...)) (unwind-protect (progn ... ...) (kill-buffer standard-output)))
  (with-output-to-string (backtrace))
  (let ((format-string2 ...) (bt ...)) (mumamo-message-with-face (concat ... "
" ... bt) (quote highlight)) (apply (quote message) format-string2 lwarn-type args) (run-with-idle-timer 1 nil (quote mumamo-show-report-message)) (when mumamo-display-error-stop (setq font-lock-mode nil) (when ... ...) (when ... ...) (apply ... format-string2 lwarn-type args)))
  mumamo-display-error(mumamo-do-fontify-2 "mumamo-do-fontify m=%s, s/e=%s/%s syn-min/max=%s/%s: %s" php-mode 1 82 6 80 "Invalid function: 0")
  (condition-case err (save-restriction (when ... ... ... ... ... ...)) (error (mumamo-display-error ... "mumamo-do-fontify m=%s, s/e=%s/%s syn-min/max=%s/%s: %s" chunk-major start end chunk-syntax-min chunk-syntax-max ...)))
  (if (not mumamo-use-condition-case) (let* (... ...) (save-restriction ...)) (condition-case err (save-restriction ...) (error ...)))
  (mumamo-condition-case err (save-restriction (when ... ... ... ... ... ...)) (error (mumamo-display-error ... "mumamo-do-fontify m=%s, s/e=%s/%s syn-min/max=%s/%s: %s" chunk-major start end chunk-syntax-min chunk-syntax-max ...)))
  (progn (mumamo-condition-case err (save-restriction ...) (error ...)))
  (if (< new-start new-end) (progn (mumamo-condition-case err ... ...)))
  (when (< new-start new-end) (mumamo-condition-case err (save-restriction ...) (error ...)))
  (let ((new-start ...) (new-end ...)) (when (< new-start new-end) (mumamo-condition-case err ... ...)))
  (let* ((font-lock-dont-widen t) (font-lock-extend-region-functions font-lock-extend-region-functions) (funs font-lock-extend-region-functions) (font-lock-beg ...) (font-lock-end ...) (while-n1 0)) (while (and ... funs) (setq funs ...)) (let (... ...) (when ... ...)))
  (condition-case err (let* (... ... ... ... ... ...) (while ... ...) (let ... ...)) (error (mumamo-display-error ... "mumamo-do-fontify m=%s, s=%s, e=%s: %s" chunk-major start end ...)))
  (if (not mumamo-use-condition-case) (let* (... ...) (let* ... ... ...)) (condition-case err (let* ... ... ...) (error ...)))
  (mumamo-condition-case err (let* (... ... ... ... ... ...) (while ... ...) (let ... ...)) (error (mumamo-display-error ... "mumamo-do-fontify m=%s, s=%s, e=%s: %s" chunk-major start end ...)))
  mumamo-do-fontify(1 82 nil 6 80 php-mode)
  (progn (mumamo-do-fontify 1 82 nil 6 80 major))
  eval((progn (mumamo-do-fontify 1 82 nil 6 80 major)))
  #[(body) "\306\307\310\311\312\313\314\306\315\316\317\211\315\211\320\306\321\322\306\211\211\323\306\315\211\324\325\306\326\306\211\327\330\331\332\333\334\335\336\306\211\3...

Revision history for this message
lborgman (lennart-borgman) wrote :

Thanks kjsdb_v2, but I am afraid I still need an example. The backtrace might be helpful but it has just a small part of the information needed in a situation like this.

Please try to reproduce this starting from a fresh Emacs with just nXhtml loaded. You can start a new Emacs with this with the command

   M-x emacs-Q-nxhtml

PS: When sending backtraces it is useful uploading them as attachments instead of pasting them. Reading here will be much easier and the backtrace will not get corrupted.

Revision history for this message
kjsdb_v2 (kjsdb) wrote :

Sorry, you're on your own with that. I'm not allowed to give away our code, which is what giving you an example would mean.

BTW, what will emacs-Q-nxhtml do when emacs is a bash alias to 'emacsclient -t --alternate-editor=""', and the current instance was started with that?

Anyway, it doesn't happen if I only load that. Nor when I include my php configuration as well. I will see if I can narrow it down in my configuration.

Revision history for this message
lborgman (lennart-borgman) wrote :

Perhaps you can make a simple dummy example? It does not have to be working code, nXhtml does not care about that ;-)

emacs-Q-nxhtml looks for the Emacs variable `invocation-name'. What is that in your case?

Does the command emacs-Q-nxhtml work in your Emacs?

I have seen similar errors that looked quite weird from the beginning. In the end it mostly turns out that there was a bad assumption in one of the major modes involved. (This is one reason I am shipping some major modes with nXhtml.)

Pleas tell me what you find out. Good luck.

Revision history for this message
kjsdb_v2 (kjsdb) wrote :

Okay, well the closest I can say is it seems to be be dependent on nxhtml, flymake, *and* test-case-mode (http://nschum.de/src/emacs/test-case-mode/ and especially http://github.com/ieure/test-case-mode which is a changed version I use to test php code)

;; flymake
(require 'flymake)
(add-hook 'find-file-hook 'flymake-find-file-hook)

;; test-case-mode
(autoload 'test-case-mode "test-case-mode" nil t)
(autoload 'enable-test-case-mode-if-test "test-case-mode")
(autoload 'test-case-find-all-tests "test-case-mode" nil t)
(autoload 'test-case-compilation-finish-run-all "test-case-mode")
(add-hook 'find-file-hook 'enable-test-case-mode-if-test)

I've also tried it without the find-file-hooks and it makes no difference. And yes, the files I see it on are only my unit test files.

Revision history for this message
lborgman (lennart-borgman) wrote :

Looking at the backtrace more closely I see a problem there. It actually says that nxhtml-mumamo is not defined.

The name nxhtml-mumamo is not autoloaded, only the longer name nxhtml-mumamo-mode is autloaded. I have forgotten that php-mode.el uses the shorter name.

Could you please try and change to the longer name at line 287 in php-mode.el and see if that helps. (Don't forget to also recompile php-mode.el if you have it byte compiled.)

Changed in nxhtml:
importance: Undecided → Medium
Revision history for this message
kjsdb_v2 (kjsdb) wrote :

That works :) Thanks.

Revision history for this message
lborgman (lennart-borgman) wrote :

Oh, fine. Sorry for the trouble and thanks for helping to solve this.

I think I should remove the shorter names to avoid this kind of trouble. (I have only kept them for backward compatibility.)

Changed in nxhtml:
status: Incomplete → Fix Released
status: Fix Released → Fix Committed
Revision history for this message
kjsdb_v2 (kjsdb) wrote :

Sorry, but this doesn't seem to have fixed it after all. It doesn't happen all of the time, only most of the time, and I obviously hit a time when it didn't happen when I tested it before.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.