Mailing List Archive

ospfd terminates after deleting last network command?
Hello

I have a reproducible ospfd crash whenever I delete the last network
command. Surely, ospf does not make much sense without it but the daemon
should at least give the a chance to enter new one...

[.update: the problem exists when I install the current Debian unstable
package but vanished after recompiling it locally. If someone wants to
track down the problem I can supply the relevant binaries.. the crashing
binary sadly has no debugging information so gdb only tells that the
error happens during a strcpy() call.]

!
router ospf
redistribute connected
redistribute static
network 10.0.0.0/24 area 0.0.0.0
!

# telnet localhost ospfd
...
test-ospfd# configure terminal
test-ospfd(config)# router ospf
test-ospfd(config-router)# no network 10.0.0.0/24 area 0.0.0.0
test-ospfd(config-router)# Connection closed by foreign host.

The log file, with all debug options enabled, shows the following last
words:
2003/12/08 12:03:05 OSPF: ospf_process_stub(): we have 0 links to process
2003/12/08 12:03:05 OSPF: children of V:
2003/12/08 12:03:05 OSPF: ospf_spf_calculate: Stop
2003/12/08 12:03:05 OSPF: ospf_ia_routing():start
2003/12/08 12:03:05 OSPF: ospf_ia_routing():not ABR, considering all areas
2003/12/08 12:03:05 OSPF: Pruning unreachable networks
2003/12/08 12:03:05 OSPF: Pruning unreachable routers

After that only zebra is left in the process list.

bye,

-christian-

--
Christian Hammers WESTEND GmbH | Internet-Business-Provider
Technik CISCO Systems Partner - Authorized Reseller
Lütticher Straße 10 Tel 0241/701333-11
ch@westend.com D-52064 Aachen Fax 0241/911879
Re: ospfd terminates after deleting last network command? [ In reply to ]
Hello

On Mon, Dec 08, 2003 at 03:04:22PM +0000, Paul Jakma wrote:
> > Is this easily reproducible? If yes, can you create a binary that
> > is debuggable (easiest way is to edit the ospfd/Makefile so that it
> > has "CFLAGS = -g" only and nothing else) and then try to produce a
> > dump?
>
> Also, can you try with the patch in [quagga-dev 385]? (which
> essentially causes interfaces to not be deleted).

Without further patching yet, I managed it to compile quagga on my home
computer and let it crash on my work computer by removing the last
network statement in ospf.

Sadly the program does not crash if I add too much debugging statements
before those lines so I think it's some kind of stack overflow where my
additional code protects the real code from beeing overwritten
(hm, code overwrites should be impossible on i386+, maybe the printf
format string is what is protecting here?)

At least I got the following in my syslog:
Dec 9 10:50:52 xeniac ospfd[2186]: #42# i=0 ifindex_num=1
Dec 9 10:50:52 xeniac ospfd[2186]: #42# ZNEXTHOPINDEX=1
maybe it helps.

I try not to update those both computers for the next couple of days :)

Here is what gdb says:

root@xeniac:/home/ch# gdb ./ospfd
GNU gdb 6.0-debian
Copyright 2003 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 "i386-linux"...
(gdb) run
Starting program: /home/ch/ospfd

Program received signal SIGSEGV, Segmentation fault.
0x0809e287 in zapi_ipv4_delete (zclient=0x8142160, p=0x8175448, api=0xbffff7c0)
at zclient.c:396
396 zclient.c: Datei oder Verzeichnis nicht gefunden.
in zclient.c
(gdb) bt
#0 0x0809e287 in zapi_ipv4_delete (zclient=0x8142160, p=0x8175448,
api=0xbffff7c0) at zclient.c:396
#1 0x0804d8d6 in ospf_zebra_delete (p=0x8175440, or=0x19) at ospf_zebra.c:445
#2 0x08062964 in ospf_route_delete_uniq (rt=0x19, cmprt=0x8174b58)
at ospf_route.c:226
#3 0x08062a53 in ospf_route_install (ospf=0x8173390, rt=0x8174b58)
at ospf_route.c:252
#4 0x08062416 in ospf_spf_calculate_timer (thread=0x19) at ospf_spf.c:1076
#5 0x080910a5 in thread_call (thread=0xbffff940) at thread.c:810
#6 0x0804a79d in main (argc=1, argv=0xbffff940) at ospf_main.c:336



--
Christian Hammers WESTEND GmbH | Internet-Business-Provider
Technik CISCO Systems Partner - Authorized Reseller
Lütticher Straße 10 Tel 0241/701333-11
ch@westend.com D-52064 Aachen Fax 0241/911879