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

cm3 compiler crashes #1039

Open
zbloska opened this issue Aug 7, 2022 · 12 comments
Open

cm3 compiler crashes #1039

zbloska opened this issue Aug 7, 2022 · 12 comments

Comments

@zbloska
Copy link

zbloska commented Aug 7, 2022

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
Copy link
Contributor

VictorMiasnikov commented Aug 8, 2022

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
Copy link
Contributor

RodneyBates commented Aug 8, 2022 via email

@VictorMiasnikov
Copy link
Contributor

VictorMiasnikov commented Aug 9, 2022

a-la P.S.

"But:"

a) This file
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

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
Copy link
Contributor

RodneyBates commented Aug 9, 2022 via email

@RodneyBates
Copy link
Contributor

RodneyBates commented Aug 9, 2022 via email

@VictorMiasnikov
Copy link
Contributor

VictorMiasnikov commented Aug 9, 2022 via email

@zbloska
Copy link
Author

zbloska commented Oct 11, 2022 via email

@VictorMiasnikov
Copy link
Contributor

VictorMiasnikov commented Oct 11, 2022

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
Copy link
Contributor

VictorMiasnikov commented Oct 11, 2022

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
Copy link
Author

zbloska commented Oct 11, 2022 via email

@VictorMiasnikov
Copy link
Contributor

} Hope this will end this problem.

I hope too

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

No problem! -) Thank You

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