modula3 / cm3

Critical Mass Modula-3
http://modula3.github.io/cm3/
Other
133 stars 26 forks source link

cm3 compiler crashes #1039

Open zbloska opened 2 years ago

zbloska commented 2 years ago

Hi, Critical Mass Modula-3 version d5.11.4 AMD64_LINUX When I try to compile, compiler crashes with message:

Assertion failure: bit_size = 8 OR bit_size = 16 OR bit_size = 32


runtime error: <ASSERT> failed: value *** file "../src/M3C.m3", line 674


Aborted (core dumped) called in M3C.m3 line 3393

So, I have added "OR bit_size = 64" in procedure declare_enum, line 3393 of M3C.m3, and recompiled compiler. And now I have:

Assertion failure: element_count > 0


runtime error: <ASSERT> failed: value *** file "../src/M3C.m3", line 674


Aborted (core dumped) called in M3C.m3 line 3394

So, now I do not know what to do, because I am only average user of cm3. Thank You.

VictorMiasnikov commented 2 years ago

On 8/7/22 10:04, zbloska wrote:

Hi, Critical Mass Modula-3 version d5.11.4 AMD64_LINUX When I try to compile, compiler crashes with message:

Assertion failure: bit_size = 8 OR bit_size = 16 OR bit_size = 32


runtime error: </ASSERT/> failed: value *** file "../src/M3C.m3", line 674


Aborted (core dumped) called in M3C.m3 line 3393

So, I have added "OR bit_size = 64" in procedure declare_enum, line 3393 of M3C.m3, and recompiled compiler. And now I have:

Assertion failure: element_count > 0


runtime error: </ASSERT/> failed: value *** file "../src/M3C.m3", line 674


Aborted (core dumped) called in M3C.m3 line 3394

So, now I do not know what to do, because I am only average user of cm3. Thank You.

Is this: https://github.com/VictorMiasnikov/cm3/releases/tag/d5.11.9-ZZYYXX-20220208_13-48 affected too?

RodneyBates commented 2 years ago

These failures are occurring in the C backend.  As a temporary workaround, you could try one of the other back ends.

Jay?

On 8/7/22 10:04, zbloska wrote:

Hi, Critical Mass Modula-3 version d5.11.4 AMD64_LINUX When I try to compile, compiler crashes with message:

Assertion failure: bit_size = 8 OR bit_size = 16 OR bit_size = 32


runtime error: </ASSERT/> failed: value *** file "../src/M3C.m3", line 674


Aborted (core dumped) called in M3C.m3 line 3393

So, I have added "OR bit_size = 64" in procedure declare_enum, line 3393 of M3C.m3, and recompiled compiler. And now I have:

Assertion failure: element_count > 0


runtime error: </ASSERT/> failed: value *** file "../src/M3C.m3", line 674


Aborted (core dumped) called in M3C.m3 line 3394

So, now I do not know what to do, because I am only average user of cm3. Thank You.

— Reply to this email directly, view it on GitHub https://github.com/modula3/cm3/issues/1039, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSVZNBNOXI2NTAN3R5EG7TVX7GBFANCNFSM552TMWXA. You are receiving this because you are subscribed to this thread.Message ID: @.***>

VictorMiasnikov commented 2 years ago

There are good news: "my cm3 5.X" cm3-all AMD64_LINUX don't use C backend. ( I am not "issue creator")

https://github.com/VictorMiasnikov/cm3/releases/download/d5.11.9-ZZYYXX-20220208_13-48/cm3-all_by_.concierge.py__full-upgrade__all.-AMD64_LINUX-d5.11.9-AMD64_LINUX.Debian_11.3.0-1_and_.GCC_11.3.0.-2022-02-08_13-48__FIXed__by__VVM__2022-05-18_14-06__AMD64_LINUX__Target__cm3-3be819e.deb

VictorMiasnikov commented 2 years ago

a-la P.S.

"But:"

a) This file cm3-allby.concierge.pyfull-upgradeall.-AMD64_LINUX-d5.11.9-AMD64_LINUX.Debian_11.3.0-1and.GCC_11.3.0.-2022-02-08_13-48FIXedbyVVM2022-05-18_14-06__AMD64_LINUXTargetcm3-3be819e.deb

is good

b) but I have error in case building cm3 by another way:

== package /usr/local/cm3/cm3/m3-libs/m3core ==

 +++ /usr/local/cm3/bin/cm3   -DBUILD_DIR=AMD64_LINUX   -build -DROOT=/usr/local/cm3/cm3 -DTARGET=AMD64_LINUX +++

