mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Mircea Ciocan <m.ciocan@ppc-ag.de>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] Segmentation fault with ptxdist-2020.05.0
Date: Fri, 15 May 2020 15:02:09 +0200	[thread overview]
Message-ID: <ecd9fc8d-7132-57fb-f051-0ff93ba8cb84@ppc-ag.de> (raw)
In-Reply-To: <20200515074618.GB32420@pengutronix.de>


On 15.05.20 09:46, Michael Olbrich wrote:
> On Thu, May 14, 2020 at 03:36:44PM +0200, Mircea Ciocan wrote:
>> Hello list,
>>
>> I have the most strange error with the ptxdist-2020.05.0 while trying to
>> compile a simple image for the iMX6ULL EVK, the shell segfaults !!!
>>
>> Here are some information, that you could find useful:
>>
>> Distribution: Ubuntu 18.04 LTS, 8GB RAM, current updates.
>>
>> System shell set to bash.
>>
>> The compilation of everything goes perfectly OK, but while building the root
>> filesystem image it crashes, always in the same place (100% reproducible),
>> when adding the net-dns-perl package, with the following message;
>>
>> info: selected ptxconfig:
>>        'configs/platform-mcimx6ull-evk/ptxconfig.tiny'
>> ptxdist: warning: No dev packages found in 'Firmware/packages-MCIMX6ULL-EVK'
>>
>> ...[snip]...
>>
>> [compilation goes OK]
>>
>> ----------------
>> target: root.tgz
>> ----------------
>> ...[snip]...
>>
>> Configuring readline.
>> Configuring net-dns-perl.
>> environment: line 1: 31523 Done                    { echo "cd '${work_dir}'
>> || exit"; ptxd_dopermissions "${ptxd_reply_perm_files[@]}"; echo ":"; }
>>       31524 Segmentation fault      (core dumped) | sh
>> ./Software/ptxdist-2020.05.0/rules/image-root-tgz.make:29: recipe for target
>> './Software/Firmware/platform-MCIMX6ULL-EVK/images/root.tgz' failed
>>
>> make: *** [./Software/Firmware/platform-MCIMX6ULL-EVK/images/root.tgz] Error
>> 139
>>
>>
>> In the system log I get something like:
>>
>> "vmunix: [132753.581596] sh[10747]: segfault at 7ffe5bdf1fe8 ip
>> 00007fdb0b04930e sp 00007ffe5bdf1fe0 error 6 in
>> libc-2.27.so[7fdb0afb5000+1e7000]"
>>
>>
>> I have to say that I rarely, if ever, see this type of crash, and the build
>> finishes OK with ptxdist-2020.02.0. Any pointer on how can I fix or debug
>> this are greatly appreciated.
> Huh, I've never seen anything like this. Some things to test.
>
> Take a look at scripts/lib/ptxd_make_image_prepare_work_dir.sh in PTXdist.
> The relevant code is there. Line 50ff.
> If you change line 56 to something like this:
>
> } | tee /tmp/ptxdist-sh-test.txt | sh &&
>
> Then this will save the exact code that the shell executes when it crashed.
> Maybe we can find some clues there. But It's probably a bug in 'sh'.
>
> What's your /bin/sh anyways? For me it's a link to 'dash' but sometimes
> it's a bash. You could explicitly try the other here instead of 'sh' to see
> if that crashes as well.
>
> Michael
>
Hello Michael and thanks for the hint, first things first, the shell is 
the GNU bash, I've change it via the update-alternatives, because more 
than one time I've had issues with scripts that call /bin/sh, but assume 
that is bash.

The logging tap collected the following file:

"cd 
'./Software/Firmware/platform-MCIMX6ULL-EVK/build-target/image-root-tgz' 
|| exit
chmod 0755    './' &&
chown 0.0    './' &&
chmod 0755    './usr' &&
chown 0.0    './usr' &&
chmod 0755    './usr/sbin' &&
chown 0.0    './usr/sbin' &&

...

!!! Another >>>71940<<< similar lines !!!

...

chmod 0755    './usr/bin/cpuburn-a9' &&
chown 0.0    './usr/bin/cpuburn-a9' &&
:"

Is this just a "cool way" to execute a quatrillion of commands, by 
exploiting to the limit the AND_IF (&&) construct to exit on error, or 
there is a deeper purpose ?

I could see that some other cool programmer tried some optimization 
somewhere in bash and these two worlds collided hard, now that full Perl 
and Python packages adds a few tens of thousands of files to the image 
that need their permissions fixed.

I'll have a look if there was another way to do it (how was it done in 
2020.03.0 and lower, could it be that only two lines have been used 
like: chmod -R * && chown -R 0.0 * und fertig ;) ?!?) and see if I could 
reproduce it, to make an Ubuntu bug report.

Other ideas and solutions are most welcome.


Thanks for your help,

Mircea



_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

  reply	other threads:[~2020-05-15 13:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-14 13:36 Mircea Ciocan
2020-05-15  7:40 ` Mircea Ciocan
2020-05-15  7:48   ` Michael Olbrich
2020-05-15  7:59   ` Alexander Dahl
2020-05-15  8:07     ` Mircea Ciocan
2020-05-15  7:46 ` Michael Olbrich
2020-05-15 13:02   ` Mircea Ciocan [this message]
2020-05-15 13:36     ` Mircea Ciocan
2020-05-29  9:21       ` Michael Olbrich
2020-05-29 11:03         ` [ptxdist] [PATCH] ptxd_lib_dopermissions: use 'set -e' instead of && Michael Olbrich

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=ecd9fc8d-7132-57fb-f051-0ff93ba8cb84@ppc-ag.de \
    --to=m.ciocan@ppc-ag.de \
    --cc=ptxdist@pengutronix.de \
    /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