• perl_5.32.0~rc1-1 FTBFS on m68k (experimental)

    From Niko Tyni@21:1/5 to All on Wed Jun 17 22:40:02 2020
    Hi m68k porters,

    perl_5.32.0~rc1-1 in experimental failed to build on m68k with a
    SIGSEGV in miniperl. Could somebody please look at this and see if it's reproducible? Guess it could be either an actual source regression or
    "just" a toolchain/platform problem.

    Thanks for your work,
    --
    Niko Tyni ntyni@debian.org

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John Paul Adrian Glaubitz@21:1/5 to Niko Tyni on Wed Jun 17 22:50:02 2020
    Hi!

    On 6/17/20 10:15 PM, Niko Tyni wrote:
    perl_5.32.0~rc1-1 in experimental failed to build on m68k with a
    SIGSEGV in miniperl. Could somebody please look at this and see if it's reproducible? Guess it could be either an actual source regression or
    "just" a toolchain/platform problem.

    Thanks for the heads-up. I'll look into it.

    Adrian

    --
    .''`. John Paul Adrian Glaubitz
    : :' : Debian Developer - glaubitz@debian.org
    `. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
    `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John Paul Adrian Glaubitz@21:1/5 to John Paul Adrian Glaubitz on Thu Jun 18 12:00:01 2020
    Hi!

    On 6/17/20 10:40 PM, John Paul Adrian Glaubitz wrote:
    On 6/17/20 10:15 PM, Niko Tyni wrote:
    perl_5.32.0~rc1-1 in experimental failed to build on m68k with a
    SIGSEGV in miniperl. Could somebody please look at this and see if it's
    reproducible? Guess it could be either an actual source regression or
    "just" a toolchain/platform problem.

    Thanks for the heads-up. I'll look into it.

    Here's the backtrace:

    itest; exit 1'

    GNU gdb (Debian 9.2-1) 9.2
    Copyright (C) 2020 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    Type "show copying" and "show warranty" for details.
    This GDB was configured as "m68k-linux-gnu".
    Type "show configuration" for configuration details.
    For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>.
    Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

    For help, type "help".
    Type "apropos word" to search for commands related to "word"...
    Reading symbols from ./miniperl...
    (gdb) r
    Starting program: /srv/perl2/perl-5.32.0~rc1/build-static/miniperl -w -Ilib -Idist/Exporter/lib -MExporter -e \<\?\>
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/m68k-linux-gnu/libthread_db.so.1".

    Program received signal SIGSEGV, Segmentation fault.
    S_link_freed_op (o=0x803120aa, slab=<optimized out>, slab=<optimized out>,
    my_perl=0x8030a190) at op.c:269
    269 if (!slab->opslab_freed) {
    (gdb) bt
    #0 S_link_freed_op (o=0x803120aa, slab=<optimized out>, slab=<optimized out>,
    my_perl=0x8030a190) at op.c:269
    #1 0x8000901e in Perl_Slab_Free (op=0x80312136, my_perl=0x8030a190)
    at op.c:505
    #2 Perl_Slab_Free (my_perl=0x8030a190, op=0x803120aa) at op.c:484
    #3 0x8000fae6 in S_op_destroy (o=<optimized out>, my_perl=<optimized out>)
    at op.c:6416
    #4 Perl_op_append_list (type=<optimized out>, last=<optimized out>,
    first=0x80312136, my_perl=<optimized out>) at op.c:6416
    #5 Perl_op_append_list (my_perl=<optimized out>, type=<optimized out>,
    first=<optimized out>, last=<optimized out>) at op.c:6397
    #6 0x800625c8 in Perl_yyparse (my_perl=0x8030a190, gramtype=258)
    at perly.y:239
    #7 0x800321fe in S_parse_body (xsinit=0x801885f8 <xs_init>, env=0x0,
    my_perl=0x8030a190) at perl.c:2576
    #8 perl_parse (my_perl=0x8030a190, xsinit=0x801885f8 <xs_init>, argc=7,
    argv=0xeffffc14, env=0x0) at perl.c:1871
    #9 0x800050ae in main (argc=<optimized out>, argv=<optimized out>,
    env=<optimized out>) at miniperlmain.c:132
    (gdb)

    Adrian

    --
    .''`. John Paul Adrian Glaubitz
    : :' : Debian Developer - glaubitz@debian.org
    `. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
    `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John Paul Adrian Glaubitz@21:1/5 to John Paul Adrian Glaubitz on Thu Jun 18 12:20:01 2020
    Hi!

    On 6/18/20 11:58 AM, John Paul Adrian Glaubitz wrote:
    Thanks for the heads-up. I'll look into it.

    Here's the backtrace:
    Reported upstream [1].

    Adrian

    [1] https://github.com/Perl/perl5/issues/17871

    --
    .''`. John Paul Adrian Glaubitz
    : :' : Debian Developer - glaubitz@debian.org
    `. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
    `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John Paul Adrian Glaubitz@21:1/5 to John Paul Adrian Glaubitz on Thu Jun 18 22:50:01 2020
    Hello!

    On 6/18/20 12:10 PM, John Paul Adrian Glaubitz wrote:
    Reported upstream [1].

    It's an alignment issue and can be trivially fixed with this patch:

    diff --git a/op.h b/op.h
    index fc21f03cda..480c95245b 100644
    --- a/op.h
    +++ b/op.h
    @@ -698,7 +698,7 @@ struct opslot {
    U16 opslot_size; /* size of this slot (in pointers) */
    U16 opslot_offset; /* offset from start of slab (in ptr units) */
    OP opslot_op; /* the op itself */
    -};
    +} __attribute__ ((aligned (4)));

    struct opslab {
    OPSLAB * opslab_next; /* next slab */

    Adrian

    --
    .''`. John Paul Adrian Glaubitz
    : :' : Debian Developer - glaubitz@debian.org
    `. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
    `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Geert Uytterhoeven@21:1/5 to glaubitz@physik.fu-berlin.de on Fri Jun 19 10:10:01 2020
    Hi Adrian,

    On Thu, Jun 18, 2020 at 10:46 PM John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> wrote:
    On 6/18/20 12:10 PM, John Paul Adrian Glaubitz wrote:
    Reported upstream [1].

    It's an alignment issue and can be trivially fixed with this patch:

    diff --git a/op.h b/op.h
    index fc21f03cda..480c95245b 100644
    --- a/op.h
    +++ b/op.h
    @@ -698,7 +698,7 @@ struct opslot {
    U16 opslot_size; /* size of this slot (in pointers) */
    U16 opslot_offset; /* offset from start of slab (in ptr units) */
    OP opslot_op; /* the op itself */
    -};
    +} __attribute__ ((aligned (4)));

    struct opslab {
    OPSLAB * opslab_next; /* next slab */

    In the mean time, you changed this to add explicit padding instead:

    https://github.com/Perl/perl5/issues/17871

    diff --git a/op.h b/op.h
    index fc21f03cda..fb9f538e23 100644
    --- a/op.h
    +++ b/op.h
    @@ -714,6 +714,7 @@ struct opslab {
    # ifdef PERL_DEBUG_READONLY_OPS
    bool opslab_readonly;
    # endif
    + U16 opslab_padding; /* padding to ensure proper alignment */
    OPSLOT opslab_slots; /* slots begin here */
    };

    I take it PERL_DEBUG_READONLY_OPS is enabled?
    Hence the padding should be moved inside the #ifdef,
    Furthermore, sizeof(bool) = 1, right? So you still have an implicit
    hole, and it would be better to add 3 bytes of explicit padding
    instead one 16-bit quantity.

    Gr{oetje,eeting}s,

    Geert


    --
    Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

    In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
    -- Linus Torvalds

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John Paul Adrian Glaubitz@21:1/5 to Geert Uytterhoeven on Fri Jun 19 10:50:01 2020
    On 6/19/20 10:42 AM, Geert Uytterhoeven wrote:
    So release builds fail, too?

    Well, the build fails during the stage1 build.

    And they don't set PERL_DEBUG_READONLY_OPS?

    If PERL_DEBUG_READONLY_OPS is not set, I see no reason why
    the padding would be needed.

    It might be set during stage1, but not stage2.

    I will have to look at it again.

    Adrian

    --
    .''`. John Paul Adrian Glaubitz
    : :' : Debian Developer - glaubitz@debian.org
    `. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
    `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John Paul Adrian Glaubitz@21:1/5 to All on Fri Jun 19 10:30:01 2020
    On Jun 19, 2020, at 10:02 AM, Geert Uytterhoeven <geert@linux-m68k.org> wrote:

    Hi Adrian,

    On Thu, Jun 18, 2020 at 10:46 PM John Paul Adrian Glaubitz
    <glaubitz@physik.fu-berlin.de> wrote:
    On 6/18/20 12:10 PM, John Paul Adrian Glaubitz wrote:
    Reported upstream [1].

    It's an alignment issue and can be trivially fixed with this patch:

    diff --git a/op.h b/op.h
    index fc21f03cda..480c95245b 100644
    --- a/op.h
    +++ b/op.h
    @@ -698,7 +698,7 @@ struct opslot {
    U16 opslot_size; /* size of this slot (in pointers) */
    U16 opslot_offset; /* offset from start of slab (in ptr units) */
    OP opslot_op; /* the op itself */
    -};
    +} __attribute__ ((aligned (4)));

    struct opslab {
    OPSLAB * opslab_next; /* next slab */

    In the mean time, you changed this to add explicit padding instead:

    https://github.com/Perl/perl5/issues/17871

    diff --git a/op.h b/op.h
    index fc21f03cda..fb9f538e23 100644
    --- a/op.h
    +++ b/op.h
    @@ -714,6 +714,7 @@ struct opslab {
    # ifdef PERL_DEBUG_READONLY_OPS
    bool opslab_readonly;
    # endif
    + U16 opslab_padding; /* padding to ensure proper alignment */
    OPSLOT opslab_slots; /* slots begin here */
    };

    I take it PERL_DEBUG_READONLY_OPS is enabled?
    Hence the padding should be moved inside the #ifdef,
    Furthermore, sizeof(bool) = 1, right? So you still have an implicit
    hole, and it would be better to add 3 bytes of explicit padding
    instead one 16-bit quantity.

    No, I didn’t take that #ifdef into consideration.

    And I’m confused now.

    Add the three bytes how? Inside the #ifdef makes no sense as that wouldn’t fix release builds.

    Adrian

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Geert Uytterhoeven@21:1/5 to glaubitz@physik.fu-berlin.de on Fri Jun 19 10:50:01 2020
    Hi Adrian,

    On Fri, Jun 19, 2020 at 10:20 AM John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> wrote:
    On Jun 19, 2020, at 10:02 AM, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
    On Thu, Jun 18, 2020 at 10:46 PM John Paul Adrian Glaubitz
    <glaubitz@physik.fu-berlin.de> wrote:
    On 6/18/20 12:10 PM, John Paul Adrian Glaubitz wrote:
    Reported upstream [1].

    It's an alignment issue and can be trivially fixed with this patch:

    diff --git a/op.h b/op.h
    index fc21f03cda..480c95245b 100644
    --- a/op.h
    +++ b/op.h
    @@ -698,7 +698,7 @@ struct opslot {
    U16 opslot_size; /* size of this slot (in pointers) */ >> U16 opslot_offset; /* offset from start of slab (in ptr units) */
    OP opslot_op; /* the op itself */
    -};
    +} __attribute__ ((aligned (4)));

    struct opslab {
    OPSLAB * opslab_next; /* next slab */

    In the mean time, you changed this to add explicit padding instead:

    https://github.com/Perl/perl5/issues/17871

    diff --git a/op.h b/op.h
    index fc21f03cda..fb9f538e23 100644
    --- a/op.h
    +++ b/op.h
    @@ -714,6 +714,7 @@ struct opslab {
    # ifdef PERL_DEBUG_READONLY_OPS
    bool opslab_readonly;
    # endif
    + U16 opslab_padding; /* padding to ensure proper alignment */
    OPSLOT opslab_slots; /* slots begin here */
    };

    I take it PERL_DEBUG_READONLY_OPS is enabled?
    Hence the padding should be moved inside the #ifdef,
    Furthermore, sizeof(bool) = 1, right? So you still have an implicit
    hole, and it would be better to add 3 bytes of explicit padding
    instead one 16-bit quantity.

    No, I didn’t take that #ifdef into consideration.

    And I’m confused now.

    Add the three bytes how? Inside the #ifdef makes no sense as that wouldn’t fix release builds.

    So release builds fail, too?
    And they don't set PERL_DEBUG_READONLY_OPS?

    If PERL_DEBUG_READONLY_OPS is not set, I see no reason why
    the padding would be needed.

    Disclaimer: looking at the 5.26 version from Ubuntu, as github seems
    to be down.

    Gr{oetje,eeting}s,

    Geert

    --
    Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

    In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
    -- Linus Torvalds

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John Paul Adrian Glaubitz@21:1/5 to John Paul Adrian Glaubitz on Fri Jun 19 11:00:01 2020
    On 6/19/20 10:47 AM, John Paul Adrian Glaubitz wrote:
    It might be set during stage1, but not stage2.

    I will have to look at it again.

    I just tried this change and it doesn't fix the problem:

    diff --git a/op.h b/op.h
    index fc21f03cda..ca3102d7d2 100644
    --- a/op.h
    +++ b/op.h
    @@ -713,6 +713,8 @@ struct opslab {
    units) */
    # ifdef PERL_DEBUG_READONLY_OPS
    bool opslab_readonly;
    + U16 _padding1; /* additional padding to ensure opslab is 32-bit aligned */
    + U8 _padding2; /* when PERL_DEBUG_READONLY_OPS is set */
    # endif
    OPSLOT opslab_slots; /* slots begin here */
    };

    Adrian

    --
    .''`. John Paul Adrian Glaubitz
    : :' : Debian Developer - glaubitz@debian.org
    `. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
    `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Geert Uytterhoeven@21:1/5 to glaubitz@physik.fu-berlin.de on Fri Jun 19 11:10:02 2020
    Hi Adrian,

    On Fri, Jun 19, 2020 at 10:52 AM John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> wrote:
    On 6/19/20 10:47 AM, John Paul Adrian Glaubitz wrote:
    It might be set during stage1, but not stage2.

    I will have to look at it again.

    I just tried this change and it doesn't fix the problem:

    That's actually expected ;-)

    --- a/op.h
    +++ b/op.h
    @@ -713,6 +713,8 @@ struct opslab {
    units) */
    # ifdef PERL_DEBUG_READONLY_OPS
    bool opslab_readonly;

    implicit padding of 1 byte

    + U16 _padding1; /* additional padding to ensure opslab is 32-bit aligned */
    + U8 _padding2; /* when PERL_DEBUG_READONLY_OPS is set */

    implicit padding of 1 byte

    # endif
    OPSLOT opslab_slots; /* slots begin here */
    };

    Either invert the order of the two paddings, or replace them by a single one:

    U8 _padding[3];

    Gr{oetje,eeting}s,

    Geert

    --
    Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

    In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
    -- Linus Torvalds

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John Paul Adrian Glaubitz@21:1/5 to Geert Uytterhoeven on Fri Jun 19 11:10:02 2020
    On 6/19/20 11:03 AM, Geert Uytterhoeven wrote:
    Either invert the order of the two paddings, or replace them by a single one:

    U8 _padding[3];
    I just tried this variant and it didn't help:

    diff --git a/op.h b/op.h
    index fc21f03cda..703be6b3f2 100644
    --- a/op.h
    +++ b/op.h
    @@ -713,6 +713,7 @@ struct opslab {
    units) */
    # ifdef PERL_DEBUG_READONLY_OPS
    bool opslab_readonly;
    + U8 _padding[3]; /* additional padding to ensure opslab is 32-bit aligned */
    # endif
    OPSLOT opslab_slots; /* slots begin here */
    };

    Adrian

    --
    .''`. John Paul Adrian Glaubitz
    : :' : Debian Developer - glaubitz@debian.org
    `. `' Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
    `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Geert Uytterhoeven@21:1/5 to glaubitz@physik.fu-berlin.de on Fri Jun 19 13:30:02 2020
    Hi Adrian,

    On Fri, Jun 19, 2020 at 12:08 PM John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> wrote:
    This works, both with PERL_DEBUG_READONLY_OPS and without:

    diff --git a/op.h b/op.h
    index fc21f03cda..fc7e73fef4 100644
    --- a/op.h
    +++ b/op.h
    @@ -713,7 +713,9 @@ struct opslab {
    units) */
    # ifdef PERL_DEBUG_READONLY_OPS
    bool opslab_readonly;
    + U8 opslab_padding1[3];
    # endif
    + U16 opslab_padding2;
    OPSLOT opslab_slots; /* slots begin here */
    };

    So now you have 5 bytes of padding if PERL_DEBUG_READONLY_OPS,
    while I guess 1 would be sufficient?

    What about

    # ifdef PERL_DEBUG_READONLY_OPS
    bool opslab_readonly;
    U8 opslab_padding;
    #else
    U16 opslab_padding;
    # endif

    ?

    Gr{oetje,eeting}s,

    Geert

    --
    Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

    In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
    -- Linus Torvalds

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)