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

Error reporting in Epoch is broken #994

Closed
edwardalee opened this issue Mar 3, 2022 · 5 comments · Fixed by #995 or #998
Closed

Error reporting in Epoch is broken #994

edwardalee opened this issue Mar 3, 2022 · 5 comments · Fixed by #995 or #998
Assignees
Labels
bug Something isn't working epoch Epoch IDE
Milestone

Comments

@edwardalee
Copy link
Collaborator

Maybe due to recent changes in FileUtil and related classes, error reporting is broken in Epoch. If I attempt to generate code for the following:

target C;
federated reactor {
    initial mode A { }
}

I get a null-pointer exception. I should instead get this:

The currently selected code generation or target configuration does not support modal reactors!

(Modal models are not yet supported for federated reactors).

@edwardalee edwardalee added bug Something isn't working epoch Epoch IDE labels Mar 3, 2022
cmnrd added a commit that referenced this issue Mar 3, 2022
This change reverts a small part of #978 in order to fix the broken error
reporting in Epoch.

closes #994
@cmnrd cmnrd added this to the 0.1.0 milestone Mar 3, 2022
@cmnrd
Copy link
Collaborator

cmnrd commented Mar 3, 2022

That is my bad! All this resource and iResource stuff is really confusing... I opened a fix PR.

@cmnrd cmnrd closed this as completed in #995 Mar 3, 2022
cmnrd added a commit that referenced this issue Mar 3, 2022
This change reverts a small part of #978 in order to fix the broken error
reporting in Epoch.

closes #994
@edwardalee
Copy link
Collaborator Author

Actually, it seems we aren't out of the woods yet. I'm still getting a NPE, but it seems impossible to tell where it is occurring because it is not caught. Eclipse traps the error and displays the following:
image

Any ideas how to find out where the NPE is thrown?

@edwardalee
Copy link
Collaborator Author

I think this will be fixed by PR #998.

@edwardalee
Copy link
Collaborator Author

edwardalee commented Mar 3, 2022

Actually, still more problems. Epoch no longer marks compile errors. Minimal example:

target C;
main reactor {
    reaction(startup) {=
        foo();
    =}
}

The console shows this error:

gmake: *** [Makefile:136: all] Error 2
ERROR: Users/eal/lingua-franca-master/git/lingua-franca/experimental/C/src/Junk.lf line 4
 error: implicit declaration of function 'foo' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    /*Correspondence: Range: [(3, 8), (4, 4)) -> Range: [(0, 0), (1, 4)) (src=/resource/Experimental/src/Junk.lf)*/foo();

However, nothing is shown in Epoch:
image

Note the complete lack of marks or error messages. Worse, this causes an ever growing number of broken threads. The Eclipse debugger shows this (completely useless) stack trace:

image

Sometimes, the console shows the following:

gmake: *** [Makefile:136: all] Error 2
Exception in thread "pool-13-thread-1" java.lang.NullPointerException
	at org.lflang.generator.EclipseErrorReporter.report(EclipseErrorReporter.java:119)
	at org.lflang.generator.EclipseErrorReporter.reportError(EclipseErrorReporter.java:201)
	at org.lflang.generator.GeneratorBase.reportCommandErrors(GeneratorBase.java:893)
	at org.lflang.generator.c.CCmakeCompiler.runCCompiler(CCmakeCompiler.java:161)
	at org.lflang.generator.c.CGenerator$1.run(CGenerator.java:1104)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

All of this makes Epoch pretty unusable now.

@cmnrd
Copy link
Collaborator

cmnrd commented Mar 4, 2022

Again this was my bad. The NullPointerException in the error reporter was caused by the same change as the exception described in your original post. I pushed a fix to #998, with this change error reporting in Eclipse should work now as normal.

It is too bad that we cannot effectively test Epoch... I did a few smoke tests before merging #963, but apparently not the right ones.

@cmnrd cmnrd linked a pull request Mar 4, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working epoch Epoch IDE
Projects
None yet
3 participants