Dear Maintainer,
I tried to find out where this stack in message #25
would point to, if it may help.

The failing call to free, I guess, would be in
function rotateLogSet in logrotate.c, line 1749.

1748        for (i = 0; i < log->numFiles; i++) {
1749            free(rotNames[i]->firstRotated);   <<<<
1750            free(rotNames[i]->disposeName);
1751            free(rotNames[i]->finalName);
1752            free(rotNames[i]->dirName);
1753            free(rotNames[i]->baseName);
1754            free(rotNames[i]);
1755        }

Kind regards,
Bernhard

From https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=818793#25


======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x71ff5)[0x7f6bcc5f3ff5]
/lib/x86_64-linux-gnu/libc.so.6(+0x77946)[0x7f6bcc5f9946]
/lib/x86_64-linux-gnu/libc.so.6(+0x7812e)[0x7f6bcc5fa12e]
logrotate[0x407aa4]
logrotate[0x402f9c]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f6bcc5a2610]
logrotate[0x4036b2]
======= Memory map: ========



"debian stretch/sid" at "25 Mar 2016" ?

...
https://tracker.debian.org/pkg/logrotate
[2017-01-03] Accepted logrotate 3.11.0-0.1~exp1 (source powerpc) into 
experimental (Christoph Biedl)
[2015-08-24] Accepted logrotate 3.9.1-1~exp1 (source amd64) into experimental 
(Paul Martin)
[2015-05-16] logrotate 3.8.7-2 MIGRATED to testing (Britney)


-> logrotate 3.8.7-2 ?


#############



# Jessie amd64 qemu VM


approx:
debian-9-stretch-snapshot.debian.org                
https://snapshot.debian.org/archive/debian/20160325T000000Z/
#debian-9-stretch-debug-snapshot.debian.org          
https://snapshot.debian.org/archive/debian-debug/20160325T000000Z/

sources.list:
# snapshot
deb     [check-valid-until=no] 
http://192.168.178.25:9999/debian-9-stretch-snapshot.debian.org/ stretch main
#deb-src [check-valid-until=no] 
http://192.168.178.25:9999/debian-9-stretch-snapshot.debian.org/ stretch main
#deb     [check-valid-until=no] 
http://192.168.178.25:9999/debian-9-stretch-debug-snapshot.debian.org/ 
stretch-debug main



apt-get -o Acquire::Check-Valid-Until=false -o Acquire::Languages=none update
apt dist-upgrade
reboot




apt install gdb libc6-dbg
apt install dpkg-dev devscripts
apt build-dep logrotate




mkdir source/logrotate/orig -p
cd    source/logrotate/orig
apt source logrotate
cd

cd source/logrotate
cp orig try1 -a
cd try1/logrotate-3.8.7
dpkg-buildpackage


#############


gdb -q --args /usr/sbin/logrotate
set width 0
set pagination off
set backtrace past-main on
display/i $pc
b __libc_start_main
run
print __libc_start_main+238
b *$1
cont
stepi


   0x0000000000407a9f:  callq  0x402290 <free@plt>
   0x0000000000407aa4:  mov    0x8(%r13),%rdi

   0x0000000000402f97:  callq  0x407310
   0x0000000000402f9c:  mov    0xd8(%rbx),%rbx

   0x00007ffff741f60e <__libc_start_main+238>:  callq  *%rax
=> 0x00007ffff741f610 <__libc_start_main+240>:  mov    %eax,%edi

   0x00000000004036ad:  callq  0x402570 <__libc_start_main@plt>
=> 0x00000000004036b2:  hlt    





#############


gdb -q --args /home/benutzer/source/logrotate/try1/logrotate-3.8.7/logrotate
set width 0
set pagination off
set backtrace past-main on
display/i $pc
b main
run


   0x0000000000407a37 <rotateLogSet+1911>:      callq  0x402280 <free@plt>
   0x0000000000407a3c <rotateLogSet+1916>:      mov    0x8(%r13),%rdi

   0x0000000000402f7b <main+907>:       callq  0x4072c0 <rotateLogSet>
   0x0000000000402f80 <main+912>:       mov    0xd8(%rbx),%rbx

   0x00007ffff741f60e <__libc_start_main+238>:  callq  *%rax
=> 0x00007ffff741f610 <__libc_start_main+240>:  mov    %eax,%edi

   0x00000000004036b4 <_start+36>:      callq  0x402560 <__libc_start_main@plt>
=> 0x00000000004036b9 <_start+41>:      hlt    




1748        for (i = 0; i < log->numFiles; i++) {
   0x0000000000407a16 <+1878>:  xor    %r14d,%r14d
   0x0000000000407a19 <+1881>:  test   %eax,%eax
   0x0000000000407a1b <+1883>:  mov    -0x90(%rbp),%r15
   0x0000000000407a22 <+1890>:  jle    0x407a6e <rotateLogSet+1966>
   0x0000000000407a24 <+1892>:  nopl   0x0(%rax)
   0x0000000000407a2b <+1899>:  add    $0x1,%r14d
   0x0000000000407a2f <+1903>:  add    $0x8,%r15
   0x0000000000407a68 <+1960>:  cmp    %r14d,0x10(%rbx)
   0x0000000000407a6c <+1964>:  jg     0x407a28 <rotateLogSet+1896>

1749            free(rotNames[i]->firstRotated);
   0x0000000000407a28 <+1896>:  mov    (%r15),%r13
   0x0000000000407a33 <+1907>:  mov    0x0(%r13),%rdi
   0x0000000000407a37 <+1911>:  callq  0x402280 <free@plt>

1750            free(rotNames[i]->disposeName);
   0x0000000000407a3c <+1916>:  mov    0x8(%r13),%rdi
   0x0000000000407a40 <+1920>:  callq  0x402280 <free@plt>

1751            free(rotNames[i]->finalName);
   0x0000000000407a45 <+1925>:  mov    0x10(%r13),%rdi
   0x0000000000407a49 <+1929>:  callq  0x402280 <free@plt>

1752            free(rotNames[i]->dirName);





0x407a37: file logrotate.c, line 1749.




(gdb) list logrotate.c:1740,1760
1740                    logHasErrors[i] |=
1741                        postrotateSingleLog(log, i, state[i], rotNames[i]);
1742                    hasErrors |= logHasErrors[i];
1743                }
1744            }
1745
1746        }
1747
1748        for (i = 0; i < log->numFiles; i++) {
1749            free(rotNames[i]->firstRotated);
1750            free(rotNames[i]->disposeName);
1751            free(rotNames[i]->finalName);
1752            free(rotNames[i]->dirName);
1753            free(rotNames[i]->baseName);
1754            free(rotNames[i]);
1755        }
1756        free(rotNames);
1757        free(state);
1758
1759        if (log->last) {
1760            if (!numRotated) {




#############





Reply via email to