public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug build/31892] New: Always install mtrace.
@ 2024-06-13 17:17 carlos at redhat dot com
  2024-06-13 18:44 ` [Bug build/31892] " jsm28 at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: carlos at redhat dot com @ 2024-06-13 17:17 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=31892

            Bug ID: 31892
           Summary: Always install mtrace.
           Product: glibc
           Version: 2.40
            Status: NEW
          Severity: normal
          Priority: P2
         Component: build
          Assignee: unassigned at sourceware dot org
          Reporter: carlos at redhat dot com
                CC: carlos at redhat dot com
  Target Milestone: ---

The malloc/Makefile conflates PERL=no with running perl code *and* installing
mtrace. We should always install mtrace, but we might not always be able to run
the script (lack of perl on the host).

252 # The Perl script to analyze the output of the mtrace functions.
253 ifneq ($(PERL),no)
254 install-bin-script = mtrace
255 generated += mtrace
256 
257 # The Perl script will print addresses and to do this nicely we must know
258 # whether we are on a 32 or 64 bit machine.
259 ifneq ($(findstring wordsize-32,$(config-sysdirs)),)
260 address-width=10
261 else
262 address-width=18
263 endif
264 endif

My position is that we should just always install mtrace.

The existing mtrace tests are predicated on PERL being detected, so it should
work.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug build/31892] Always install mtrace.
  2024-06-13 17:17 [Bug build/31892] New: Always install mtrace carlos at redhat dot com
@ 2024-06-13 18:44 ` jsm28 at gcc dot gnu.org
  2024-06-13 19:06 ` carlos at redhat dot com
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2024-06-13 18:44 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=31892

--- Comment #1 from Joseph Myers <jsm28 at gcc dot gnu.org> ---
It also conflates the $(PERL) path determined on the system building glibc with
the @PERL@ substituted in the mtrace.pl script that's a path on the system
running glibc; the paths need not be the same even if perl is found (but
obviously a script starting "#! no" would be bad).

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug build/31892] Always install mtrace.
  2024-06-13 17:17 [Bug build/31892] New: Always install mtrace carlos at redhat dot com
  2024-06-13 18:44 ` [Bug build/31892] " jsm28 at gcc dot gnu.org
@ 2024-06-13 19:06 ` carlos at redhat dot com
  2024-06-14 10:09 ` fweimer at redhat dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: carlos at redhat dot com @ 2024-06-13 19:06 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=31892

--- Comment #2 from Carlos O'Donell <carlos at redhat dot com> ---
The following tests are incorrectly conditionalized:

FAIL: misc/tst-allocate_once-mem
FAIL: misc/tst-error1-mem
FAIL: nptl/tst-stack3-mem
FAIL: posix/bug-ga2-mem
FAIL: posix/bug-glob2-mem
FAIL: posix/bug-regex14-mem
FAIL: posix/bug-regex2-mem
FAIL: posix/bug-regex21-mem
FAIL: posix/bug-regex31-mem
FAIL: posix/bug-regex36-mem
FAIL: posix/tst-boost-mem
FAIL: posix/tst-fnmatch-mem
FAIL: posix/tst-glob-tilde-mem
FAIL: posix/tst-pcre-mem
FAIL: posix/tst-rxspencer-no-utf8-mem
FAIL: posix/tst-vfork3-mem
FAIL: stdio-common/tst-printf-bz18872-mem
FAIL: stdio-common/tst-printf-bz25691-mem
FAIL: stdio-common/tst-printf-fp-free-mem
FAIL: stdio-common/tst-printf-fp-leak-mem
FAIL: stdio-common/tst-vfprintf-width-prec-mem

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug build/31892] Always install mtrace.
  2024-06-13 17:17 [Bug build/31892] New: Always install mtrace carlos at redhat dot com
  2024-06-13 18:44 ` [Bug build/31892] " jsm28 at gcc dot gnu.org
  2024-06-13 19:06 ` carlos at redhat dot com
@ 2024-06-14 10:09 ` fweimer at redhat dot com
  2024-06-14 16:02 ` carlos at redhat dot com
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: fweimer at redhat dot com @ 2024-06-14 10:09 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=31892

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at sourceware dot org   |fweimer at redhat dot com
             Status|NEW                         |ASSIGNED
              Flags|                            |security-
                 CC|                            |fweimer at redhat dot com

