Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix for ASTUtils.width() returnning -1 even when the width can be inferred from connections #1287

Merged
merged 4 commits into from
Jul 12, 2022

Conversation

hokeun
Copy link
Member

@hokeun hokeun commented Jul 8, 2022

This is to fix an error found while working on #1275.

Weirdly, adding createMainReactorInstance() to TypeScript code generator breaks following existing tests.

Below is an example raw error message from the broken tests' runLfc:

lfc: fatal error: An unexpected error occurred:
java.lang.NullPointerException: Cannot read field "_interleaved" because "src" is null
	at org.lflang.generator.ReactorInstance.connectPortInstances(ReactorInstance.java:863)
	at org.lflang.generator.ReactorInstance.establishPortConnections(ReactorInstance.java:925)
	at org.lflang.generator.ReactorInstance.<init>(ReactorInstance.java:824)
	at org.lflang.generator.ReactorInstance.<init>(ReactorInstance.java:112)
	at org.lflang.generator.ts.TSGenerator.createMainReactorInstance(TSGenerator.kt:256)
	at org.lflang.generator.ts.TSGenerator.doGenerate(TSGenerator.kt:154)
	at org.lflang.generator.LFGenerator.doGenerate(LFGenerator.java:164)
	at org.eclipse.xtext.generator.GeneratorDelegate.doGenerate(GeneratorDelegate.java:44)
	at org.eclipse.xtext.generator.GeneratorDelegate.generate(GeneratorDelegate.java:35)
	at org.lflang.lfc.Main.runGenerator(Main.java:293)
	at org.lflang.lfc.Main.main(Main.java:222)

Specifically, when the width becomes 0, RuntimeRange<PortInstance> src becomes null.

@hokeun hokeun requested review from lhstrh and edwardalee July 8, 2022 20:42
Copy link
Collaborator

@edwardalee edwardalee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this change. The failure in Cpp is worrisome, but I can't read the CI output so I don't know the failure actually is. The Cpp tests log output has an absurd number of printf outputs... Are these all needed? Anyway, I search the logs for "failed" and "error" and found nothing, but the CI reports that the test failed.

I think that width == 0 in delays means that the width need to be inferred from the context. So I'm not sure that simply ignoring it is the right thing to do. But again, I can't find anywhere that this field maxWidth is used (Eclipse tells me there are no references to it), so don't know what the implications are.

@hokeun
Copy link
Member Author

hokeun commented Jul 10, 2022

Thank you for your comments, @edwardalee!

I'm not sure about this change. The failure in Cpp is worrisome, but I can't read the CI output so I don't know the failure actually is. The Cpp tests log output has an absurd number of printf outputs... Are these all needed? Anyway, I search the logs for "failed" and "error" and found nothing, but the CI reports that the test failed.

I think you meant this error in cpp-benchmark-tests/run:
Screen Shot 2022-07-09 at 3 31 14 PM

Here is the error message I tracked down:

Error executing job with overrides: ['test_mode=True', 'iterations=1', 'benchmark=savina_micro_threadring', 'target=lf-cpp', 'iterations=1', 'target.params.extra_args=[--external-runtime-path,/home/runner/work/lingua-franca/lingua-franca/reactor-cpp/install]']
An error occurred during Hydra's exception formatting:
TypeError("print_exception() got an unexpected keyword argument 'etype'")
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.10.5/x64/lib/python3.10/site-packages/hydra/_internal/utils.py", line 283, in run_and_report
    print_exception(etype=None, value=ex, tb=final_tb)  # type: ignore
