Segmentation fault when using more than 1 'kernel' protocol in the config.

James Harper james.harper at bendigoit.com.au
Tue Aug 14 12:47:38 CEST 2007


Did some investigating, and this patch fixes the problem for me:

"
diff -ur bird-1.0.11.old/sysdep/unix/krt.c bird-1.0.11/sysdep/unix/krt.c
--- bird-1.0.11.old/sysdep/unix/krt.c   2004-06-08 02:51:23.000000000
+1000
+++ bird-1.0.11/sysdep/unix/krt.c       2007-08-14 20:41:20.000000000
+1000
@@ -769,9 +769,9 @@
 #ifdef CONFIG_ALL_TABLES_AT_ONCE
   if (first)
     krt_scan_timer = krt_start_timer(p);
-  else
-    tm_start(p->scan_timer, 0);
   p->scan_timer = krt_scan_timer;
+  if (first)
+    tm_start(p->scan_timer, 0);
 #else
   p->scan_timer = krt_start_timer(p);
 #endif
"

tm_start(p->scan_timer, 0) was being called before p->scan_timer was set
when the second kernel protocol was set up.

I'm not entirely sure if the 'if (first)' I added is even required, or
if the krt_start_timer(p) is sufficient...

James

> -----Original Message-----
> From: James Harper
> Sent: Tuesday, 14 August 2007 16:51
> To: 'bird-users at network.cz'
> Subject: Segmentation fault when using more than 1 'kernel' protocol
in
> the config.
> 
> If I define more than 1 'kernel' protocol in the config I get a
> Segmentation fault when starting bird.
> 
> The following are the definitions from the config:
> 
> "
> protocol kernel kern1 {
>  learn;                  # Learn all alien routes from the kernel
>  persist;                # Don't remove routes on bird shutdown
>  scan time 20;           # Scan kernel routing table every 20 seconds
>  import all;             # Default is import all
>  export all;             # Default is export none
> }
> 
> protocol kernel kern2 {
>  table dsl;
>  kernel table 100;
>  scan time 20;
>  export all;
> }
> "
> 
> The final lines from an strace are:
> 
> "
> read(4, "", 8192)                       = 0
> socket(PF_NETLINK, SOCK_RAW, 0)         = 6
> socket(PF_NETLINK, SOCK_RAW, 0)         = 7
> bind(7, {sa_family=AF_NETLINK, pid=0, groups=00000051}, 12) = 0
> fcntl64(7, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
> --- SIGSEGV (Segmentation fault) @ 0 (0) ---
> +++ killed by SIGSEGV +++
> "
> 
> But I haven't yet figured out exactly where in the code it is going
> wrong... any assistance would be greatly appreciated!
> 
> My system is Debian 'Etch' running the 2.6.18-4-486 kernel. I can
supply
> any further information as required.
> 
> Thanks
> 
> James
> 




More information about the Bird-users mailing list