--- Comment #3 from Florian Weimer <fweimer at redhat dot com> ---
Patch posted:

[PATCH] malloc: Always install mtrace (bug 31892)
<https://inbox.sourceware.org/libc-alpha/87bk43u99n.fsf@oldenburg.str.redhat.com/>

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug build/31892] Always install mtrace.
  2024-06-13 17:17 [Bug build/31892] New: Always install mtrace carlos at redhat dot com
                   ` (2 preceding siblings ...)
  2024-06-14 10:09 ` fweimer at redhat dot com
@ 2024-06-14 16:02 ` carlos at redhat dot com
  2024-06-14 16:03 ` carlos at redhat dot com
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: carlos at redhat dot com @ 2024-06-14 16:02 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=31892

--- Comment #4 from Carlos O'Donell <carlos at redhat dot com> ---
More incorrectly conditionalized tests:

FAIL: check-local-headers
FAIL: catgets/tst-catgets-mem
FAIL: elf/noload-mem
FAIL: elf/tst-leaks1-mem
FAIL: libio/test-fmemopen-mem
FAIL: libio/tst-bz22415-mem
FAIL: libio/tst-bz24228-mem
FAIL: libio/tst-fdopen-seek-failure-mem
FAIL: libio/tst-fopenloc-mem

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug build/31892] Always install mtrace.
  2024-06-13 17:17 [Bug build/31892] New: Always install mtrace carlos at redhat dot com
                   ` (3 preceding siblings ...)
  2024-06-14 16:02 ` carlos at redhat dot com
@ 2024-06-14 16:03 ` carlos at redhat dot com
  2024-06-14 16:14 ` fweimer at redhat dot com
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: carlos at redhat dot com @ 2024-06-14 16:03 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=31892

--- Comment #5 from Carlos O'Donell <carlos at redhat dot com> ---
(In reply to Florian Weimer from comment #3)
> Patch posted:
> 
> [PATCH] malloc: Always install mtrace (bug 31892)
> <https://inbox.sourceware.org/libc-alpha/87bk43u99n.fsf@oldenburg.str.redhat.
> com/>

Florian and I disucssed that this patch needs to take into account what happens
when perl is not installed. So we need a v2 to account for more details e.g.
fallback default if perl isn't installed (like in the minimized buildroots on
Fedora builders if you disable certain parts of the glibc build).

I think there is a valid use case where you haven't yet bootstrapped perl and
are building glibc and want this to succeed with some sensible default.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug build/31892] Always install mtrace.
  2024-06-13 17:17 [Bug build/31892] New: Always install mtrace carlos at redhat dot com
                   ` (4 preceding siblings ...)
  2024-06-14 16:03 ` carlos at redhat dot com
@ 2024-06-14 16:14 ` fweimer at redhat dot com
  2024-06-20  8:33 ` fweimer at redhat dot com
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: fweimer at redhat dot com @ 2024-06-14 16:14 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=31892