***
*** runtime error:
***    Segmentation violation - possible attempt to dereference NIL
***    pc = 0x7b2875 = Length + 0x6c in ../src/text/Text.m3
***

Aborted
 *** execution of [<function _BuildGlobalFunction at 0x7f40e6c805d0>, <function _ShipFunction at 0x7f40e6559d50>] failed ***

Are there need more details?

P.S. Some debugging:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/cm3/bin# gdb ./cm3
GNU gdb (Debian 11.2-1) 11.2
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
   . . .
This GDB was configured as "x86_64-linux-gnu".
  . . .
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./cm3...
(gdb) r
Starting program: /usr/local/cm3/bin/cm3
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
Text__Length (t_L_76=0x7fffffffdf40 "\031") at ../src/text/Text.m3:18
18      ../src/text/Text.m3: No such file or directory.
(gdb) q
A debugging session is active.

        Inferior 1 [process 58753] will be killed.

Quit anyway? (y or n) y
------------------------------------------------------------------------------
RodneyBates commented 2 years ago

This is very probably a NIL text passed to something in Text.m3. Can you get a backtrace?  The problem is likely farther up in the call chain.

On 8/9/22 02:44, VictorMiasnikov wrote:

a-la P.S.

"But:"

a) This file cm3-allby.concierge.pyfull-upgradeall.-AMD64_LINUX-d5.11.9-AMD64_LINUX.Debian_11.3.0-1and.GCC_11.3.0.-2022-02-08_13-48FIXedbyVVM2022-05-18_14-06AMD64_LINUXTargetcm3-3be819e.deb <https://github.com/VictorMiasnikov/cm3/releases/download/d5.11.9-ZZYYXX-20220208_13-48/cm3-all_by_.concierge.pyfull-upgradeall.-AMD64_LINUX-d5.11.9-AMD64_LINUX.Debian_11.3.0-1and.GCC_11.3.0.-2022-02-08_13-48FIXedbyVVM2022-05-18_14-06AMD64_LINUXTargetcm3-3be819e.deb>

is good

b) but I have error in case building cm3 by another way:

|== package /usr/local/cm3/cm3/m3-libs/m3core == +++ /usr/local/cm3/bin/cm3 -DBUILD_DIR=AMD64_LINUX -build -DROOT=/usr/local/cm3/cm3 -DTARGET=AMD64_LINUX +++ runtime error: Segmentation violation - possible attempt to dereference NIL pc = 0x7b2875 = Length + 0x6c in ../src/text/Text.m3 Aborted execution of [<function _BuildGlobalFunction at 0x7f40e6c805d0>, <function _ShipFunction at 0x7f40e6559d50>] failed *** |

Are there need more details?

— Reply to this email directly, view it on GitHub https://github.com/modula3/cm3/issues/1039#issuecomment-1209030147, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSVZNEMZQWRT4Z47FIOXFTVYID5ZANCNFSM552TMWXA. You are receiving this because you commented.Message ID: @.***>

RodneyBates commented 2 years ago

This looks like it is being given an empty enumeration type, packed with 64 bits, like:

  BITS 64 FOR {}

This is legal Modula-3, and the front end I am running has no problem with it. (But declaring a variable of this type is not legal, giving a compile-time error.)

M3C should handle it.

What code are you trying to compile?  Can you provide it?  The maintainer of M3C has not weighed in on this, but I am looking at it.

On 8/7/22 10:04, zbloska wrote:

Hi, Critical Mass Modula-3 version d5.11.4 AMD64_LINUX When I try to compile, compiler crashes with message:

Assertion failure: bit_size = 8 OR bit_size = 16 OR bit_size = 32


runtime error: </ASSERT/> failed: value *** file "../src/M3C.m3", line 674


Aborted (core dumped) called in M3C.m3 line 3393

So, I have added "OR bit_size = 64" in procedure declare_enum, line 3393 of M3C.m3, and recompiled compiler. And now I have:

Assertion failure: element_count > 0


runtime error: </ASSERT/> failed: value *** file "../src/M3C.m3", line 674


Aborted (core dumped) called in M3C.m3 line 3394

So, now I do not know what to do, because I am only average user of cm3. Thank You.

