bird: memory exhausted

Andre van Zyl vanzyla at bcxcomms.net
Sun Aug 6 22:52:27 CEST 2017


On Sun, 6 Aug 2017 16:24:24 +0200
Job Snijders <job at instituut.net> wrote:

> Dear all,
> 
> It appears I'm hitting some kind of limit in yacc stuff (on 1.6.3-1+trusty+1):
> 
> 	router# bird -c rpki-match-roa-ipv4.conf  -p
> 	bird: rpki-match-roa-ipv4.conf, line 4998: memory exhausted
> 
> The error message is generated by generated code:
> 
> 	$ grep -r 'memory exhausted' *
> 	Binary file bird matches
> 	obj/conf/cf-parse.tab.c:        yyoverflow (YY_("memory exhausted"),
> 	obj/conf/cf-parse.tab.c:  yyerror (YY_("memory exhausted"));
> 	Binary file obj/conf/all.o matches
> 	Binary file obj/conf/cf-parse.tab.o matches
> 
> The config file can be found here: http://instituut.net/~job/rpki-match-roa-ipv4.conf.txt
> 
> Any ideas how to increase the memory available to things on the stack?
> 
> Kind regards,
> 
> Job

Hi Job,

Looks like you're hitting the Bison parser stack limit. The default is 10000, which is probably too low, looking at your sample config file.

You can increase the stack limit by defining YYMAXDEPTH in obj/conf/config.Y like the diff below. Raising this arbitrarily to 100000 seem to fix the error for me, but I have no idea what a sane value is here, so you might get a better value through trial and error.

Regards,
Andre

--- obj/conf/config.Y	2017-08-06 22:34:05.309017152 +0200
+++ ../config.Y	2017-08-06 22:35:05.041017152 +0200
@@ -11,6 +11,8 @@
 #include "lib/unix.h"
 #include <stdio.h>
 
+#define YYMAXDEPTH 100000
+
 CF_DECLS
 
 CF_KEYWORDS(LOG, SYSLOG, ALL, DEBUG, TRACE, INFO, REMOTE, WARNING, ERROR, AUTH, FATAL, BUG, STDERR, SOFT)






More information about the Bird-users mailing list