--- Comment #6 from Florian Weimer <fweimer at redhat dot com> ---
(In reply to Carlos O'Donell from comment #5)
> (In reply to Florian Weimer from comment #3)
> > Patch posted:
> > 
> > [PATCH] malloc: Always install mtrace (bug 31892)
> > <https://inbox.sourceware.org/libc-alpha/87bk43u99n.fsf@oldenburg.str.redhat.
> > com/>
> 
> Florian and I disucssed that this patch needs to take into account what
> happens when perl is not installed. So we need a v2 to account for more
> details e.g. fallback default if perl isn't installed (like in the minimized
> buildroots on Fedora builders if you disable certain parts of the glibc
> build).

I just posted a v2:

[PATCH v2] malloc: Always install mtrace (bug 31892)
<https://inbox.sourceware.org/libc-alpha/87plsjqzlb.fsf@oldenburg.str.redhat.com/>

It took me a while to figure out a way to get Perl to run a Perl script with a
#!/bin/sh line.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug build/31892] Always install mtrace.
  2024-06-13 17:17 [Bug build/31892] New: Always install mtrace carlos at redhat dot com
                   ` (5 preceding siblings ...)
  2024-06-14 16:14 ` fweimer at redhat dot com
@ 2024-06-20  8:33 ` fweimer at redhat dot com
  2024-06-20  9:18 ` schwab@linux-m68k.org
  2024-06-21 11:15 ` fweimer at redhat dot com
  8 siblings, 0 replies; 10+ messages in thread
From: fweimer at redhat dot com @ 2024-06-20  8:33 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=31892

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |2.40
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Florian Weimer <fweimer at redhat dot com> ---
Fixed for 2.40 via:

commit 086910fc41655152812b515dc324d2ac0dc36e67
Author: Florian Weimer <fweimer@redhat.com>
Date:   Thu Jun 20 10:32:16 2024 +0200

    malloc: Always install mtrace (bug 31892)

    Generation of the Perl script does not depend on Perl, so we can
    always install it even if $(PERL) is not set during the build.

    Change the malloc/mtrace.pl text substition not to rely on $(PERL).
    Instead use PATH at run time to find the Perl interpreter. The Perl
    interpreter cannot execute directly a script that starts with
    “#! /bin/sh”: it always executes it with /bin/sh.  There is no
    perl command line switch to disable this behavior.  Instead, use
    the Perl require function to execute the script.  The additional
    shift calls remove the “.” shell arguments.  Perl interprets the
    “.” as a string concatenation operator, making the expression
    syntactically valid.

    Reviewed-by: Carlos O'Donell <carlos@redhat.com>

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug build/31892] Always install mtrace.
  2024-06-13 17:17 [Bug build/31892] New: Always install mtrace carlos at redhat dot com
                   ` (6 preceding siblings ...)
  2024-06-20  8:33 ` fweimer at redhat dot com
@ 2024-06-20  9:18 ` schwab@linux-m68k.org
  2024-06-21 11:15 ` fweimer at redhat dot com
  8 siblings, 0 replies; 10+ messages in thread
From: schwab@linux-m68k.org @ 2024-06-20  9:18 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=31892

Andreas Schwab <schwab@linux-m68k.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |---
             Status|RESOLVED                    |REOPENED

--- Comment #8 from Andreas Schwab <schwab@linux-m68k.org> ---
The script now has insufficient quoting.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug build/31892] Always install mtrace.
  2024-06-13 17:17 [Bug build/31892] New: Always install mtrace carlos at redhat dot com
                   ` (7 preceding siblings ...)
  2024-06-20  9:18 ` schwab@linux-m68k.org
@ 2024-06-21 11:15 ` fweimer at redhat dot com
  8 siblings, 0 replies; 10+ messages in thread
From: fweimer at redhat dot com @ 2024-06-21 11:15 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=31892

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|REOPENED                    |RESOLVED

--- Comment #9 from Florian Weimer <fweimer at redhat dot com> ---
The quoting issue was fixed via:

commit dd144dce21c864781fade4561581d50fb4549956
Author: Florian Weimer <fweimer@redhat.com>
Date:   Thu Jun 20 20:55:10 2024 +0200

    malloc: Replace shell/Perl gate in mtrace

    The previous version expanded $0 and $@ twice.

    The new version defines a q no-op shell command.  The Perl syntax
    error is masked by the eval Perl function.  The q { … } construct
    is executed by the shell without errors because the q shell function
    was defined, but treated as a non-expanding quoted string by Perl,
    effectively hiding its context from the Perl interpreter.  As before
    the script is read by require instead of executed directly, to avoid
    infinite recursion because the #! line contains /bin/sh.

    Introduce the “fatal” function to produce diagnostics that are not
    suppressed by “do”.  Use “do” instead of “require” because it has
    fewer requirements on the executed script than “require”.

    Prefix relative paths with './' because “do” (and “require“ before)
    searches for the script in @INC if the path is relative and does not
    start with './'.  Use $_ to make the trampoline shorter.

    Add an Emacs mode marker to indentify the script as a Perl script.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2024-06-21 11:15 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-13 17:17 [Bug build/31892] New: Always install mtrace carlos at redhat dot com
2024-06-13 18:44 ` [Bug build/31892] " jsm28 at gcc dot gnu.org
2024-06-13 19:06 ` carlos at redhat dot com
2024-06-14 10:09 ` fweimer at redhat dot com
2024-06-14 16:02 ` carlos at redhat dot com
2024-06-14 16:03 ` carlos at redhat dot com
2024-06-14 16:14 ` fweimer at redhat dot com
2024-06-20  8:33 ` fweimer at redhat dot com
2024-06-20  9:18 ` schwab@linux-m68k.org
2024-06-21 11:15 ` fweimer at redhat dot com

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