Bug#298709: chrony: just segfaults on amd64

2005-10-25 Thread g . bonacci
Hi John, 
would you mind applying the following patch, rebuilding and re-uploading? 
maybe we finally converged, thanks the infinite patience of Felix. 
-- gb

From: Felix Zielcke <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: Re: chrony: just segfaults on amd64
Date: Tue, 25 Oct 2005 18:23:58 +0200

>now I think the attached patch (to be applied to the pristine chrony 
>sources) should solve the issue.  

it did. now chrony doestn't segfault anymore and seems to work :)

From: [EMAIL PROTECTED]
To: Felix Zielcke <[EMAIL PROTECTED]>
Subject: Re: chrony: just segfaults on amd64

thank you, Felix.  

After exploring the code a bit more closely, I found out

1. that I made a stupid mistake (I added an indirection level,
   but the code was designed another way);

2. why the resulting buggy executable did not segfault on my server
   (because of my config file, some of the functions in addrfilt.c were
   not called --- in particular, open_node() was never called).

now I think the attached patch (to be applied to the pristine chrony
sources) should solve the issue.  

may I ask you to recompile and test this new patch? I attach both the
patch and the modified addrfilt.c, in case you cannot easily apply the
patch.

best regards.



--- /tmp/chrony-1.20.old/addrfilt.c 2005-10-25 12:45:15.561893000 +0200
+++ /tmp/chrony-1.20/addrfilt.c 2005-10-25 13:01:13.391766233 +0200
@@ -43,17 +43,15 @@
 /* Define the table size */
 #define TABLE_SIZE (1ULextended + i;
   close_node(child_node);
 }
 Free(node->extended);
@@ -125,10 +123,10 @@
 
   if (node->extended == NULL) {
 
-  node->extended = MallocArray(ExtendedTable, TABLE_SIZE);
+  node->extended = (TableNode *) MallocArray(ExtendedTable, TABLE_SIZE);
 
 for (i=0; iextended))[i]);
+  child_node = node->extended + i;
   child_node->state = AS_PARENT;
   child_node->extended = NULL;
 }
@@ -169,7 +167,7 @@
 if (!(node->extended)) {
   open_node(node);
 }
-node = &((*(node->extended))[subnet]);
+node = node->extended + subnet;
 bits_to_go -= NBITS;
   }
 
@@ -188,7 +186,7 @@
 if (!(node->extended)) {
   open_node(node);
 }
-node = &((*(node->extended))[subnet]);
+node = node->extended + subnet;
 bits_to_go -= NBITS;
   }
 
@@ -200,7 +198,7 @@
   }
   
   for (i=subnet, j=0; jextended))[i]);
+this_node = node->extended + i;
 if (delete_children) {
   close_node(this_node);
 }
@@ -284,7 +282,7 @@
 if (node->extended) {
   subnet = get_subnet(residual);
   residual = get_residual(residual);
-  node = &((*(node->extended))[subnet]);
+  node = node->extended + subnet;
 } else {
   /* Make decision on this node */
   finished = 1;





-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#298709: chrony: just segfaults on amd64

2005-10-24 Thread Felix Zielcke
John Hasler writes:This may actually be useful.
>This may actually be useful.

Ok. Now i know that, too.
by the way: this is my first bug report on debian bts ever :)

[EMAIL PROTECTED] writes:

> - cd /tmp/ ; apt-get source chrony ; cd chrony-1.20
> - build with
>   DEB_BUILD_OPTIONS=nostrip dpkg-buildpackage -rfakeroot -b

that worked now fine :)
the other package was already self compiled but i'm not so familiar with the 
debian build system
here now a bt and a bt full:

Program received signal SIGSEGV, Segmentation fault.
open_node (node=0x5280f0) at addrfilt.c:130
130   child_node->state = AS_PARENT;
(gdb) bt
#0  open_node (node=0x5280f0) at addrfilt.c:130
#1  0x004113d1 in set_subnet (start_node=Variable "start_node" is not 
available.
) at addrfilt.c:168
#2  0x0040585d in NCR_AddAccessRestriction (ip_addr=Variable "ip_addr" 
is not available.
) at ntp_core.c:1800
#3  0x0040c991 in CNF_SetupAccessRestrictions () at conf.c:1172
#4  0x00404552 in post_acquire_hook (anything=Variable "anything" is 
not available.
) at main.c:134
#5  0x00404883 in main (argc=0, argv=0x7fbe1ec8) at main.c:292
(gdb) bt full
#0  open_node (node=0x5280f0) at addrfilt.c:130
child_node = (TableNode *) 0x0
#1  0x004113d1 in set_subnet (start_node=Variable "start_node" is not 
available.
) at addrfilt.c:168
N = Variable "N" is not available.
(gdb)  


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#298709: chrony: just segfaults on amd64

2005-10-24 Thread John Hasler
Felix writes:
> as i said nothing useful

This may actually be useful.
-- 
John Hasler 
[EMAIL PROTECTED]
Elmwood, WI USA


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#298709: chrony: just segfaults on amd64

2005-10-24 Thread g . bonacci
On Mon, Oct 24, 2005 at 08:28:43PM +0200, Felix Zielcke wrote:
> as i said nothing useful
> but i should have made this clearer on my first post :)
> but now the complete gdb output except the text cut off between the ...
> because it's just the same as the other lines
> 
this is no surprise, since the executable you are running is stripped.

if you want to help, you may recompile the package yourself, by
following these steps:

