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