public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug modula2/108956] New: [13 regression] SEGV in M2RTS_RegisterModule
@ 2023-02-27 21:26 ro at gcc dot gnu.org
  2023-02-27 21:27 ` [Bug modula2/108956] " ro at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: ro at gcc dot gnu.org @ 2023-02-27 21:26 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108956
           Summary: [13 regression] SEGV in M2RTS_RegisterModule
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: modula2
          Assignee: gaius at gcc dot gnu.org
          Reporter: ro at gcc dot gnu.org
  Target Milestone: ---
              Host: sparc-sun-solaris2.11
            Target: sparc-sun-solaris2.11
             Build: sparc-sun-solaris2.11

Between 20230224 (0ccfa3884f638816af0f5a3f0ee2695e0771ef6d) and 20230227
(dfa85beebfbc2f879d30d3918f634feabc851782),
32-bit Solaris/SPARC bootstrap failed in stage 2:

m2/pge -k -l /vol/gcc/src/hg/master/local/gcc/m2/gm2-compiler/P2Build.bnf -o
m2/gm2-compiler-boot/P2Build.mod
make[3]: *** [/vol/gcc/src/hg/master/local/gcc/m2/Make-lang.in:1629:
m2/gm2-compiler-boot/P2Build.mod] Segmentation Fault

P3Build.mod is likewise affected.

gdb shows

Thread 2 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1 (LWP 1)]
0x00034d24 in M2RTS_RegisterModule (name=0x25c98, 
    libname=0x4dd24 <_M2_UnixArgs_init(int, char**, char**)>, init=..., 
    fini=..., dependencies=...)
    at /vol/gcc/src/hg/master/local/gcc/m2/pge-boot/GM2RTS.c:464
464     {
1: x/i $pc
=> 0x34d24 <M2RTS_RegisterModule(void*, void*, M2RTS_ArgCVEnvP,
M2RTS_ArgCVEnvP, PROC)+40>:     ld  [ %i5 ], %g1
(gdb) p/x $i5
$1 = 0x2944
(gdb) bt
#0  0x00034d24 in M2RTS_RegisterModule (name=0x25c98, 
    libname=0x4dd24 <_M2_UnixArgs_init(int, char**, char**)>, init=..., 
    fini=..., dependencies=...)
    at /vol/gcc/src/hg/master/local/gcc/m2/pge-boot/GM2RTS.c:464
#1  0x0004ddcc in _M2_UnixArgs_ctor::_M2_UnixArgs_ctor (
    this=0x83958 <_M2_UnixArgs_ctor>)
    at /vol/gcc/src/hg/master/local/gcc/m2/pge-boot/GUnixArgs.cc:89
#2  0x0004ddec in __static_initialization_and_destruction_0 ()
    at /vol/gcc/src/hg/master/local/gcc/m2/pge-boot/GUnixArgs.cc:85
#3  0x0004de04 in _GLOBAL__sub_I_UnixArgs_GetArgC ()
    at /vol/gcc/src/hg/master/local/gcc/m2/pge-boot/GUnixArgs.cc:91
#4  0xff1b2b48 in call_array () from /usr/lib/ld.so.1
#5  0xff1b2cd8 in call_init () from /usr/lib/ld.so.1
#6  0xff1b1fb4 in setup () from /usr/lib/ld.so.1
#7  0xff1c42ec in _setup () from /usr/lib/ld.so.1
#8  0xff1a44c0 in _rt_boot () from /usr/lib/ld.so.1

Address 0x2944 isn't mapped, thus the SEGV.

Apparently this is a caller/callee mismatch:

#0  0x00034d24 in M2RTS_RegisterModule (name=0x25c98, 
    libname=0x4dd24 <_M2_UnixArgs_init(int, char**, char**)>, init=..., 
    fini=..., dependencies=...)
    at /vol/gcc/src/hg/master/local/gcc/m2/pge-boot/GM2RTS.c:464
464     {
(gdb) p dependencies
$4 = {proc = 0x0}
(gdb) up
#1  0x0004ddcc in _M2_UnixArgs_ctor::_M2_UnixArgs_ctor (
    this=0x83958 <_M2_UnixArgs_ctor>)
    at /vol/gcc/src/hg/master/local/gcc/m2/pge-boot/GUnixArgs.cc:89
89        M2RTS_RegisterModule ("UnixArgs", _M2_UnixArgs_init,
_M2_UnixArgs_fini,
(gdb) p _M2_UnixArgs_dep
$3 = {void (void)} 0x4dd8c <_M2_UnixArgs_dep()>

dependencies is of type PROC (i.e.struct { PROC_t proc; }) while
_M2_UnixArgs_dep is extern "C" void _M2_UnixArgs_dep (void).

This is almost certainly caused by

commit 05652ac4e8b8685fe0c0f4ee2f75516d28bbf892
Author: Gaius Mulley <gaiusmod2@gmail.com>
Date:   Sat Feb 25 16:28:19 2023 +0000

    modula-2 module registration process seems to fail with shared libraries
[PR
108261]

64-bit Solaris/SPARC (sparcv9-sun-solaris2.11) isn't affected.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-03-01 14:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-27 21:26 [Bug modula2/108956] New: [13 regression] SEGV in M2RTS_RegisterModule ro at gcc dot gnu.org
2023-02-27 21:27 ` [Bug modula2/108956] " ro at gcc dot gnu.org
2023-02-28  1:15 ` gaius at gcc dot gnu.org
2023-02-28  1:16 ` gaius at gcc dot gnu.org
2023-02-28  1:29 ` gaius at gcc dot gnu.org
2023-02-28  8:36 ` ro at CeBiTec dot Uni-Bielefeld.DE
2023-02-28 13:02 ` gaius at gcc dot gnu.org
2023-02-28 15:36 ` cvs-commit at gcc dot gnu.org
2023-03-01 10:36 ` gaius at gcc dot gnu.org
2023-03-01 10:37 ` ro at CeBiTec dot Uni-Bielefeld.DE
2023-03-01 14:20 ` gaius at gcc dot gnu.org

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).