2017-12-05 11:42 GMT+01:00 Silva João <joao.si...@altran.com>:
> Hi,
>
> I was able to build Valgrind and run the program with value 0x7d000000:
>
>            valt_load_address_pri_norml="0x7d000000"
>            valt_load_address_pri_norml="0x7d000000"
>            valt_load_address_pri_norml="0x7d000000"
>            valt_load_address_sec_norml="0x7d000000"
>
> In order for this parameter in the .ac file to take effect I found out than 
> reapplying the patch you sent forces make to rebuild the executable correctly 
> (otherwise the change gets ignored, probably a bug in Valgrind configure.sh 
> or makefile).

Are you running ./autogen.sh && ./configure so that changes from
configure.ac get in effect?
You can also do 'make distclean' before './autogen.sh && ./configure'
so as to clean up everything.

> Now I get this, not sure whether the problem is real or comes from having 
> tweaked valt_load_address_*_norml:
...
> --44156:0: aspacem <<< SHOW_SEGMENTS: after #2 (25 segments)
> --44156:0: aspacem 3 segment names in 3 slots
> --44156:0: aspacem freelist is empty
> --44156:0: aspacem (0,4,3) 
> /home/AltranUK/jsilva.fs/lib/valgrind/memcheck-amd64-linux
> --44156:0: aspacem (1,67,3) /u/wh/rel/ifaplrel/pw_fwp_engine.eab
> --44156:0: aspacem (2,108,3) /usr/lib64/ld-2.17.so
> --44156:0: aspacem   0: RSVN 0000000000-00003fffff 4194304 ----- SmFixed
> --44156:0: aspacem   1: file 0000400000-00008adfff 4907008 r-x-- d=0xfd00 
> i=712737  o=0       (1,67)
> --44156:0: aspacem   2: RSVN 00008ae000-0000aacfff 2093056 ----- SmFixed
> --44156:0: aspacem   3: file 0000aad000-0000ab1fff   20480 rw--- d=0xfd00 
> i=712737  o=4902912 (1,67)
> --44156:0: aspacem   4: anon 0000ab2000-0078832fff   1917m rw---
> --44156:0: aspacem   5: file 0078833000-0078852fff  131072 r-x-- d=0xfd00 
> i=201446298 o=0       (2,108)
> --44156:0: aspacem   6:      0078853000-0078a52fff 2097152
> --44156:0: aspacem   7: file 0078a53000-0078a54fff    8192 rw--- d=0xfd00 
> i=201446298 o=131072  (2,108)
> --44156:0: aspacem   8: anon 0078a55000-0078a55fff    4096 rw---
> --44156:0: aspacem   9:      0078a56000-007cffffff     69m
> --44156:0: aspacem  10: FILE 007d000000-007d27cfff 2609152 r-x-- d=0xfd02 
> i=2648346 o=0       (0,4)
> --44156:0: aspacem  11:      007d27d000-007d47cfff 2097152
> --44156:0: aspacem  12: FILE 007d47d000-007d47ffff   12288 rw--- d=0xfd02 
> i=2648346 o=2609152 (0,4)
> --44156:0: aspacem  13: ANON 007d480000-007ee81fff     26m rw---
> --44156:0: aspacem  14:      007ee82000-1001ffffff  63537m
> --44156:0: aspacem  15: RSVN 1002000000-1002000fff    4096 ----- SmFixed
> --44156:0: aspacem  16: ANON 1002001000-1002400fff 4194304 rwx--
> --44156:0: aspacem  17:      1002401000-1fffffffff  65499m
> --44156:0: aspacem  18: RSVN 2000000000-7ffe2448efff 130936g ----- SmFixed
> --44156:0: aspacem  19: ANON 7ffe2448f000-7ffe244b0fff  139264 rw---
> --44156:0: aspacem  20: RSVN 7ffe244b1000-7ffe24527fff  487424 ----- SmFixed
> --44156:0: aspacem  21: ANON 7ffe24528000-7ffe24529fff    8192 r-x--
> --44156:0: aspacem  22: RSVN 7ffe2452a000-ffffffffff5fffff  16383e ----- 
> SmFixed
> --44156:0: aspacem  23: ANON ffffffffff600000-ffffffffff600fff    4096 r-x--
> --44156:0: aspacem  24: RSVN ffffffffff601000-ffffffffffffffff      9m ----- 
> SmFixed
> --44156:0: aspacem >>>
> ==44156== Memcheck, a memory error detector
> ==44156== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
> ==44156== Using Valgrind-3.14.0.GIT and LibVEX; rerun with -h for copyright 
> info
> ==44156== Command: /u/wh/rel/ifaplrel/pw_fwp_engine.eab
> ==44156==
> ==44156== Warning: set address range perms: large range [0xab2000, 
> 0x78833000) (defined)

This is expected due to ~1,7 GB of BSS (see segment 4.).

> ==44156== Thread 2 FDP_MRP_Recover_:
> ==44156== Invalid write of size 4
> ==44156==    at 0x78BB33: system__stack_usage__fill_stack (in 
> /u/wh/rel/ifaplrel/pw_fwp_engine.eab)
> ==44156==    by 0x75C49B: system__tasking__stages__task_wrapper (in 
> /u/wh/rel/ifaplrel/pw_fwp_engine.eab)
> ==44156==    by 0x79E1CDC4: start_thread (in /usr/lib64/libpthread-2.17.so)
> ==44156==    by 0x7ADCC76C: clone (in /usr/lib64/libc-2.17.so)
> ==44156==  Address 0x78972a08 is on thread 2's stack
> ==44156==  272 bytes below stack pointer

This is probably a valid complaint.
Does the program complete afterwards?

To check for that problem, start Valgrind with vgdb enabled as per:
http://valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.gdbserver
Assuming this problem is the first one reported, pass "--vgdb-error=1".

After gdb stops on encountering that particular problem, print the
Valgrind address space layout (SEGMENTS) with:
(gdb) monitor v.info memory [aspacemgr]
(as per 
http://valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.valgrind-monitor-commands)

Also print the registers, in particular stack pointer (rsp) and the
function disassembly (disas in gdb).

You can either correlate this output by yourself or post it here.

Good luck!
I.

P.S. I would rather double check again why pw_fwp_engine.eab is
allocating such as huge BSS segment. That executable is quite a tiny
one (approx 4MB file size)?

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to