public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ro at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug modula2/101392] New: cc1gm2 -fdump-system-exports SEGV on Solaris/SPARC
Date: Fri, 09 Jul 2021 12:34:19 +0000	[thread overview]
Message-ID: <bug-101392-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101392

            Bug ID: 101392
           Summary: cc1gm2 -fdump-system-exports SEGV on Solaris/SPARC
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: modula2
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ro at gcc dot gnu.org
                CC: gaiusmod2 at gmail dot com
  Target Milestone: ---
            Target: sparc-sun-solaris2.11

The devel/modula-2 build on Solaris/SPARC finally breaks down like this:

sh /vol/gcc/src/git/modula-2/gcc/m2/tools-src/makeSystem -fpim \
             /vol/gcc/src/git/modula-2/gcc/m2/gm2-libs/SYSTEM.def \
             /vol/gcc/src/git/modula-2/gcc/m2/gm2-libs/SYSTEM.mod \
             -I/vol/gcc/src/git/modula-2/gcc/m2/gm2-libs \
             "/var/gcc/gcc-12.0.0-20210708/11.4-gm2/./gcc/gm2
-B/var/gcc/gcc-12.0.0-20210708/11.4-gm2/./gcc/"
/var/gcc/gcc-12.0.0-20210708/11.4-gm2/gcc/m2/gm2-libs/SYSTEM.def
gm2: internal compiler error: Segmentation Fault signal terminated program
cc1gm2

As an aside, it seems weird to hardcode sh here rather than using $(SHELL) as
set in the Makefile's.

The failing gm2 invocation is

/var/gcc/gcc-12.0.0-20210708/11.4-gm2/./gcc/gm2
-B/var/gcc/gcc-12.0.0-20210708/11.4-gm2/./gcc/ -fpim
-I/vol/gcc/src/git/modula-2/gcc/m2/gm2-libs -fno-m2-plugin -c
-fdump-system-exports /vol/gcc/src/git/modula-2/gcc/m2/gm2-libs/SYSTEM.mod -o
/dev/null
SYSTEM module creates type: LOC
SYSTEM module creates type: WORD
SYSTEM module creates type: BYTE
SYSTEM module creates type: ADDRESS
SYSTEM module creates type: INTEGER8
SYSTEM module creates type: INTEGER16
SYSTEM module creates type: INTEGER32
SYSTEM module creates type: INTEGER64
SYSTEM module creates type: CARDINAL8
SYSTEM module creates type: CARDINAL16
SYSTEM module creates type: CARDINAL32
SYSTEM module creates type: CARDINAL64
SYSTEM module creates type: WORD16
SYSTEM module creates type: WORD32
SYSTEM module creates type: WORD64
SYSTEM module creates type: BITSET8
SYSTEM module creates type: BITSET16
SYSTEM module creates type: BITSET32
SYSTEM module creates type: REAL32
SYSTEM module creates type: REAL64
SYSTEM module creates type: REAL128
SYSTEM module creates type: COMPLEX32
SYSTEM module creates type: COMPLEX64
SYSTEM module creates type: COMPLEX128
SYSTEM module creates type: CSIZE_T
SYSTEM module creates type: CSSIZE_T
gm2: internal compiler error: Segmentation Fault signal terminated program
cc1gm2

Running it with -v shows the cc1gm2 command line:

/var/gcc/gcc-12.0.0-20210708/11.4-gm2/./gcc/cc1gm2 -quiet -dumpdir /dev/
-dumpbase SYSTEM.mod -dumpbase-ext .mod -mcpu=v9 -version
-fobject-path=/vol/gcc/src/git/modula-2/gcc/m2/gm2-libs
-ftarget-ar=/usr/gnu/bin/ar -ftarget-ranlib=/usr/gnu/bin/ranlib -fpim
-fno-m2-plugin -fdump-system-exports
-fobject-path=/vol/gcc/src/git/modula-2/gcc/m2/gm2-libs
-ftarget-ar=/usr/gnu/bin/ar -ftarget-ranlib=/usr/gnu/bin/ranlib -fpim
-fno-m2-plugin -fdump-system-exports
-I/vol/gcc/src/git/modula-2/gcc/m2/gm2-libs
-I/usr/local/lib/gcc/sparc-sun-solaris2.11/12.0.0/m2/m2pim
/vol/gcc/src/git/modula-2/gcc/m2/gm2-libs/SYSTEM.mod -o SYSTEM.s

