21 Apr 2006 00:44
erlc bug: no_bs_match_state (OTP-R10B-10 / compiler-4.3.12)
Pascal Brisset <pascal.brisset <at> cellicium.com>
2006-04-20 22:44:56 GMT
2006-04-20 22:44:56 GMT
Erlc crashes on the attached erlang module with this error:
| bug_bin: function foo/1+13:
| Internal consistency check failed - please report this bug.
| Instruction: {bs_restore,0}
| Error: no_bs_match_state:
This message comes from lib/compiler/src/beam_validator.erl,
which performs a kind of abstract interpretation on the beam code.
In particular, it keeps track of internal variables of the virtual
machine that are used for the implementation of pattern-matching
on binaries. The validity of these variables is stored in
(Vst#vst.current)#st.bsm throughout the control flow analysis.
Looking at the generated beam code with erlc -S:
10 {function, foo, 1, 2}.
11 {label,1}.
12 {func_info,{atom,bug_bin},{atom,foo},1}.
13 {label,2}.
14 {test,bs_start_match,{f,1},[{x,0}]}.
15 {bs_save,0}.
16 {test,bs_get_binary,
17 {f,3},
18 [{atom,all},8,{field_flags,[aligned,unsigned,big]},{x,1}]}.
19 {test,bs_test_tail,{f,3},[0]}.
20 {bs_init2,{f,3},0,0,2,{field_flags,[]},{x,2}}.
21 {test,is_ne,{f,3},[{x,1},{x,2}]}.
22 {move,{atom,ok},{x,0}}.
23 return.
(Continue reading)
RSS Feed