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

Editor deadlock and null pointer exception while parsing java file #4122

Open
smil2k opened this issue May 16, 2022 · 11 comments
Open

Editor deadlock and null pointer exception while parsing java file #4122

smil2k opened this issue May 16, 2022 · 11 comments
Labels
kind:bug Bug report or fix needs:triage Requires attention from one of the committers

Comments

@smil2k
Copy link

smil2k commented May 16, 2022

Apache NetBeans version

Apache NetBeans 13

What happened

Pressing ctrl-space for suggestions leaves the editor in a freezing state.

Stacktrace reveals that in case the java source cannot be parsed, then the basedocument "loses" the write lock.

How to reproduce

I pressed ctrl-space in the attached source file.

Did this work correctly in an earlier version?

No

Operating System

Linux

JDK

11.0.15+10-Ubuntu-0ubuntu0.20.04.1

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

Reproduced 3 times in a row.

Are you willing to submit a pull request?

No

Code of Conduct

Yes

@smil2k smil2k added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels May 16, 2022
@smil2k
Copy link
Author

smil2k commented May 16, 2022

messages.log

@mbien
Copy link
Member

mbien commented May 16, 2022

@smil2k i believe you forgot to attach the java file. If it doesn't work paste it into a code section assuming its not too big, would be great to have a small, self-contained reproducer if possible.

@smil2k
Copy link
Author

smil2k commented May 16, 2022

@smil2k
Copy link
Author

smil2k commented May 16, 2022

@mbien The most important part for me is that in this case the editor stuck, all files left unsaved.

The fact that code complete did not work is secondary.

@mbien
Copy link
Member

mbien commented May 16, 2022

I took the class from the dump file and could edit it in NetBeans 13. Autocompletion worked too on the few fields which can be resolved.

@smil2k
Copy link
Author

smil2k commented May 16, 2022

z.zip
This is the set of files produced by the series of null pointers.

The problem happened, when I rewrote repository to repo (so the type became available) then the "No suggestion" tooltip shown and the editor stuck.

@mbien
Copy link
Member

mbien commented May 16, 2022

NPEs in javac can be caused by a lot of things. Since I can't reproduce this (not even the exceptions), the most likely explanation is lombok.

A thread dump would show if its actually a deadlock or something else (e.g an infinite loop). You could also check if its reproducible in NetBeans 14rc3 since it uses a javac library based on JDK 18 (https://lists.apache.org/thread/m56qct2ksl210rr1hpdvcgcsydxnyg9c ).

@smil2k
Copy link
Author

smil2k commented May 16, 2022

Ok, no worries.

I've attached the stackdump from the locked up editor, could you please check that also?
I'm more interested in the deadlock part, I got used to null pointer in javac. Code complete often fails with closures.

Somehow this null pointer could leave the document in a write locked state.

@mbien
Copy link
Member

mbien commented May 17, 2022

Uploading deadlock2.txt…

@smil2k this link does not work.

@smil2k
Copy link
Author

smil2k commented May 18, 2022

deadlock2.txt

@smil2k
Copy link
Author

smil2k commented May 18, 2022

@mbien I was not able to save the file either, only after fixing an import problem the whole thing started to work again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug Bug report or fix needs:triage Requires attention from one of the committers
Projects
None yet
Development

No branches or pull requests

2 participants