Skip to content
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

Errors in *Messages* buffer on cider-jack-in #583

Closed
kostafey opened this issue May 27, 2014 · 17 comments
Closed

Errors in *Messages* buffer on cider-jack-in #583

kostafey opened this issue May 27, 2014 · 17 comments
Milestone

Comments

@kostafey
Copy link
Member

CIDER 20140524.138
On cider-jack-in, *Messages* buffer tail:
Error: (error "Cannot decode object: 1")
Error: (wrong-type-argument integer-or-marker-p nil)

@bbatsov
Copy link
Member

bbatsov commented May 27, 2014

But everything works regardless of these messages, right?

@turbopape
Copy link
Contributor

Same here. And yes, everything works despite the messages.

2014-05-27 12:01 GMT+01:00 Bozhidar Batsov [email protected]:

But everything works regardless of these messages, right?


Reply to this email directly or view it on GitHubhttps://github.com//issues/583#issuecomment-44260873
.

@bbatsov
Copy link
Member

bbatsov commented May 27, 2014

That's expected. It's the result of a change I made in 5e1d5e3 to be able to spot problems like those.

@kostafey
Copy link
Member Author

Yes, everything works well.

@bbatsov
Copy link
Member

bbatsov commented May 27, 2014

There were many errors were silently discarded, which made finding and fixing them pretty hard, therefore this change. At some point we'll weed out the causes of these messages.

@otfrom
Copy link
Contributor

otfrom commented May 27, 2014

I'm seeing the same as well, but it doesn't appear to stop me working.

@bbatsov
Copy link
Member

bbatsov commented May 27, 2014

Seems that something is wrong with the welcome message (the Clojure version contains raw numbers instead of strings in the response message, which might be problematic), but I'm not able to pin-point it yet. Any help debugging this would be welcome!

/cc @gtrak @jeffvalk @hugoduncan

@aamedina
Copy link

I'm not certain, but I think this might be related to freezing issues when a stacktrace is rendered by CIDER, where a recursive loop of integer decoding errors causes Emacs to freeze until the process is quit. Has anyone else run into this? I can reproduce it consistently by type checking a namespace (which I know will fail) with core.typed. Reverting to a version of CIDER prior to these commits seems to handle the issue, and of course disabling stacktraces "fixes" it.

@bbatsov
Copy link
Member

bbatsov commented May 27, 2014

@aamedina Are the integers in question stacktrace line numbers? //cc @jeffvalk

@aamedina
Copy link

I am not sure, because Emacs totally freezes (it keeps printing Error: (wrong-type-argument integer-or-marker-p nil) over and over again until you quit CIDER.)

Do you know of a way to log the stacktrace?

@jeffvalk
Copy link
Contributor

@aamedina Could you try enabling nREPL event logging with(setq nrepl-log-events t), and check the *nrepl-events* buffer for the last op and the messages that follow?

@arrdem
Copy link
Contributor

arrdem commented May 27, 2014

I'll chime in here as affected by this issue, no debugging information to add unfortunately.

@jeffvalk
Copy link
Contributor

Looks like that variable and buffer just got renamed... Try setting (setq nrepl-log-messages t), and check the *nrepl-messages* buffer.

@bbatsov
Copy link
Member

bbatsov commented May 28, 2014

A small update from me. The problem is that on REPL start the current code tries to decode the banner message:

; CIDER 0.7.0snapshot (package: 20140524.138) (Java 1.7.0_17, Clojure 10, nREPL 0.2.3)
user> 

One simple workaround would be to skip it, but I'll try do devise a more robust fix.

@bbatsov
Copy link
Member

bbatsov commented May 28, 2014

It seems that some marker is not properly set when the REPL is created, which is causing this, but I still cannot determine which one. It's not clear at all to me why is the initial state of REPL passed to the connection buffer to be decoded...

@bbatsov
Copy link
Member

bbatsov commented May 28, 2014

Hmmm, it seems I was incorrect. Actually the problem seems to be here:

(defun nrepl-net-decode ()
  "Decode the data in the current buffer.
Remove the processed data from the buffer if the decode successful."
  (let* ((start (point-min))
         (end (point-max))
         (data (buffer-substring start end)))
    (prog1
        (nrepl-decode data)
      (delete-region start end))))

This function is supposed to be called with the current connection buffer as the current buffer, but when the REPL buffer is created for some reason it temporarily becomes the current buffer and we end up trying to decode its content. I noticed this after spending some quality time debugging a dozen of related functions. I wasted a lot of time today, so I'm giving up for now.

@jeffvalk
Copy link
Contributor

#583, #586, and #597 all look to be related, if not the same issue.

vspinu added a commit to vspinu/cider that referenced this issue Jun 11, 2014
vspinu added a commit to vspinu/cider that referenced this issue Jun 11, 2014
vspinu added a commit to vspinu/cider that referenced this issue Jun 11, 2014
vspinu added a commit to vspinu/cider that referenced this issue Jun 11, 2014
jeffvalk pushed a commit to jeffvalk/cider that referenced this issue Jun 16, 2014
…PL buffer

I still have no idea what causes this problem, but at least people won't see
the error anymore.
dgtized pushed a commit to dgtized/cider that referenced this issue Jun 24, 2014
…PL buffer

I still have no idea what causes this problem, but at least people won't see
the error anymore.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants