mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: MJ <mjainp@gmail.com>
To: barebox@lists.infradead.org
Subject: Sandbox Segfaults
Date: Fri, 22 Apr 2011 21:13:39 +0530	[thread overview]
Message-ID: <BANLkTik_geZ4hpcXTdN81DEgcOeqRZT8UA@mail.gmail.com> (raw)

Hi,

I was trying sandbox for x86 host machine from latest git repo of
barebox (master branch) and it segfaults when ran with following
command line arguments,

./barebox -e env.bin -i cramfs.bin

I have read initial documentation to create env.bin and small
filesystem. Attached is patch that fixes segfault problem but is not
helpful in creating environment and mounting filesystem.

diff --git a/arch/sandbox/board/hostfile.c b/arch/sandbox/board/hostfile.c
index 38a52a8..52212f7 100644
--- a/arch/sandbox/board/hostfile.c
+++ b/arch/sandbox/board/hostfile.c
@@ -107,7 +107,8 @@ int barebox_register_filedev(struct hf_platform_data *hf)

        dev->platform_data = hf;

-       strcpy(dev->name, "hostfile");
+       /* Registering 2 devices with same name creates problem? */
+       strcpy(dev->name, hf->filename);
        dev->size = hf->size;
        dev->map_base = hf->map_base;


Strace log for problem
=================

execve("./barebox", ["./barebox", "-e", "env.bin", "-i",
"cramfs.bin"], [/* 22 vars */]) = 0
brk(0)                                  = 0x216d1000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xa3f000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=61576, ...}) = 0
mmap2(NULL, 61576, PROT_READ, MAP_PRIVATE, 3, 0) = 0x141000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/tls/i686/cmov/librt.so.1", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\300\30\0\0004\0\0\0"...,
512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=30684, ...}) = 0
mmap2(NULL, 33364, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
0) = 0xe49000
mmap2(0xe50000, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6) = 0xe50000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/tls/i686/cmov/libpthread.so.0", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0
J\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=117086, ...}) = 0
mmap2(NULL, 98792, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
0) = 0x4cb000
mmap2(0x4e0000, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14) = 0x4e0000
mmap2(0x4e2000, 4584, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4e2000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/tls/i686/cmov/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0000m\1\0004\0\0\0"...,
512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1405508, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xbad000
mmap2(NULL, 1415592, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE,
3, 0) = 0x28e000
mprotect(0x3e1000, 4096, PROT_NONE)     = 0
mmap2(0x3e2000, 12288, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x153) = 0x3e2000
mmap2(0x3e5000, 10664, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3e5000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xbda000
set_thread_area({entry_number:-1 -> 6, base_addr:0xbda6c0,
limit:1048575, seg_32bit:1, contents:0, read_exec_only:0,
limit_in_pages:1, seg_not_present:0, useable:1}) = 0
mprotect(0x3e2000, 8192, PROT_READ)     = 0
mprotect(0x4e0000, 4096, PROT_READ)     = 0
mprotect(0xe50000, 4096, PROT_READ)     = 0
mprotect(0x28c000, 4096, PROT_READ)     = 0
munmap(0x141000, 61576)                 = 0
set_tid_address(0xbda728)               = 9951
set_robust_list(0xbda730, 0xc)          = 0
futex(0xbf9bb9c0, FUTEX_WAKE_PRIVATE, 1) = 0
futex(0xbf9bb9c0, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1,
NULL, bf9bb9d0) = -1 EAGAIN (Resource temporarily unavailable)
rt_sigaction(SIGRTMIN, {0x4cf410, [], SA_SIGINFO}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0x4cf8f0, [], SA_RESTART|SA_SIGINFO}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
uname({sys="Linux", node="mjain-laptop", ...}) = 0
mmap2(NULL, 8392704, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
-1, 0) = 0xe52000
brk(0)                                  = 0x216d1000
brk(0x216f2000)                         = 0x216f2000
fstat64(1, {st_mode=S_IFCHR|0600, st_rdev=makedev(136, 0), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xa0c000
write(1, "add file env.bin()\n", 19add file env.bin()
)    = 19
open("env.bin", O_RDWR)                 = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=65536, ...}) = 0
mmap2(NULL, 65536, PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0) = 0x110000
write(1, "add file cramfs.bin()\n", 22add file cramfs.bin()
) = 22
open("cramfs.bin", O_RDWR)              = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=4096, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, 4, 0) = 0x120000
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Segmentation fault


I would appreciate any kind help offered.

Thanks,
MJ

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2011-04-22 15:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-22 15:43 MJ [this message]
2011-04-25 10:23 ` Sascha Hauer
2011-04-25 12:11   ` MJ

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=BANLkTik_geZ4hpcXTdN81DEgcOeqRZT8UA@mail.gmail.com \
    --to=mjainp@gmail.com \
    --cc=barebox@lists.infradead.org \
    /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