— Reply to this email directly, view it on GitHub https://github.com/modula3/cm3/issues/1039, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSVZNBNOXI2NTAN3R5EG7TVX7GBFANCNFSM552TMWXA. You are receiving this because you are subscribed to this thread.Message ID: @.***>

VictorMiasnikov commented 2 years ago

 I can ( I hope) public related binary and logs on Github

 (  In any key, I already have worked variant of cm3 )

P.S. 2022-08-15 DoNe:

Please, see file: https://github.com/VictorMiasnikov/cm3/releases/download/d5.11.4-ZZYYXX-20211119_17-16_221e0eb/_Bad._a-la_cm3-all_Step_C_cm3_v5.11.9-ZZYYXX-20220208.13-48_Era_VVM_P-_Linux_Debian_12.X--ZZZ_._Step_3.0a2_.7z

Pass:

AV

09.08.2022, 18:24, "Rodney M. Bates" @.***>: This is very probably a NIL text passed to something in Text.m3. Can you get a backtrace?  The problem is likely farther up in the call chain.

On 8/9/22 02:44, VictorMiasnikov wrote:

a-la P.S.

"But:"

a) This file cm3-allby.concierge.pyfull-upgradeall.-AMD64_LINUX-d5.11.9-AMD64_LINUX.Debian_11.3.0-1and.GCC_11.3.0.-2022-02-08_13-48FIXedbyVVM2022-05-18_14-06__AMD64_LINUXTargetcm3-3be819e.deb >> is good

b) but I have error in case building cm3 by another way:

|== package /usr/local/cm3/cm3/m3-libs/m3core == +++ /usr/local/cm3/bin/cm3 -DBUILD_DIR=AMD64_LINUX -build -DROOT=/usr/local/cm3/cm3 -DTARGET=AMD64_LINUX +++ runtime error: Segmentation violation - possible attempt to dereference NIL pc = 0x7b2875 = Length + 0x6c in ../src/text/Text.m3 Aborted execution of [<function _BuildGlobalFunction at 0x7f40e6c805d0>, <function _ShipFunction at 0x7f40e6559d50>] failed *** |

Are there need more details?

zbloska commented 1 year ago

On Mon, 2022-08-08 at 01:43 -0700, VictorMiasnikov wrote:

Is this: https://github.com/VictorMiasnikov/cm3/releases/tag/d5.11.9-ZZYYXX-20220208_13-48 affected too?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

Yes, this same error during compilation.

Critical Mass Modula-3 version d5.11.9 AMD64_LINUX, Ubuntu 20.04

I could not use your binaries, because they required glibc v. 2.33 and I have version 2.31. So, I recompiled cm3-d5.11.9-ZZYYXX-20220208_13-48 from the source

And again compiler crashes with message:

===================================== Assertion failure: bit_size = 8 OR bit_size = 16 OR bit_size = 32


runtime error: <ASSERT> failed: value *** file "../src/M3C.m3", line 673


Aborted (core dumped)

=======================================

So, I have added "OR bit_size = 64" in procedure declare_enum, line 3390 of M3C.m3:

Assert (x, bit_size = 8 OR bit_size = 16 OR bit_size = 32 OR bit_size = 64, "bit_size = 8 OR bit_size = 16 OR bit_size = 32 OR bit_size = 64");

and recompiled compiler, as I have done in case of 5.11.4.

And now I have this same error:

Assertion failure: element_count > 0


runtime error: <ASSERT> failed: value *** file "../src/M3C.m3", line 673


Aborted (core dumped)

=======================================

I hope, that this will help You somehow with debugging.

zbylo

VictorMiasnikov commented 1 year ago

Please edit 1-st message of this topic by select text and press Ctrl+E a-la this:

Line1

as HEX code

60 60 60 0A 4C 69 6E 65 31 0A 60 60 60           ◙Line1◙
VictorMiasnikov commented 1 year ago

On Mon, 2022-08-08 at 01:43 -0700, VictorMiasnikov wrote: Is this: https://github.com/VictorMiasnikov/cm3/releases/tag/d5.11.9-ZZYYXX-20220208_13-48 affected too?

Yes, this same error during compilation.

Critical Mass Modula-3 version d5.11.9 AMD64_LINUX, Ubuntu 20.04

I could not use your binaries, because they required glibc v. 2.33 and I have version 2.31. So, I recompiled cm3-d5.11.9-ZZYYXX-20220208_13-48 from the source

And again compiler crashes with message:

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = Assertion failure: bit_size = 8 OR bit_size = 16 OR bit_size = 32


