[ragel-users] Segment fault using Ruby Ragel 6.4 or 6.5 in Linux 32 and 64 bits

Iñaki Baz Castillo ibc at aliax.net
Tue Nov 17 15:30:13 UTC 2009


Hi, the following code produces a segmentfault:

------identity.rl-------------
class Identity

	%%{
		machine identity;
		
		CR = "\r";
		LF = "\n";
		CRLF = CR LF;
		SP = " ";
		HTAB = "\t";
		WSP = SP | HTAB;
		LWS = ( WSP* CRLF )? WSP+;
		SWS = LWS?;
		LAQUOT = SWS "<";
		RAQUOT = ">" SWS;
		DQUOTE = "\"";
		ALPHA = 0x41..0x5a | 0x61..0x7a;
		DIGIT = 0x30..0x39;
		alphanum = ALPHA | DIGIT;
		quoted_pair = "\\" ( 0x00..0x09 | 0x0b..0x0c | 0x0e..0x7f );
		UTF8_CONT = 0x80..0xbf;
		UTF8_NONASCII = ( 0xc0..0xdf UTF8_CONT ) | ( 0xe0..0xef UTF8_CONT{2} ) | ( 
0xf0..0xf7 UTF8_CONT{3} ) | ( 0xf8..0xfb UTF8_CONT{4} ) | ( 0xfc..0xfd 
UTF8_CONT{5} );
		token = ( alphanum | "-" | "." | "!" | "%" | "*" | "_" | "+" | "`" | "'" | 
"~" )+;
		
		qdtext = LWS | "!" | 0x23..0x5b | 0x5d..0x7e | UTF8_NONASCII;
		quoted_string = DQUOTE ( qdtext | quoted_pair )* DQUOTE;
		
		display_name = quoted_string | ( token ( LWS token )* );
		
		write data;
	}%%

end
-------------------

~$ ragel -F1 -R identity.rl
Segmentfault



If doesn't occur if I remove the line "write data".
It occurs in Debian and Ubuntu of 32 and 64 bits, with Ragel 6.4 and 6.5, 
using Ruby 1.8 or 1.9 (for sure Ruby version doesn't affect here).

Is it a bug?

Regards.





-- 
Iñaki Baz Castillo <ibc at aliax.net>




More information about the ragel-users mailing list