When I tried to add -save-temps instead of explicitly giving -o SYSTEM.s, I got

cc1gm2: fatal error: cannot open ‘/dev/SYSTEM.s’ for writing: No such device or
address

-dumpdir /dev/ is bogus, it seems.

Besides, most cc1gm2 options given twice!

I get the SEGV even with

cc1gm2 -quiet -fdump-system-exports -I
/vol/gcc/src/git/modula-2/gcc/m2/gm2-libs/SYSTEM.mod -o SYSTEM.s

  under gdb:

Thread 2 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1 (LWP 1)]
0xfeb51bb0 in strlen () from /lib/libc.so.1
(gdb) where
#0  0xfeb51bb0 in strlen () from /lib/libc.so.1
#1  0xfeb937fc in strdup () from /lib/libc.so.1
#2  0x017cbed4 in lrealpath ()
#3  0x017ca494 in canonical_filename_eq ()
#4  0x00c35fa8 in toplev::main(int, char**) ()
#5  0x0172379c in main ()

  running the full command and gdb:

SYSTEM module creates type: CSSIZE_T
cc1gm2:1:unrecognised symbol
cc1gm2:1:
cc1gm2:1: ^
cc1gm2:1:unrecognised symbol
cc1gm2:1:3: error: expecting one of: ‘IMPLEMENTATION’ ‘MODULE’ ‘DEFINITION’
    1 | ELF             Qdx   4���  
                                      4    ( 2 1      4  4       �   �         
                                �z�z         �z�z      '� �E         ��D��D    
 �  �         ��T��T       l  <      dd�P  ( (     �t �t      /usr/lib/ld.so.1 
  ���  um Pe���� Pe���� Pe���� Pe���� Pe���� Pe���
                                                   Pe���( Pf@��` Pp���| Pp����
Pq��� PqL��� PqT��� P@��� P�x��
                               P�T��( P���D P�8��` P�`��| P����� P����� P�|���
P� ��� P��� P���� P����( P�\��D P�d��T PĄ��d PĤ��t P����� P����� P���� P�T���
PŐ��D PŰ��� PȠ��� P�X��� P�\��� P� ��� P���� P�,��� P����� P��� P�h��� P�T���
P�T��
                                                                               
P����( P���D P�(��` P���| P�`��� P���� P���� P���� P� ��� P�p�� P����4 P����P
P�H��l P�X��| P�h��� P����� P���� P����� P�X��� P�h��
                                                    P����( P����D P����` P� ���
Q���� Q�� Q���$ Q��@ Q%���\ Q.���x QI���� QkP��� Qk���� Ql��� Ql��� Qm�� 
Qm���< Qt\��X Qv��t Qw���� Q{T��� Q{t�� Q{���0 Q{���L Q{���h Q{���, Q|@��H
Q|���d Q}���| Q~���� Q���� Q����� Q����� Q����� Q�(�� Q���d Q����� Q���� Q�����
Q��� Q�0��� Q�8��
       Q����( Q����D Q����T Q���p Q���� Q����� Q����� Q���� Q����� Q�
                                                                     �� Q�8��4
Q���P Q�H��l Q�<��� Q����� Q�d��� Q�T��� Q����� Q�l�� Q����0 Q����L Q���h Qߴ���
Q�<��� Q�8��� Q����� Q�P��� Q�\�� Q����  Q���< Q����X Q���t Q���� Q�x��, Q����H
Q����� Q��� Q����  Q���< Q�l��X Q����t Q����� Q� ��� Q��� Q����� Q����  Q�T��
Q����8 Q����H Q����X R ���t R��� R ��� R8��� R��� R���  Rt�� R���, R���H R\��d
R���� R<��� Rd��� R���� R���� R���� R��� R��  R���< R���h Rh��� R\��� Rd���
Rp��� R��� R���� R�� R��� R���4 Rd��P Rp��` R|��p R���� R���� R���� R�D���
R����� R��� RX�� R��, R���H R
                ��d R���� R 0��� R ���� R��� R!���� R"��
                                                         R"|��( R"���D R#H��`
R$l��| R$���� R%T��� R%���� R0���� R�� R1���4 R2���P R3���l R3���| R3����
R7���� R>���� R@h��� RC���� RF��� RJ8��D RJ���` ROD��| RRd��� RU
                                                        ��� RW��� R[@��� R]��
R^���$ R`(��@ R`@��\ R`X��x R`���� R`���� Ra ��� Ra��� Ra��� Ra���$ Ra���4 Rb
��D Rb
  ��T Rb��d Rb��� Re���� RfX��� Rg���� Rh��� Rk$�� Rk|��, Rl���H Rm ��d Rm����
Rn4��� Rn���� Rn���� Rn���� Rn���� Rn���� Ro��$ Ro���@ Ro���\ Rq��x Rrx���
Rs��� Rs���� Rt���� Ru�� RuP��  Ru���< Rw��X Rw���t Rx<��� Rx`��� Rx���� R|����
R~`��  R~��� R|��8 R�@��T R����p R����� R����� R���� R�H��� R�l��� R���� R����4
R����P R����` R���| R����� R����� R�<��� R�P��� R�X� R����$ R����@ R����\ R�
��l R�
                                                                            
��| R� ��� R�4��� R�H��� R�\��� R�p��� R����� R���� R�<��0 R�T��L R����h R�,���
R����� R���� R�p��� R����� R�H�� R����, R����H R�P��d R����� R�(��� R�����
R�(��� R�p��� R����
            R�@��( R����D R���` R����| R����� R�<��� R����� R����� R�� R�\��$
R����@ R����\ R�0��x R R����4 R�,��P RՀ��l Rմ��� R����� R�L��� R����� R�8���
R۠�� R�H��0 R����L R�,��h R����� R�|��� R����� R�@��� R���� R���� R���, R�D��H
R����d R�x��� R�0��� R���� R�H��� R�x��� R����  R�d�� R����8 R����H R����X
R���t R���� R�d��� R����� R����� R��� R���� R����, R�x��H R����d R����t R�����
R����� S \��� S h��� S t��� S ���� S ���
                            S ��( Sd��D S���` S
                                               ��|  ��� S
      |   ^~~
cc1gm2:1:3: error: compilation failed
[Switching to Thread 1 (LWP 1)]

Thread 2 hit Breakpoint 3, 0xfeb4fc24 in exit () from /lib/libc.so.1

(gdb) where
#0  0xfeb4fc24 in exit () from /lib/libc.so.1
#1  0x0060ea04 in libc_exit (code=1) at
/vol/gcc/src/git/modula-2/gcc/m2/mc-boot-ch/Glibc.c:46
#2  0x006071d4 in M2RTS_HALT ()
#3  0x0058d3c4 in M2Error_FlushErrors ()
#4  0x00571c08 in M2Comp_compile ()
#5  0x005180d8 in gm2_langhook_parse_file() ()
#6  0x00c31e18 in compile_file() ()
#7  0x00c35158 in toplev::main(int, char**) ()
#8  0x0172379c in main ()

I couldn't make much sense of this yet.  Probably requires rebuilding cc1gm2
with
-g3 -O0.

             reply	other threads:[~2021-07-09 12:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-09 12:34 ro at gcc dot gnu.org [this message]
2021-09-14 10:15 ` [Bug modula2/101392] " ro at gcc dot gnu.org
2022-05-03 15:27 ` gaius at gcc dot gnu.org
2022-05-04 13:18 ` ro at CeBiTec dot Uni-Bielefeld.DE
2022-11-07 13:15 ` ro at gcc dot gnu.org
2022-11-09 16:30 ` gaius at gcc dot gnu.org
2022-11-10 13:01 ` ro at CeBiTec dot Uni-Bielefeld.DE
2022-11-11 10:50 ` gaius at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-101392-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).