TypeError: print_exception() got an unexpected keyword argument 'etype'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/runner/work/lingua-franca/lingua-franca/runner/run_benchmark.py", line 194, in <module>
    main()
  File "/opt/hostedtoolcache/Python/3.10.5/x64/lib/python3.10/site-packages/hydra/main.py", line 48, in decorated_main
    _run_hydra(
  File "/opt/hostedtoolcache/Python/3.10.5/x64/lib/python3.10/site-packages/hydra/_internal/utils.py", line 385, in _run_hydra
    run_and_report(
  File "/opt/hostedtoolcache/Python/3.10.5/x64/lib/python3.10/site-packages/hydra/_internal/utils.py", line 294, in run_and_report
    raise ex
  File "/opt/hostedtoolcache/Python/3.10.5/x64/lib/python3.10/site-packages/hydra/_internal/utils.py", line 211, in run_and_report
    return func()
  File "/opt/hostedtoolcache/Python/3.10.5/x64/lib/python3.10/site-packages/hydra/_internal/utils.py", line 386, in <lambda>
    lambda: hydra.multirun(
  File "/opt/hostedtoolcache/Python/3.10.5/x64/lib/python3.10/site-packages/hydra/_internal/hydra.py", line 140, in multirun
    ret = sweeper.sweep(arguments=task_overrides)
  File "/opt/hostedtoolcache/Python/3.10.5/x64/lib/python3.10/site-packages/hydra/_internal/core_plugins/basic_sweeper.py", line 161, in sweep
    _ = r.return_value
  File "/opt/hostedtoolcache/Python/3.10.5/x64/lib/python3.10/site-packages/hydra/core/utils.py", line 233, in return_value
    raise self._return_value
  File "/opt/hostedtoolcache/Python/3.10.5/x64/lib/python3.10/site-packages/hydra/core/utils.py", line 160, in run_job
    ret.return_value = task_function(task_cfg)
  File "/home/runner/work/lingua-franca/lingua-franca/runner/run_benchmark.py", line 75, in main
    check_return_code(code, continue_on_error)
  File "/home/runner/work/lingua-franca/lingua-franca/runner/run_benchmark.py", line 107, in check_return_code
    raise RuntimeError(
RuntimeError: Command returned with non-zero exit code (1)
Error: Process completed with exit code 1.

To me, it looks like the root cause of the error above might not be related to this change, but I'm not 100% sure yet. Do you think you could recommend a point of contact to reach out to regarding this error? Maybe @cmnrd?

I think that width == 0 in delays means that the width need to be inferred from the context. So I'm not sure that simply ignoring it is the right thing to do.

I'm not sure either... But without this change, we get an error in existing tests when createMainReactorInstance() is added. I updated the description of this PR to explain the error I'm trying to fix.

But again, I can't find anywhere that this field maxWidth is used (Eclipse tells me there are no references to it), so don't know what the implications are.

You're right. maxWidth is only used within in the constructor of RuntimeRange to determine width. And it becomes problematic when maxWidth

@hokeun hokeun requested a review from edwardalee July 10, 2022 01:34
hokeun added a commit that referenced this pull request Jul 10, 2022
hokeun added a commit that referenced this pull request Jul 11, 2022
…g logic for inferring width from connections into width() function of ASTUtils.java. (Related PR: #1287).
@hokeun hokeun changed the title Fixed issue with multiplying non-positive parent.width in RuntimeRange Fixed issue with ASTUtils width() returnning -1 even when the width can be inferred from connections Jul 11, 2022
@hokeun
Copy link
Member Author

hokeun commented Jul 11, 2022

@edwardalee, I fixed this issue in a different way, by inferring the width from connections when it's possible. I believe this fixes the fundamental issue. Do you think you could take another look when you get a chance? Thanks!

@cmnrd
Copy link
Collaborator

cmnrd commented Jul 12, 2022

I am not sure which CI run you are talking about. If you provide me with a link, I am happy to take a look. The line Error executing job with overrides: ['test_mode=True', 'iterations=1', 'benchmark=savina_micro_threadring'] states that an error happened while executing the Thread Ring benchmark. Searching for savina_micro_threadring should bring you close to the actual error. The exception printed at the end of the log can be ignored and is only a side-effect of the earlier failure.

@cmnrd
Copy link
Collaborator

cmnrd commented Jul 12, 2022

Oh, I found the log. Here is the relavant bit:

2022-07-11T21:20:52.7206232Z [2022-07-11 21:20:52,720][run_benchmark][INFO] - run command: /home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc --runtime-version master --external-runtime-path /home/runner/work/lingua-franca/lingua-franca/reactor-cpp/install src/micro/ThreadRing.lf
2022-07-11T21:20:54.0783712Z [2022-07-11 21:20:54,076][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 1    [main] ERROR text.validation.CompositeEValidator  - Error executing EValidator
2022-07-11T21:20:54.0785331Z [2022-07-11 21:20:54,077][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - org.lflang.generator.InvalidSourceException: Multiple ports with variable width on a connection.
2022-07-11T21:20:54.0787018Z [2022-07-11 21:20:54,077][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.lflang.ASTUtils.inferWidthFromConnections(ASTUtils.java:1841)
2022-07-11T21:20:54.0787772Z [2022-07-11 21:20:54,077][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.lflang.ASTUtils.width(ASTUtils.java:1454)
2022-07-11T21:20:54.0788537Z [2022-07-11 21:20:54,077][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.lflang.generator.ReactorInstance.setInitialWidth(ReactorInstance.java:1101)
2022-07-11T21:20:54.0789634Z [2022-07-11 21:20:54,077][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.lflang.generator.ReactorInstance.<init>(ReactorInstance.java:782)
2022-07-11T21:20:54.0790446Z [2022-07-11 21:20:54,077][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.lflang.generator.ReactorInstance.<init>(ReactorInstance.java:804)
2022-07-11T21:20:54.0791463Z [2022-07-11 21:20:54,077][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.lflang.generator.ReactorInstance.<init>(ReactorInstance.java:91)
2022-07-11T21:20:54.0792266Z [2022-07-11 21:20:54,077][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.lflang.ModelInfo.update(ModelInfo.java:120)
2022-07-11T21:20:54.0793086Z [2022-07-11 21:20:54,077][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.lflang.validation.LFValidator.checkModel(LFValidator.java:570)
2022-07-11T21:20:54.0794011Z [2022-07-11 21:20:54,077][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2022-07-11T21:20:54.0795018Z [2022-07-11 21:20:54,077][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
2022-07-11T21:20:54.0796114Z [2022-07-11 21:20:54,077][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2022-07-11T21:20:54.0797417Z [2022-07-11 21:20:54,077][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
2022-07-11T21:20:54.0798473Z [2022-07-11 21:20:54,077][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.xtext.validation.AbstractDeclarativeValidator$MethodWrapper.invoke(AbstractDeclarativeValidator.java:129)
2022-07-11T21:20:54.0799697Z [2022-07-11 21:20:54,077][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.xtext.validation.AbstractDeclarativeValidator.internalValidate(AbstractDeclarativeValidator.java:337)
2022-07-11T21:20:54.0800894Z [2022-07-11 21:20:54,077][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.xtext.validation.AbstractInjectableValidator.validate(AbstractInjectableValidator.java:72)
2022-07-11T21:20:54.0802100Z [2022-07-11 21:20:54,077][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.xtext.validation.CompositeEValidator.validate(CompositeEValidator.java:151)
2022-07-11T21:20:54.0803072Z [2022-07-11 21:20:54,077][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.emf.ecore.util.Diagnostician.doValidate(Diagnostician.java:257)
2022-07-11T21:20:54.0803992Z [2022-07-11 21:20:54,077][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:244)
2022-07-11T21:20:54.0805002Z [2022-07-11 21:20:54,077][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.xtext.validation.CancelableDiagnostician.validate(CancelableDiagnostician.java:41)
2022-07-11T21:20:54.0805993Z [2022-07-11 21:20:54,077][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:201)
2022-07-11T21:20:54.0806904Z [2022-07-11 21:20:54,077][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:143)
2022-07-11T21:20:54.0807899Z [2022-07-11 21:20:54,077][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.xtext.validation.ResourceValidatorImpl.validate(ResourceValidatorImpl.java:147)
2022-07-11T21:20:54.0808948Z [2022-07-11 21:20:54,077][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.xtext.validation.ResourceValidatorImpl.validate(ResourceValidatorImpl.java:125)
2022-07-11T21:20:54.0810097Z [2022-07-11 21:20:54,078][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.xtext.validation.ResourceValidatorImpl.validate(ResourceValidatorImpl.java:91)
2022-07-11T21:20:54.0811008Z [2022-07-11 21:20:54,078][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.lflang.lfc.Main.getValidatedResource(Main.java:342)
2022-07-11T21:20:54.0811782Z [2022-07-11 21:20:54,078][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.lflang.lfc.Main.runGenerator(Main.java:284)
2022-07-11T21:20:54.0813368Z [2022-07-11 21:20:54,078][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.lflang.lfc.Main.main(Main.java:222)
2022-07-11T21:20:54.1374254Z [2022-07-11 21:20:54,136][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 63   [main] ERROR text.validation.CompositeEValidator  - Error executing EValidator
2022-07-11T21:20:54.1375165Z [2022-07-11 21:20:54,136][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - org.lflang.generator.InvalidSourceException: Multiple ports with variable width on a connection.
2022-07-11T21:20:54.1376120Z [2022-07-11 21:20:54,136][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.lflang.ASTUtils.inferWidthFromConnections(ASTUtils.java:1841)
2022-07-11T21:20:54.1376926Z [2022-07-11 21:20:54,136][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.lflang.ASTUtils.width(ASTUtils.java:1454)
2022-07-11T21:20:54.1377664Z [2022-07-11 21:20:54,136][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.lflang.ASTUtils.inferPortWidth(ASTUtils.java:1511)
2022-07-11T21:20:54.1378510Z [2022-07-11 21:20:54,136][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.lflang.validation.LFValidator.checkConnection(LFValidator.java:278)
2022-07-11T21:20:54.1379408Z [2022-07-11 21:20:54,136][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2022-07-11T21:20:54.1380378Z [2022-07-11 21:20:54,136][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
2022-07-11T21:20:54.1381640Z [2022-07-11 21:20:54,136][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2022-07-11T21:20:54.1382558Z [2022-07-11 21:20:54,136][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
2022-07-11T21:20:54.1383511Z [2022-07-11 21:20:54,136][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.xtext.validation.AbstractDeclarativeValidator$MethodWrapper.invoke(AbstractDeclarativeValidator.java:129)
2022-07-11T21:20:54.1384882Z [2022-07-11 21:20:54,136][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.xtext.validation.AbstractDeclarativeValidator.internalValidate(AbstractDeclarativeValidator.java:337)
2022-07-11T21:20:54.1386149Z [2022-07-11 21:20:54,136][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.xtext.validation.AbstractInjectableValidator.validate(AbstractInjectableValidator.java:72)
2022-07-11T21:20:54.1387306Z [2022-07-11 21:20:54,136][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.xtext.validation.CompositeEValidator.validate(CompositeEValidator.java:151)
2022-07-11T21:20:54.1388359Z [2022-07-11 21:20:54,136][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.emf.ecore.util.Diagnostician.doValidate(Diagnostician.java:257)
2022-07-11T21:20:54.1389365Z [2022-07-11 21:20:54,136][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:244)
2022-07-11T21:20:54.1390622Z [2022-07-11 21:20:54,136][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.xtext.validation.CancelableDiagnostician.validate(CancelableDiagnostician.java:41)
2022-07-11T21:20:54.1391700Z [2022-07-11 21:20:54,136][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:201)
2022-07-11T21:20:54.1392786Z [2022-07-11 21:20:54,136][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:143)
2022-07-11T21:20:54.1393732Z [2022-07-11 21:20:54,136][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.xtext.validation.ResourceValidatorImpl.validate(ResourceValidatorImpl.java:147)
2022-07-11T21:20:54.1394727Z [2022-07-11 21:20:54,137][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.xtext.validation.ResourceValidatorImpl.validate(ResourceValidatorImpl.java:125)
2022-07-11T21:20:54.1395781Z [2022-07-11 21:20:54,137][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.xtext.validation.ResourceValidatorImpl.validate(ResourceValidatorImpl.java:91)
2022-07-11T21:20:54.1396651Z [2022-07-11 21:20:54,137][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.lflang.lfc.Main.getValidatedResource(Main.java:342)
2022-07-11T21:20:54.1397313Z [2022-07-11 21:20:54,137][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.lflang.lfc.Main.runGenerator(Main.java:284)
2022-07-11T21:20:54.1398140Z [2022-07-11 21:20:54,137][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.lflang.lfc.Main.main(Main.java:222)
2022-07-11T21:20:54.1411545Z [2022-07-11 21:20:54,139][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 66   [main] ERROR text.validation.CompositeEValidator  - Error executing EValidator
2022-07-11T21:20:54.1412652Z [2022-07-11 21:20:54,140][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - org.lflang.generator.InvalidSourceException: Multiple ports with variable width on a connection.
2022-07-11T21:20:54.1413673Z [2022-07-11 21:20:54,140][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.lflang.ASTUtils.inferWidthFromConnections(ASTUtils.java:1841)
2022-07-11T21:20:54.1414756Z [2022-07-11 21:20:54,140][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.lflang.ASTUtils.width(ASTUtils.java:1454)
2022-07-11T21:20:54.1415641Z [2022-07-11 21:20:54,140][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.lflang.ASTUtils.inferPortWidth(ASTUtils.java:1511)
2022-07-11T21:20:54.1416591Z [2022-07-11 21:20:54,140][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.lflang.validation.LFValidator.checkConnection(LFValidator.java:278)
2022-07-11T21:20:54.1417617Z [2022-07-11 21:20:54,140][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2022-07-11T21:20:54.1418742Z [2022-07-11 21:20:54,140][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
2022-07-11T21:20:54.1419754Z [2022-07-11 21:20:54,140][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2022-07-11T21:20:54.1420627Z [2022-07-11 21:20:54,140][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
2022-07-11T21:20:54.1421587Z [2022-07-11 21:20:54,140][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.xtext.validation.AbstractDeclarativeValidator$MethodWrapper.invoke(AbstractDeclarativeValidator.java:129)
2022-07-11T21:20:54.1422807Z [2022-07-11 21:20:54,140][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.xtext.validation.AbstractDeclarativeValidator.internalValidate(AbstractDeclarativeValidator.java:337)
2022-07-11T21:20:54.1423934Z [2022-07-11 21:20:54,140][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.xtext.validation.AbstractInjectableValidator.validate(AbstractInjectableValidator.java:72)
2022-07-11T21:20:54.1424969Z [2022-07-11 21:20:54,140][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.xtext.validation.CompositeEValidator.validate(CompositeEValidator.java:151)
2022-07-11T21:20:54.1425896Z [2022-07-11 21:20:54,140][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.emf.ecore.util.Diagnostician.doValidate(Diagnostician.java:257)
2022-07-11T21:20:54.1426775Z [2022-07-11 21:20:54,140][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:244)
2022-07-11T21:20:54.1427800Z [2022-07-11 21:20:54,140][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.xtext.validation.CancelableDiagnostician.validate(CancelableDiagnostician.java:41)
2022-07-11T21:20:54.1428621Z [2022-07-11 21:20:54,140][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:201)
2022-07-11T21:20:54.1429575Z [2022-07-11 21:20:54,140][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:143)
2022-07-11T21:20:54.1430683Z [2022-07-11 21:20:54,140][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.xtext.validation.ResourceValidatorImpl.validate(ResourceValidatorImpl.java:147)
2022-07-11T21:20:54.1431823Z [2022-07-11 21:20:54,140][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.xtext.validation.ResourceValidatorImpl.validate(ResourceValidatorImpl.java:125)
2022-07-11T21:20:54.1432957Z [2022-07-11 21:20:54,140][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.eclipse.xtext.validation.ResourceValidatorImpl.validate(ResourceValidatorImpl.java:91)
2022-07-11T21:20:54.1433944Z [2022-07-11 21:20:54,140][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.lflang.lfc.Main.getValidatedResource(Main.java:342)
2022-07-11T21:20:54.1434872Z [2022-07-11 21:20:54,140][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.lflang.lfc.Main.runGenerator(Main.java:284)
2022-07-11T21:20:54.1435694Z [2022-07-11 21:20:54,140][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.lflang.lfc.Main.main(Main.java:222)
2022-07-11T21:20:54.1473571Z [2022-07-11 21:20:54,145][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - �[1mlfc: �[0m�[1;31mfatal error: �[0m�[1mAn unexpected error occurred:�[0m
2022-07-11T21:20:54.1474646Z [2022-07-11 21:20:54,145][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - java.lang.NullPointerException: Cannot invoke "org.eclipse.emf.common.util.URI.isPlatform()" because "uri" is null
2022-07-11T21:20:54.1475681Z [2022-07-11 21:20:54,145][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.lflang.util.FileUtil.toIPath(FileUtil.java:85)
2022-07-11T21:20:54.1476588Z [2022-07-11 21:20:54,145][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.lflang.util.FileUtil.toPath(FileUtil.java:68)
2022-07-11T21:20:54.1477388Z [2022-07-11 21:20:54,146][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.lflang.lfc.Main.getValidatedResource(Main.java:350)
2022-07-11T21:20:54.1478264Z [2022-07-11 21:20:54,146][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.lflang.lfc.Main.runGenerator(Main.java:284)
2022-07-11T21:20:54.1478896Z [2022-07-11 21:20:54,146][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - 	at org.lflang.lfc.Main.main(Main.java:222)

Indeed there is a lot of text printed. For some reason some benchmarks don't suppress info messages. Also oddly for some command many empty lines are printed. I will take a look.

Copy link
Collaborator

@edwardalee edwardalee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, OK, this looks like a better way to solve the problem, and the output @cmnrd found indicates that indeed the test failure was related to the change. The relevant line was this one:

2022-07-11T21:20:54.1375165Z [2022-07-11 21:20:54,136][/home/runner/work/lingua-franca/lingua-franca/lf/bin/lfc][INFO] - org.lflang.generator.InvalidSourceException: Multiple ports with variable width on a connection.

I need someone to show me how to read the "Checks" tab for a PR. I was unable to find any meaningful output at all in that tab. Clearly I am looking in the wrong place.

@cmnrd
Copy link
Collaborator

cmnrd commented Jul 12, 2022

In the meantime I pushed a fix to the benchmarks repo which should reduce the noise in the benchmark logs (in particular the C++ logs). (See lf-lang/benchmarks-lingua-franca#27).

In this particular case, the log for the c++ benchmarks here did not contain the problem. So probably this is why you did not find it. Note the last line stating:

This step has been truncated due to its large size. Download the full logs from the menu once the workflow run has completed.

I clicked in the gear in the top-right and then on "View raw logs" to see the full log. Then I searched the raw log. With the fix in lf-lang/benchmarks-lingua-franca#27, the log should get much smaller and you should be able to search directly in GitHub's log view. Note that searching only works properly with the built-in search tool and not with you browser's search.

@cmnrd cmnrd merged commit b624dc8 into master Jul 12, 2022
@cmnrd cmnrd deleted the runtime-range branch July 12, 2022 11:27
@hokeun
Copy link
Member Author

hokeun commented Jul 12, 2022

Thank you, @edwardalee and @cmnrd, for your reviews and great discussion!

the output @cmnrd found indicates that indeed the test failure was related to the change. The relevant line was this one:

I think you're right. The previous version of the fix did cause that error to happen, so I carefully crafted the second version to avoid changes that can affect currently working LF programs. Luckily, the modified version of the fix did not affect the existing tests.

In the meantime I pushed a fix to the benchmarks repo which should reduce the noise in the benchmark logs

Sounds great. This should help us look into the error logs. Thanks!

@lhstrh lhstrh added the bugfix label Jul 20, 2022
@lhstrh lhstrh changed the title Fixed issue with ASTUtils width() returnning -1 even when the width can be inferred from connections Fix for ASTUtils.width() returnning -1 even when the width can be inferred from connections Jul 20, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants