public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] U-Boot Bug with newer GCC
Date: Sat, 2 Feb 2013 16:05:21 +0100	[thread overview]
Message-ID: <201302021605.21681.marex@denx.de> (raw)
In-Reply-To: <510D1D1E.7080705@myspectrum.nl>

Dear Jeroen Hofstee,

> Hello Albert,
> 
> On 02/02/2013 12:32 PM, Albert ARIBAUD wrote:
> >>> Sebastian wrote On 01.02.2013 08:55:
> >>>> we are using u-boot in our embedded system with arm-1136jfs cpu.
> >>>> We recently tried a new toolchain with GCC 4.7.2.
> >>>> If compiled with the new toolchain the feature CONFIG_AUTO_COMPLETE
> >>>> isn't working.
> > 
> > [..] AFAIK it has never been seen on mainline code,
> 
> The twister board from mainline / current master also has
> this problem. I believe the mt_ventoux will have it as well,
> but can't test it.
> 
> > and has been very elusive for those who experience it -- enabling debug
> > or simply adding/removing code makes it go away or reappear, leading me
> > to thinking that some of the added code either does a data abort itself,
> > or causes one in the mainline code it calls upon.
> 
> yes, it is confusing. The following patch will e.g. make the
> trap go away on the twister. Yet there is nothing wrong with the
> original code it touches (or I fail to see what it is).
> 
> Regards,
> Jeroen
> 
> diff --git a/common/command.c b/common/command.c
> index 50c8429..520bd39 100644
> --- a/common/command.c
> +++ b/common/command.c
> @@ -185,7 +185,6 @@ static int complete_cmdv(int argc, char * const
> argv[], char last_char, int maxv
>          cmd_tbl_t *cmdtp = ll_entry_start(cmd_tbl_t, cmd);
>          const int count = ll_entry_count(cmd_tbl_t, cmd);
>          const cmd_tbl_t *cmdend = cmdtp + count;
> -       const char *p;
>          int len, clen;
>          int n_found = 0;
>          const char *cmd;
> @@ -224,11 +223,7 @@ static int complete_cmdv(int argc, char * const
> argv[], char last_char, int maxv
>           * Some commands allow length modifiers (like "cp.b");
>           * compare command name only until first dot.
>           */
> -       p = strchr(cmd, '.');
> -       if (p == NULL)
> -               len = strlen(cmd);
> -       else
> -               len = p - cmd;
> +       len = strlen(cmd);
> 
>          /* return the partial matches */
>          for (; cmdtp != cmdend; cmdtp++) {

Could it be that 'cmd' is possibly not zero-terminated string?

Best regards,
Marek Vasut

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

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-01  7:55 [U-Boot] U-Boot Bug with newer GCC Priebe, Sebastian
2013-02-01 11:31 ` Wolfgang Denk
2013-02-01 17:41   ` Jeroen Hofstee
2013-02-01 21:42     ` Wolfgang Denk
2013-02-02 11:25       ` Jeroen Hofstee
     [not found]   ` <E70AF999396FDF4EAE40E195B847096109F5D6FD@SRVEXCH-2K10.CADCON.INTERN>
2013-02-01 21:36     ` Wolfgang Denk
2013-02-02  8:37   ` Heiko Schocher
2013-02-02 10:18     ` Jeroen Hofstee
2013-02-02 11:32       ` Albert ARIBAUD
2013-02-02 14:05         ` Jeroen Hofstee
2013-02-02 15:05           ` Marek Vasut [this message]
2013-02-02 21:23             ` Wolfgang Denk
2013-02-02 21:22           ` Wolfgang Denk
2013-02-02 21:44             ` Jeroen Hofstee
2013-02-04  7:11               ` Priebe, Sebastian
2013-02-04  8:49                 ` Albert ARIBAUD
2013-02-04 11:28                   ` Priebe, Sebastian
2013-02-04 11:35                     ` Albert ARIBAUD
2013-02-04 14:23                       ` Priebe, Sebastian
2013-02-04 14:32                         ` Albert ARIBAUD
2013-02-04 15:32                           ` Priebe, Sebastian
2013-02-04 20:49                             ` Wolfgang Denk
2013-02-02 15:43       ` Jeroen Hofstee
2013-02-02 17:38         ` Heiko Schocher
2013-02-02 16:50           ` Marek Vasut
2013-02-02 19:12         ` Jeroen Hofstee

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=201302021605.21681.marex@denx.de \
    --to=marex@denx.de \
    --cc=u-boot@lists.denx.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