8000 illegal recursive declaration crashes frontend · Issue #1109 · modula3/cm3 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

illegal recursive declaration crashes frontend #1109

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

Open
demoitem opened this issue Oct 18, 2022 · 17 comments
Open

illegal recursive declaration crashes frontend #1109

demoitem opened this issue Oct 18, 2022 · 17 comments

Comments

@demoitem
Copy link
Contributor

This code from e019
CONST
N = N + 1l;

causes a segv in the frontend from a stack overflow caused
(ironically) by infinite recursion between Expr.RepTypeOf
and AddExpr.RepTypeOf
similar segv for N - 1, N * 1, N DIV 1 but strangely
not N MOD 1

@RodneyBates
Copy link
Contributor
RodneyBates commented Oct 18, 2022 via email

@demoitem
Copy link
Contributor Author
demoitem commented Oct 19, 2022 via email

@VictorMiasnikov
Copy link
Contributor

( . . .) This works OK for me, using the compiler in branch rodney-new. I was under the belief that everything in rodney-new was merged and pushed into master on github.  I'll look into getting things merged. By "works", I mean produces the compile error, but no segfault.

In short: please do it ( merge)

Thank!

@VictorMiasnikov
Copy link
Contributor
VictorMiasnikov commented Oct 19, 2022

(

a-la P.S.

No worries

Why?

"branch rodney-new" tested as part of 2-3 latest releases with good results.

VictorMiasnikov@a5580bd
=}
https://github.com/VictorMiasnikov/cm3/actions/runs/3274227685

)

@VictorMiasnikov
Copy link
Contributor
VictorMiasnikov commented Oct 19, 2022

I have had merge problems of my own in the past.
While you are at it, have a look at e020. It compiles but crashes.
The stderr.pgm file suggests it should produce a runtime
error - invalid cycle in super types.

I.e. before "merge branch rodney-new" we have:

844d77c
(
https://github.com/modula3/cm3/commit/844d77c22fe7845d0e0b0df4f8ebcc857594627a
)

https://github.com/modula3/cm3/actions/runs/3231157773
2022-10-12T01:06:46.2343570Z

--- e020 --- illegal recursive declaration
cd ../src/e0/e020 && cm3 -silent -DM3TESTS  >AMD64_DARWIN/stdout.build.raw 2>AMD64_DARWIN/stderr.build.raw
--- ../src/e0/e020/stdout.build	2022-10-12 00:36:07.000000000 +0000
+++ ../src/e0/e020/AMD64_DARWIN/stdout.build	2022-10-12 01:06:46.000000000 +0000
@@ -1 +0,0 @@
-Fatal Error: package build failed
--- ../src/e0/e020/stderr.build	2022-10-12 00:36:07.000000000 +0000
+++ ../src/e0/e020/AMD64_DARWIN/stderr.build	2022-10-12 01:06:46.000000000 +0000
@@ -0,0 +1 @@
+sh: line 1: 31473 Segmentation fault: 11  ./pgm > stdout.pgm.raw 2> stderr.pgm.raw

But after integration we have:

2022-10-18T14:42:54.2926734Z

--- e020 --- illegal recursive declaration
cd ../src/e0/e020 && cm3 -silent -DM3TESTS  >AMD64_LINUX/stdout.build.raw 2>AMD64_LINUX/stderr.build.raw

@VictorMiasnikov
Copy link
Contributor
VictorMiasnikov commented Oct 19, 2022

This code from e019
CONST
N = N + 1l;

causes a segv in the frontend from a stack overflow caused
(ironically) by infinite recursion between Expr.RepTypeOf
and AddExpr.RepTypeOf
similar segv for N - 1, N * 1, N DIV 1 but strangely
not N MOD 1

I.e. before:

2022-10-12T01:06:47.0713330Z
--- e019 --- illegal recursive declaration
cd ../src/e0/e019 && cm3 -silent -DM3TESTS  >AMD64_DARWIN/stdout.build.raw 2>AMD64_DARWIN/stderr.build.raw
sh: line 1: 31493 Segmentation fault: 11  cm3 -silent -DM3TESTS > AMD64_DARWIN/stdout.build.raw 2> AMD64_DARWIN/stderr.build.raw
--- ../src/e0/e019/stdout.build	2022-10-12 00:36:07.000000000 +0000
+++ ../src/e0/e019/AMD64_DARWIN/stdout.build	2022-10-12 01:06:47.000000000 +0000
@@ -1,5 +1 @@
 "../Main.m3", line 9: illegal recursive declaration (N)
-"../Main.m3", line 9: unsafe '+'
-"../Main.m3", line 9: value is not constant
-3 errors encountered
-Fatal Error: package build failed

After:

cd ../src/e0/e019 && cm3 -silent -DM3TESTS  >AMD64_LINUX/stdout.build.raw 2>AMD64_LINUX/stderr.build.raw
--- ../src/e0/e019/stdout.build	2022-10-18 14:34:14.867453360 +0000
+++ ../src/e0/e019/AMD64_LINUX/stdout.build	2022-10-18 14:42:55.101618323 +0000
@@ -1,3 +1 @@
-"../Main.m3", line 9: Illegal recursive declaration (2.4.8). (N)
-1 error encountered
-Fatal Error: package build failed
+"../Main.m3", line 9: illegal recursive declaration (N)
--- ../src/e0/e019/stderr.build	2022-10-18 14:34:14.867453360 +0000
+++ ../src/e0/e019/AMD64_LINUX/stderr.build	2022-10-18 14:42:55.101618323 +0000