runtime error: <ASSERT> failed: value *** file "../src/M3C.m3", line 673


Aborted (core dumped)

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

So, I have added "OR bit_size = 64" in procedure declare_enum, line 3390 of M3C.m3:

Assert (x, bit_size = 8 OR bit_size = 16 OR bit_size = 32 OR bit_size = 64, "bit_size = 8 OR bit_size = 16 OR bit_size = 32 OR bit_size = 64");

and recompiled compiler, as I have done in case of 5.11.4.

And now I have this same error: = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = Assertion failure: element_count > 0


runtime error: <ASSERT> failed: value *** file "../src/M3C.m3", line 673


Aborted (core dumped)

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

I hope, that this will help You somehow with debugging.

zbylo

0) Please use as "source code" part this commit https://github.com/VictorMiasnikov/cm3/archive/refs/tags/d5.11.9-ZZYYXX-20220208_13-48.tar.gz

Unpack it to folder /usr/local/cm3/cm3/

1) Download this file https://github.com/VictorMiasnikov/cm3/releases/download/d5.11.9-ZZYYXX-20220208_13-48/cm3-boot-AMD64_LINUX-d5.11.9-20220520_1519.tar.xz

unpack to any folder.

Run make

2)

Place resulted file cm3 to folder /usr/local/cm3/bin

3) Run:

/# cd /usr/local/cm3/cm3/scripts/python
/usr/local/cm3/cm3/scripts/python# export PATH=/usr/local/cm3/bin:$PATH
/usr/local/cm3/cm3/scripts/python# ./boot2min.py c
/usr/local/cm3/cm3/scripts/python# python do-cm3-all.py buildship
zbloska commented 1 year ago

On Tue, 2022-10-11 at 02:59 -0700, VictorMiasnikov wrote:

On Mon, 2022-08-08 at 01:43 -0700, VictorMiasnikov wrote: Is this: https://github.com/VictorMiasnikov/cm3/releases/tag/d5.11.9-ZZYYXX-20220208_13-48 affected too?

Yes, this same error during compilation.

Critical Mass Modula-3 version d5.11.9 AMD64_LINUX, Ubuntu 20.04

I could not use your binaries, because they required glibc v. 2.33 and I have version 2.31. So, I recompiled cm3-d5.11.9-ZZYYXX-20220208_13-48 from the source

And again compiler crashes with message:

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = Assertion failure: bit_size = 8 OR bit_size = 16 OR bit_size = 32

runtime error: failed: value *** file "../src/M3C.m3", line 673

Aborted (core dumped)

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

So, I have added "OR bit_size = 64" in procedure declare_enum, line 3390 of M3C.m3:

Assert (x, bit_size = 8 OR bit_size = 16 OR bit_size = 32 OR bit_size = 64, "bit_size = 8 OR bit_size = 16 OR bit_size = 32 OR bit_size = 64");

and recompiled compiler, as I have done in case of 5.11.4.

And now I have this same error: = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = Assertion failure: element_count > 0

runtime error: failed: value *** file "../src/M3C.m3", line 673

Aborted (core dumped)

= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =

I hope, that this will help You somehow with debugging.

zbylo

0) Please use as "source code" part this commit https://github.com/VictorMiasnikov/cm3/archive/refs/tags/d5.11.9-ZZYYXX-20220208_13-48.tar.gz

Unpack it to folder /usr/local/cm3/cm3/

Done

1) Download this file https://github.com/VictorMiasnikov/cm3/releases/download/d5.11.9-ZZYYXX-20220208_13-48/cm3-boot-AMD64_LINUX-d5.11.9-20220520_1519.tar.xz

unpack to any folder.

Run make

Done (with several warnings)

2)

Place resulted file cm3 to folder /usr/local/cm3/bin

Done

3) Run:

/# cd /usr/local/cm3/cm3/scripts/python /usr/local/cm3/cm3/scripts/python# export PATH=/usr/local/cm3/bin:$PATH /usr/local/cm3/cm3/scripts/python# ./boot2min.py c /usr/local/cm3/cm3/scripts/python# python do-cm3-all.py buildship —

Done (with several warnings but with success)

Now cm3 signals errors in compiled code as it should, but not in the compiler itself. Hope this will end this problem. If I run into another bug, I'll let you know.

Satisfied zbylo.

Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

VictorMiasnikov commented 1 year ago

} Hope this will end this problem.

I hope too

} If I run into another bug, I'll let you know.

No problem! -) Thank You