All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rabin Vincent <rabin@rab.in>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/6] dlmalloc: ensure gd is set for early alloc
Date: Wed, 5 Nov 2014 20:37:31 +0100	[thread overview]
Message-ID: <20141105193731.GA28554@debian> (raw)
In-Reply-To: <CAPnjgZ3g4tFwHL1xi-puMLj1kHw94_h3yy6di68GTDnnmkT6mA@mail.gmail.com>

On Sat, Nov 01, 2014 at 09:11:34AM -0600, Simon Glass wrote:
> On 29 October 2014 16:21, Rabin Vincent <rabin@rab.in> wrote:
> > Attempting to run the sandbox leads to a segfault, because some dynamic
> > libraries (outside of u-boot) attempt to use malloc() to allocate memory
> > before u-boot's gd variable is initialized.
> >
> > Check for gd not being NULL in the SYS_MALLOC_F_LEN handling, so that
> > malloc() doesn't crash when called at this point.
> >
> >  $ gdb -q --args ./u-boot
> >  (gdb) r
> >  Program received signal SIGSEGV, Segmentation fault.
> >  0x0000000000412b9b in malloc (bytes=bytes at entry=37) at common/dlmalloc.c:2184
> >  2184           if (!(gd->flags & GD_FLG_RELOC)) {
> >  (gdb) p gd
> >  $1 = (gd_t *) 0x0
> >  (gdb) bt
> >  #0  0x0000000000412b9b in malloc (bytes=bytes at entry=37) at common/dlmalloc.c:2184
> >  #1  0x00007ffff75bf8e1 in set_binding_values (domainname=0x7ffff11f4f12 "libgpg-error", dirnamep=0x7fffffffe168, codesetp=0x0)
> >      at bindtextdom.c:228
> >  #2  0x00007ffff75bfb4c in set_binding_values (codesetp=0x0, dirnamep=0x7fffffffe168, domainname=<optimized out>) at bindtextdom.c:350
> >  #3  __bindtextdomain (domainname=<optimized out>, dirname=0x7ffff11f4f00 "/usr/share/locale") at bindtextdom.c:348
> >  #4  0x00007ffff11eca17 in ?? () from /lib/x86_64-linux-gnu/libgpg-error.so.0
> >  #5  0x00007ffff7dea9fa in call_init (l=<optimized out>, argc=argc at entry=1, argv=argv at entry=0x7fffffffe208,
> >      env=env at entry=0x7fffffffe218) at dl-init.c:78
> >  #6  0x00007ffff7deaae3 in call_init (env=0x7fffffffe218, argv=0x7fffffffe208, argc=1, l=<optimized out>) at dl-init.c:36
> >  #7  _dl_init (main_map=0x7ffff7ffe1a8, argc=1, argv=0x7fffffffe208, env=0x7fffffffe218) at dl-init.c:126
> >  #8  0x00007ffff7ddd1ca in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
> 
> How do you provoke this error? It doesn't seem to happen for me.

I just run the u-boot binary, which I built with sandbox_defconfig.
Perhaps you have different library versions on your system? (I see it's
libgpg-error.so which is triggering the malloc() here.)  I run Debian
unstable.

  reply	other threads:[~2014-11-05 19:37 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-29 22:21 [U-Boot] [PATCH 1/6] dlmalloc: ensure gd is set for early alloc Rabin Vincent
2014-10-29 22:21 ` [U-Boot] [PATCH 2/6] sandbox: init cli for -c Rabin Vincent
2014-11-01 15:11   ` Simon Glass
2014-11-10 21:26   ` [U-Boot] [U-Boot,2/6] " Tom Rini
2014-10-29 22:21 ` [U-Boot] [PATCH 3/6] hush: return consistent codes from run_command() Rabin Vincent
2014-11-01 15:11   ` Simon Glass
2014-11-10 21:26   ` [U-Boot] [U-Boot, " Tom Rini
2014-10-29 22:21 ` [U-Boot] [PATCH 4/6] hush: fix segfault on syntax error Rabin Vincent
2014-11-01 15:11   ` Simon Glass
2014-11-10 21:27   ` [U-Boot] [U-Boot,4/6] " Tom Rini
2014-10-29 22:21 ` [U-Boot] [PATCH 5/6] hush: make run_command() return an error on parsing failure Rabin Vincent
2014-11-01 15:12   ` Simon Glass
2014-11-10 21:27   ` [U-Boot] [U-Boot, " Tom Rini
2014-10-29 22:21 ` [U-Boot] [PATCH 6/6] hush: add some tests for quoting Rabin Vincent
2014-11-01 15:12   ` Simon Glass
2014-11-05 20:11     ` Rabin Vincent
2014-11-06 19:26       ` Simon Glass
2014-11-01 15:11 ` [U-Boot] [PATCH 1/6] dlmalloc: ensure gd is set for early alloc Simon Glass
2014-11-05 19:37   ` Rabin Vincent [this message]
2014-11-10 21:26 ` [U-Boot] [U-Boot, " Tom Rini

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=20141105193731.GA28554@debian \
    --to=rabin@rab.in \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.