P.S.

This looks like changing "error message" text:

-"../Main.m3", line 9: Illegal recursive declaration (2.4.8). (N)
+"../Main.m3", line 9: illegal recursive declaration (N)

@VictorMiasnikov
Copy link
Contributor
VictorMiasnikov commented Oct 19, 2022

P.P.S.

https://github.com/VictorMiasnikov/cm3/actions/runs/3279987990/jobs/5400217924

I386_NT  build (integrated)



--- e019 --- illegal recursive declaration
cd ../src/e0/e019 && cm3 -silent -DM3TESTS  >I386_NT/stdout.build.raw 2>I386_NT/stderr.build.raw
Comparing files ..\SRC\E0\E019\stdout.build and ..\SRC\E0\E019\I386_NT\STDOUT.BUILD
***** ..\SRC\E0\E019\stdout.build
"../Main.m3", line 9: Illegal recursive declaration (2.4.8). (N)
1 error encountered
Fatal Error: package build failed
***** ..\SRC\E0\E019\I386_NT\STDOUT.BUILD
"../Main.m3", line 9: illegal recursive declaration (2.4.8). (N)
*****

Comparing files ..\SRC\E0\E019\stderr.build and ..\SRC\E0\E019\I386_NT\STDERR.BUILD
***** ..\SRC\E0\E019\stderr.build
m3front failed compiling: ../Main.m3
***** ..\SRC\E0\E019\I386_NT\STDERR.BUILD


***
*** runtime error:
***    A runtime error occurred.
***    pc = 0x120b700 = Get + 0x9 in ../src/runtime/common/RTType.m3
***

Stack trace:
   FP         PC      Procedure
---------  ---------  -------------------------------
0x1e02fe8  0x1227cc4  SystemError + 0x64 in ../src/runtime/WIN32/RTSignal.m3
0x1e0300c  0x120b700  Get + 0x9 in ../src/runtime/common/RTType.m3
0x1e0302c  0x120b57a  IsSubtype + 0x2e in ../src/runtime/common/RTType.m3
0x1e03068  0x120ba48  ScanTypecase + 0x12c in ../src/runtime/common/RTType.m3
0x1e03094  0x110f323  Split + 0x20 in ../src/exprs/NamedExpr.m3
0x1e030c8  0x10f4e35  StripNamedCons + 0x33 in ../src/exprs/Expr.m3
0x1e030f8  0x10f303d  RepTypeOf + 0x1c in ../src/exprs/Expr.m3
0x1e03124  0x114fec0  RepTypeOf + 0x5d in ../src/exprs/AddExpr.m3
0x1e03154  0x10f30e1  RepTypeOf + 0xc0 in ../src/exprs/Expr.m3
0x1e03180  0x114fec0  RepTypeOf + 0x5d in ../src/exprs/AddExpr.m3
.........  .........  ... more frames ...
*****

The system cannot find the file specified.

+

https://github.com/VictorMiasnikov/cm3/actions/runs/3280163012/jobs/5400877203

AMD64_LINUX gcc

--- ../src/e0/e019/stdout.build	2022-10-19 08:59:44.623386187 +0000
+++ ../src/e0/e019/AMD64_LINUX/stdout.build	2022-10-19 09:14:29.163145789 +0000
@@ -1,3 +1 @@
 "../Main.m3", line 9: Illegal recursive declaration (2.4.8). (N)
-1
8000
 error encountered
-Fatal Error: package build failed
--- ../src/e0/e019/stderr.build	2022-10-19 08:59:44.623386187 +0000
+++ ../src/e0/e019/AMD64_LINUX/stderr.build	2022-10-19 09:14:29.163145789 +0000
@@ -1 +1 @@
-m3front failed compiling: ../Main.m3
+Segmentation fault

P.P.P.S.

"Combo branch":

https://github.com/VictorMiasnikov/cm3/releases/tag/d5.11.9-ZZYYXX-20221019_15-00

@RodneyBates
Copy link
Contributor
RodneyBates commented Oct 24, 2022 via email

@RodneyBates
Copy link
Contributor
RodneyBates commented Oct 24, 2022 via email

@demoitem
Copy link
Contributor Author
demoitem commented Oct 24, 2022 via email

@RodneyBates
Copy link
Contributor
RodneyBates commented Oct 24, 2022 via email

@demoitem
Copy link
Contributor Author
demoitem commented Oct 24, 2022 via email

@VictorMiasnikov
Copy link
Contributor
VictorMiasnikov commented Oct 25, 2022

Your local rodney-new should be in sync with the remote, so just
merge into master locally, then push. Are the CI testers making
changes to rodney-new? I'm not sure about remote merging.

As I known, only Rodney making changes in "rodney-new branch"

(

This whole CI thing might need examination. I get they are testing
on all architectures but as far as I can tell they are only using the C
backend whereas they should be testing other backends as well.
Also which branches do they test? Surely not all branches. How
would one get them to test a particular branch? And while we are at it,
I think a bit of judicious pruning of some of those github branches would be
beneficial.

Please re-post Your msg to issue N1102

)

@RodneyBates
Copy link
Contributor
RodneyBates commented Oct 26, 2022 via email

@demoitem
Copy link
Contributor Author
demoitem commented Oct 26, 2022 via email

@RodneyBates
Copy link
Contributor
RodneyBates commented Oct 27, 2022 via email

@VictorMiasnikov
Copy link
Contributor

It looks like, "it's time" to integrate rodney-new branch to master branch

Thank!
Best regards , Victor Miasnikov

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

3 participants
0