as root:
- install build-dependencies:
  fakeroot
  dpkg-dev
  build-essential
  libreadline4-dev
  bison
- put the relevant deb-src lines in your /etc/apt/sources.list
deb-src http://ftp.debian.org/debian etch main
deb-src http://security.debian.org   etch/updates main
  and apt-get update

as a regular user (not root):
- cd /tmp/ ; apt-get source chrony ; cd chrony-1.20
- build with 
  DEB_BUILD_OPTIONS=nostrip dpkg-buildpackage -rfakeroot -b

- install the package you just made (it's in /tmp), and rerun gdb.
  you can run gdb on the new executable without even installing
  (it's in /tmp/chrony-1.20/debian/tmp/usr/...)

I hope I did not forget anything...
best regards.
-- g.b.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#298709: chrony: just segfaults on amd64

2005-10-24 Thread Felix Zielcke
as i said nothing useful
but i should have made this clearer on my first post :)
but now the complete gdb output except the text cut off between the ...
because it's just the same as the other lines


penna-deb:/tmp# gdb /usr/sbin/chronyd
GNU gdb 6.3-debian
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-linux"...(no debugging symbols found)
Using host libthread_db library "/lib/libthread_db.so.1".

(gdb) r -d
Starting program: /usr/sbin/chronyd -d
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
sys_linux.c:649:(get_version_specific_details)[24-18:27:14] Initial 
txc.tick=1 txc.freq=0 (0.) txc.offset=0 => hz=100 shift_hz=7
sys_linux.c:665:(get_version_specific_details)[24-18:27:14] set_config_hz=0 
hz=100 shift_hz=7 basic_freq_scale=1.2800 nominal_tick=1 
slew_delta_tick=833 max_tick_bias=1000
sys_linux.c:703:(get_version_specific_details)[24-18:27:14] Linux kernel 
major=2 minor=6 patch=14
sys_linux.c:787:(get_version_specific_details)[24-18:27:14] 
calculated_freq_scale=0.99902439 freq_scale=0.99902439

Program received signal SIGSEGV, Segmentation fault.
0x004111e5 in ?? ()
(gdb) bt
#0  0x004111e5 in ?? ()
#1  0x004113d1 in ?? ()
#2  0x0040585d in ?? ()
#3  0x0040c991 in ?? ()
#4  0x00404552 in ?? ()
#5  0x00404883 in ?? ()
#6  0x2ad644ba in __libc_start_main () from /lib/libc.so.6
#7  0x00401aca in ?? ()
#8  0x7fa72868 in ?? ()
#9  0x2abc29c0 in ?? () from /lib64/ld-linux-x86-64.so.2
...
#237 0x3a42475f6e653a65 in ?? ()
#238 0x504f5f534c006e65 in ?? ()
#239 0x2d2d3d534e4f4954 in ?? ()
#240 0x75613d726f6c6f63 in ?? ()
#241 0x4c0068412d206f74 in ?? ()
#242 0x723d454d414e474f in ?? ()
#243 0x5f48535300746f6f in ?? ()
#244 0x495443454e4e4f43 in ?? ()
#245 0x2e302e30313d4e4f in ?? ()
#246 0x3439322030312e30 in ?? ()
#247 0x302e302e30312032 in ?? ()
#248 0x752f00323220392e in ?? ()
#249 0x2f6e6962732f7273 in ?? ()
#250 0x0064796e6f726863 in ?? ()
#251 0x in ?? ()
Cannot access memory at address 0x7fa73000
(gdb)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#298709: chrony: just segfaults on amd64

2005-10-24 Thread g . bonacci
hi. 
can you please provide a backtrace (command: bt) from gdb?
I suspect there's something wrong with other parts of the code.
thanks.
giuseppe



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#298709: chrony: just segfaults on amd64

2005-10-23 Thread John Hasler
Thank you for your report.  I expect to soon upload a version with a
slightly different patch.
-- 
John Hasler 
[EMAIL PROTECTED]
Elmwood, WI USA


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#298709: chrony: just segfaults on amd64

2005-10-23 Thread Felix Zielcke
Package: chrony
Version: 1.20-8
Followup-For: Bug #298709


Chrony just segfaults on amd64 with that patch.
Compiled with gcc 4.0.2 on testing.
gdb doestn't provide anything useful if I start it with the -d option
I tested it even with standard debian 2.6.8 kernel and gcc 3.4.5

(gdb) r -d
Starting program: /usr/sbin/chronyd -d
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
sys_linux.c:649:(get_version_specific_details)[23-07:07:48] Initial 
txc.tick=1 txc.freq=0 (0.) txc.offset=0 => hz=100 shift_hz=7
sys_linux.c:665:(get_version_specific_details)[23-07:07:48] set_config_hz=0 
hz=100 shift_hz=7 basic_freq_scale=1.2800 nominal_tick=1 
slew_delta_tick=833 max_tick_bias=1000
sys_linux.c:703:(get_version_specific_details)[23-07:07:48] Linux kernel 
major=2 minor=6 patch=13
sys_linux.c:787:(get_version_specific_details)[23-07:07:48] 
calculated_freq_scale=0.99902439 freq_scale=0.99902439

Program received signal SIGSEGV, Segmentation fault.
0x004111e5 in ?? ()
(gdb) 



-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.13
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages chrony depends on:
ii  libc6 2.3.5-6GNU C Library: Shared libraries 
an
ii  libncurses5   5.4-9  Shared libraries for terminal 
hand
ii  libreadline4  4.3-17 GNU readline and history 
libraries

chrony recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]