> 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.

Yes, I am but it doesn't work. I guess this might be a bug in configure or the 
makefile?

Running make clean requires to build everything again, which takes some minutes.

> > ==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?

It does not stop, but seems to stay in a "numb" state.

But if running outside of Valgrind it seems to run OK.

> To check for that problem, start Valgrind with vgdb enabled as per:
> 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]
> 
> 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.

These are the results:

(gdb) monitor v.info memory
2,110,115,840 bytes have already been mmap-ed ANONYMOUS.
--50867-- core    :     8,388,608/    8,388,608 max/curr mmap'd, 0/0 
unsplit/split sb unmmap'd,      3,927,928/    3,804,944 max/curr,       23732/  
29302048 totalloc-blocks/bytes,       23720 searches 8 rzB
--50867-- dinfo   :    26,296,320/   19,283,968 max/curr mmap'd, 2/15 
unsplit/split sb unmmap'd,     25,664,864/   16,859,824 max/curr,      331843/ 
102928896 totalloc-blocks/bytes,      346351 searches 8 rzB
--50867-- client  :     4,194,304/    4,194,304 max/curr mmap'd, 0/0 
unsplit/split sb unmmap'd,      1,738,032/    1,738,032 max/curr,          11/  
 1738032 totalloc-blocks/bytes,          10 searches 24 rzB
--50867-- demangle:        65,536/       65,536 max/curr mmap'd, 0/0 
unsplit/split sb unmmap'd,            800/          544 max/curr,          24/  
    3584 totalloc-blocks/bytes,          23 searches 8 rzB
--50867-- ttaux   :       221,184/      221,184 max/curr mmap'd, 0/1 
unsplit/split sb unmmap'd,        167,616/      115,584 max/curr,         695/  
  306496 totalloc-blocks/bytes,         694 searches 8 rzB

(gdb) monitor v.info memory aspacemgr
2,110,115,840 bytes have already been mmap-ed ANONYMOUS.
--50867-- core    :     8,388,608/    8,388,608 max/curr mmap'd, 0/0 
unsplit/split sb unmmap'd,      3,927,928/    3,804,944 max/curr,       23747/  
29435632 totalloc-blocks/bytes,       23735 searches 8 rzB
--50867-- dinfo   :    26,296,320/   19,283,968 max/curr mmap'd, 2/15 
unsplit/split sb unmmap'd,     25,664,864/   16,859,824 max/curr,      331843/ 
102928896 totalloc-blocks/bytes,      346351 searches 8 rzB
--50867-- client  :     4,194,304/    4,194,304 max/curr mmap'd, 0/0 
unsplit/split sb unmmap'd,      1,738,032/    1,738,032 max/curr,          11/  
 1738032 totalloc-blocks/bytes,          10 searches 24 rzB
--50867-- demangle:        65,536/       65,536 max/curr mmap'd, 0/0 
unsplit/split sb unmmap'd,            800/          544 max/curr,          24/  
    3584 totalloc-blocks/bytes,          23 searches 8 rzB
--50867-- ttaux   :       221,184/      221,184 max/curr mmap'd, 0/1 
unsplit/split sb unmmap'd,        167,616/      115,584 max/curr,         695/  
  306496 totalloc-blocks/bytes,         694 searches 8 rzB

(gdb) p $rsp
$1 = (access void) 0x78972b18

(gdb) disas
Dump of assembler code for function system__stack_usage__fill_stack:
   0x000000000078bae0 <+0>:     movslq 0x2c(%rdi),%rdx
   0x000000000078bae4 <+4>:     mov    0x20(%rdi),%rsi
   0x000000000078bae8 <+8>:     lea    -0xc(%rsp),%r8
   0x000000000078baed <+13>:    mov    %rsi,%rcx
   0x000000000078baf0 <+16>:    sub    %rdx,%rcx
   0x000000000078baf3 <+19>:    mov    %rdx,%rax
   0x000000000078baf6 <+22>:    lea    -0x10c(%rsp),%rdx
   0x000000000078bafe <+30>:    cmp    %rdx,%rcx
   0x000000000078bb01 <+33>:    ja     0x78bb40 
<system__stack_usage__fill_stack+96>
   0x000000000078bb03 <+35>:    cmp    %rdx,%rsi
   0x000000000078bb06 <+38>:    mov    %rcx,0x38(%rdi)
   0x000000000078bb0a <+42>:    jbe    0x78bb18 
<system__stack_usage__fill_stack+56>
   0x000000000078bb0c <+44>:    lea    -0x100(%r8),%eax
   0x000000000078bb13 <+51>:    sub    %ecx,%eax
   0x000000000078bb15 <+53>:    mov    %eax,0x2c(%rdi)
   0x000000000078bb18 <+56>:    lea    0x3(%rax),%edx
   0x000000000078bb1b <+59>:    test   %eax,%eax
   0x000000000078bb1d <+61>:    mov    %rcx,0x48(%rdi)
   0x000000000078bb21 <+65>:    cmovns %eax,%edx
   0x000000000078bb24 <+68>:    sar    $0x2,%edx
   0x000000000078bb27 <+71>:    test   %edx,%edx
   0x000000000078bb29 <+73>:    movslq %edx,%rax
   0x000000000078bb2c <+76>:    jle    0x78bb3d 
<system__stack_usage__fill_stack+93>
   0x000000000078bb2e <+78>:    xchg   %ax,%ax
   0x000000000078bb30 <+80>:    mov    0x30(%rdi),%edx
=> 0x000000000078bb33 <+83>:    mov    %edx,-0x4(%rcx,%rax,4)
   0x000000000078bb37 <+87>:    sub    $0x1,%rax
   0x000000000078bb3b <+91>:    jne    0x78bb30 
<system__stack_usage__fill_stack+80>
   0x000000000078bb3d <+93>:    retq   
   0x000000000078bb3e <+94>:    xchg   %ax,%ax
   0x000000000078bb40 <+96>:    movl   $0x0,0x2c(%rdi)
   0x000000000078bb47 <+103>:   retq   
End of assembler dump.

I've never gone so deep in analyzing Valgrind's output, so this is a bit 
unknown to me :P

> 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)? 

It's from what I said before: in this program all memory is allocated 
statically. No dynamic memory allocation is allowed. This, in Ada/SPARK. The 
C/C++ parts, which relate to the utilization of libxerces may use dynamic 
memory. This is the part we want to analyze.

So every bit of memory that the program needs is allocated from the beginning. 
For instance, the arrays are allocated with the worst case length.

João M. S. Silva
------------------------------------------------------------------------------
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