Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

frr/master :crash vnc at startup #825

Closed
pguibert6WIND opened this issue Jul 17, 2017 · 6 comments
Closed

frr/master :crash vnc at startup #825

pguibert6WIND opened this issue Jul 17, 2017 · 6 comments

Comments

@pguibert6WIND
Copy link
Member

pguibert6WIND commented Jul 17, 2017

compilation with enable-cumulus:

==== crash seen:

Program received signal SIGSEGV, Segmentation fault.
hash_get (hash=0x0, data=data@entry=0x7fffffffcf30, alloc_func=alloc_func@entry=0x0) at hash.c:160
160 key = (*hash->hash_key)(data);
(gdb) bt
#0 hash_get (hash=0x0, data=data@entry=0x7fffffffcf30, alloc_func=alloc_func@entry=0x0) at hash.c:160
#1 0x00007ffff7b84bca in route_node_get (table=0xae7b18, pu=..., pu@entry=...) at table.c:310
#2 0x0000000000472f8e in vnc_nve_group_prefix (self=, vty=0xaa9d40, argc=, argv=0xaa7230) at rfapi/bgp_rfapi_cfg.c:2536
#3 0x00007ffff7b7c10d in cmd_execute_command_real (vline=vline@entry=0xaa2690, vty=vty@entry=0xaa9d40, cmd=cmd@entry=0x0, filter=FILTER_STRICT) at command.c:935
#4 0x00007ffff7b7dc79 in cmd_execute_command_strict (vline=vline@entry=0xaa2690, vty=vty@entry=0xaa9d40, cmd=cmd@entry=0x0) at command.c:1030
#5 0x00007ffff7b7dcb6 in command_config_read_one_line (vty=vty@entry=0xaa9d40, cmd=cmd@entry=0x0, use_daemon=use_daemon@entry=0) at command.c:1061
#6 0x00007ffff7b7dde7 in config_from_file (vty=vty@entry=0xaa9d40, fp=fp@entry=0xaa9b00, line_num=line_num@entry=0x7fffffffd078) at command.c:1106
#7 0x00007ffff7b73f63 in vty_read_file (confp=0xaa9b00) at vty.c:2200
#8 vty_read_config (config_file=, config_default_dir=config_default_dir@entry=0x7094e0 <config_default> "/usr/local/etc//bgpd.conf") at vty.c:2375
#9 0x00007ffff7ba3d7c in frr_config_fork () at libfrr.c:382
#10 0x0000000000419b24 in main (argc=1, argv=0x7fffffffe2a8) at bgp_main.c:408
(gdb)
==== config used:
password zebra
log stdout
service advanced-vty
!
router bgp 64512
bgp router-id 192.168.1.101
neighbor 192.168.1.100 remote-as 64512
neighbor 192.168.1.104 remote-as 64512
address-family vpnv4
neighbor 192.168.1.100 activate
neighbor 192.168.1.104 activate
exit-address-family
vnc nve-group group1
prefix vn 172.16.0.0/17
rd 64512:1
response-lifetime 200
rt both 1000:1 1000:2
exit-vnc
exit

@eqvinox
Copy link
Contributor

eqvinox commented Jul 17, 2017

very likely (99,999%) caused by #794
maybe VNC is doing something weird with table initialisation...

first: did you do make clean for the entire code and recompile?

@pguibert6WIND
Copy link
Member Author

I reconfigured with enable-cumulus
I did not make make clean.
i will recheck

@eqvinox
Copy link
Contributor

eqvinox commented Jul 17, 2017

problem is that in:

struct rfapi_cfg {                                                              
...
	struct route_table nve_groups_vn[AFI_MAX];
	struct route_table nve_groups_un[AFI_MAX];

These two fields are not allocated with route_table_init_with_delegate(), instead it just does this in bgp_rfapi_cfg_new():

	for (afi = AFI_IP; afi < AFI_MAX; afi++) {
		/* ugly, to deal with addition of delegates, part of 0.99.24.1
		 * merge */
		h->nve_groups_vn[afi].delegate =
			route_table_get_default_delegate();
		h->nve_groups_un[afi].delegate =
			route_table_get_default_delegate();
	}

=> the new hash field in the route_table will be NULL => SEGV

The "correct" solution would be to change from

	struct route_table nve_groups_vn[AFI_MAX];

to

	struct route_table *nve_groups_vn[AFI_MAX];

and use route_table_init_with_delegate (+ route_table_finish() to free)

(I tried to find such uses of route_table when making the change, but I didn't spot this one)

@qlyoung
Copy link
Member

qlyoung commented Jul 18, 2017

@louberger want to take a look at this?

@louberger
Copy link
Member

louberger commented Jul 18, 2017 via email

@eqvinox
Copy link
Contributor

eqvinox commented Aug 2, 2017

fixed by 0ae6124, closing

@eqvinox eqvinox closed this as completed Aug 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants