Okay, so with a small test program

hello.c:
#include <stdio.h>
int main(int argc, char* argv) {
        printf("Hello world\n");
        return 0;
}

Compiled in 32 bit mode:
gcc -g -m32 hello.c -o hello

We get a segfault trying to run it:
$ ./hello 
Segmentation fault

If we run in gdb:
Program received signal SIGTRAP, Trace/breakpoint trap.
0xf7f04bb8 in ?? ()

  nexti
Program received signal SIGSEGV, Segmentation fault.
0xf7f83bb8 in ?? ()

strace output:
execve("./hello", ["./hello"], [/* 39 vars */]) = 0
[ Process PID=25021 runs in 32 bit mode. ]
brk(0)                                  = 0x8ea8000
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) = 
0xfffffffff7f16000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(0x3, 0xffb37094)                = 0
mmap2(NULL, 88486, PROT_READ, MAP_PRIVATE, 3, 0) = 0xfffffffff7f00000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib32/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\0\340g\1"..., 512) = 512
fstat64(0x3, 0xffb3710c)                = 0
mmap2(NULL, 1431152, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0xfffffffff7da2000
mmap2(0xf7efa000, 12288, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x158) = 0xfffffffff7efa000
mmap2(0xf7efd000, 9840, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xfffffffff7efd000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0xfffffffff7da1000
set_thread_area(0xffb37610)             = 0
mprotect(0xf7efa000, 8192, PROT_READ)   = 0
mprotect(0x8049000, 4096, PROT_READ)    = 0
mprotect(0xf7f37000, 4096, PROT_READ)   = 0
munmap(0xf7f00000, 88486)               = 0
fstat64(0x1, 0xffb37744)                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0xfffffffff7f15000
write(1, "Hello world\n", 12Hello world
)           = 12
exit_group(0)                           = ?
Process 25021 detached

valgrind -v ./hello:
--25035-- Command line
--25035--    ./hello
--25035-- Startup, with flags:
--25035--    --suppressions=/usr/lib/valgrind/debian-libc6-dbg.supp
--25035--    -v
--25035-- Contents of /proc/version:
--25035--   Linux version 2.6.27-7-server ([EMAIL PROTECTED]) (gcc version 
4.3.2 (Ubuntu 4.3.2-1ubuntu10) ) #1 SMP Fri Oct 24 07:20:47 UTC 2008
--25035-- Arch and hwcaps: X86, x86-sse1-sse2
--25035-- Page sizes: currently 4096, max supported 4096
--25035-- Valgrind library directory: /usr/lib/valgrind
--25035-- Reading syms from /lib32/ld-2.8.90.so (0x4400000)
--25035-- Reading debug info from /lib32/ld-2.8.90.so...
--25035-- ... CRC mismatch (computed 2623f3eb wanted 13913aec)
--25035-- Reading debug info from /usr/lib/debug/lib32/ld-2.8.90.so...
--25035-- Reading syms from /home/barfoo/arnoldp/tmp/hello (0x8048000)
--25035-- Reading syms from /usr/lib/valgrind/x86-linux/memcheck (0x38000000)
--25035--    object doesn't have a dynamic symbol table
--25035-- Reading suppressions file: /usr/lib/valgrind/debian-libc6-dbg.supp
--25035-- Reading suppressions file: /usr/lib/valgrind/default.supp
--25035-- REDIR: 0x4418860 (index) redirected to 0x3802cf83 
(vgPlain_x86_linux_REDIR_FOR_index)
--25035-- Reading syms from /usr/lib/valgrind/x86-linux/vgpreload_core.so 
(0x46D9000)
--25035-- Reading syms from /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so 
(0x46DD000)
==25035== WARNING: new redirection conflicts with existing -- ignoring it
--25035--     new: 0x04418860 (index               ) R-> 0x046e11a0 index
--25035-- REDIR: 0x4418a30 (strlen) redirected to 0x46e1450 (strlen)
--25035-- Reading syms from /lib32/libc-2.8.90.so (0x4703000)
--25035-- Reading debug info from /lib32/libc-2.8.90.so...
--25035-- ... CRC mismatch (computed 76c224e5 wanted 9e890f80)
--25035-- Reading debug info from /usr/lib/debug/lib32/libc-2.8.90.so...
--25035-- REDIR: 0x477b350 (rindex) redirected to 0x46e1080 (rindex)
--25035-- REDIR: 0x477aed0 (strlen) redirected to 0x46e1430 (strlen)
Hello world
--25035-- REDIR: 0x4774fe0 (free) redirected to 0x46dfa90 (free)
==25035== 
==25035== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 11 from 1)
--25035-- 
--25035-- supp:     11 dl-hack3-cond-1
==25035== malloc/free: in use at exit: 0 bytes in 0 blocks.
==25035== malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
==25035== 
==25035== All heap blocks were freed -- no leaks are possible.
--25035--  memcheck: sanity checks: 0 cheap, 1 expensive
--25035--  memcheck: auxmaps: 0 auxmap entries (0k, 0M) in use
--25035--  memcheck: auxmaps_L1: 0 searches, 0 cmps, ratio 0:10
--25035--  memcheck: auxmaps_L2: 0 searches, 0 nodes
--25035--  memcheck: SMs: n_issued      = 11 (176k, 0M)
--25035--  memcheck: SMs: n_deissued    = 0 (0k, 0M)
--25035--  memcheck: SMs: max_noaccess  = 65535 (1048560k, 1023M)
--25035--  memcheck: SMs: max_undefined = 0 (0k, 0M)
--25035--  memcheck: SMs: max_defined   = 22 (352k, 0M)
--25035--  memcheck: SMs: max_non_DSM   = 11 (176k, 0M)
--25035--  memcheck: max sec V bit nodes:    0 (0k, 0M)
--25035--  memcheck: set_sec_vbits8 calls: 0 (new: 0, updates: 0)
--25035--  memcheck: max shadow mem size:   480k, 0M
--25035-- translate:            fast SP updates identified: 1,646 ( 89.6%)
--25035-- translate:   generic_known SP updates identified: 101 (  5.5%)
--25035-- translate: generic_unknown SP updates identified: 89 (  4.8%)
--25035--     tt/tc: 3,789 tt lookups requiring 3,837 probes
--25035--     tt/tc: 3,789 fast-cache updates, 3 flushes
--25035--  transtab: new        1,776 (38,256 -> 549,582; ratio 143:10) [0 scs]
--25035--  transtab: dumped     0 (0 -> ??)
--25035--  transtab: discarded  8 (194 -> ??)
--25035-- scheduler: 22,282 jumps (bb entries).
--25035-- scheduler: 0/2,092 major/minor sched events.
--25035--    sanity: 1 cheap, 1 expensive checks.
--25035--    exectx: 769 lists, 6 contexts (avg 0 per list)
--25035--    exectx: 11 searches, 5 full compares (454 per 1000)
--25035--    exectx: 0 cmp2, 26 cmp4, 0 cmpAll
--25035--  errormgr: 6 supplist searches, 91 comparisons during search
--25035--  errormgr: 11 errlist searches, 26 comparisons during search

I am happy to provide any more debugging information need.

Paul

-- 
IA32 emulation mode does not work with 2.6.27-7-virtual running under Xen on 
AMD64
https://bugs.launchpad.net/bugs/290281
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to