mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Eric Sunshine <>
To: Andreas Hasenack <>
Subject: Re: /proc/cpuinfo regexp fails on s390x
Date: Tue, 22 Nov 2022 12:57:21 -0500	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On Tue, Nov 22, 2022 at 12:45 PM Andreas Hasenack <> wrote:
> git commit 29fb2ec384a867ca577335a12f4b45c184e7b642[1], present in
> 2.38.0 and later, introduced a function that gets the number of cores
> from /proc/cpuinfo. It essentially does this on linux:
>     do { local @ARGV='/proc/cpuinfo'; return
> scalar(grep(/^processor\s*:/, <>)); } if -r '/proc/cpuinfo';
> On s390x, the ^processor lines are like this:
> processor 0: version = FF, identification = 148F67, machine = 2964
> In other arches (I checked amd64, armhf and arm64), they are like this instead:
> processor : 0
> As a result, that function is returning 0 on s390x, and that value is
> used for the number of jobs the script should execute. Since it's
> zero, it exits without doing anything, and that breaks the test and
> the build[3] on s390x.

Thanks for the well-described explanation. I think this is the same
problem reported in [1], however, that thread hasn't seen sufficient
diagnostic information yet to figure out what was going on. So, your
report is very helpful.

There is discussion about altogether ditching the code in question
(see the discussion starting at about [2], for instance), but in the
meantime, fixing this would be a good idea.

> This is trivial and I don't think a PR is necessary, but let me know
> if you want one.
> That regexp could perhaps be:
> /^processor\s*\d*\s*:/
> or
> /^processor[\s\d]*:/
> or something else.

We would be happy to take a patch if you're interested in submitting
one. Otherwise, I can submit a patch to fix this case. Let me know
your preference.


  reply	other threads:[~2022-11-22 17:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-22 17:37 /proc/cpuinfo regexp fails on s390x Andreas Hasenack
2022-11-22 17:57 ` Eric Sunshine [this message]
2022-11-22 18:04   ` Andreas Hasenack
2022-11-22 18:13     ` Eric Sunshine
2022-11-22 18:42       ` Andreas Hasenack
2022-11-22 19:39         ` Eric Sunshine
2022-11-22 23:30 ` Andreas Schwab
2022-11-22 23:50   ` Eric Sunshine
2022-11-23  9:27     ` Andreas Schwab
2022-11-23 19:10       ` Eric Sunshine

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:

  List information:

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

  git send-email \ \ \ \ \

* 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.
Code repositories for project(s) associated with this public inbox

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