You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Yaws web server supports a binding feature that allows web page content to contain variables that Yaws replaces with values prior to returning the content to the client. The Yaws unit test request_bindings in yaws_compile_SUITE.erl helps verify that Yaws parses variable bindings correctly.
All 3 release candidates for 22.0 fail this test, apparently due to a change in the compiler. I bisected to find the failing change:
{noformat}
commit 7d941c529dc9db016af30cdace2df089d1648dbf
Merge: 08ef38b2c9 afa36d2081
Author: John Högberg <john@erlang.org>
Date: Fri Sep 28 14:08:23 2018 +0200
Merge pull request #1958 from jhogberg/john/compiler/ssa-bsm-opt
Rewrite BSM optimizations in the new SSA-based intermediate format
{noformat}
Within the git branch noted in this merge commit, commit cf5094c, the first one in the branch, passes, but the commits after that on the branch fail.
If I compile Yaws with 21.3 and run it under a 22.0 release candidate, the test does not fail.
Unfortunately, I haven't been able to devise a smaller test case to reproduce this. The approach I've been using is to follow these steps to build Yaws in an Ubuntu docker container (assuming Erlang/OTP is already built/installed there):
{noformat}
sudo apt-get build-dep yaws
git clone https://github.com/klacke/yaws.git
cd yaws
autoreconf -fi
./configure
make -j8
sudo make install
{noformat}
I then use erlc to compile this module:
{code:erlang}
-module(comptest).
-export([start/0]).
start() ->
application:load(yaws),
application:start(yaws),
{ok,GC,_} = yaws_api:getconf(),
put(gc,GC),
{ok,0,[{data,V}|_]} = yaws_compile:compile_file("comptest-data"),
application:stop(yaws),
erlang:halt(case V of
5 -> 0;
_ -> 1
end).
{code}
where the input file comptest-data required by the module contains the following:
{noformat}
%%%%<%%x%%>
{noformat}
After compiling the module, I run it with
{noformat}
erl -noshell -noinput -s comptest start
{noformat}
If this exits with a 0 status, the test passed.
The error occurs within the Yaws source file src/yaws_compile.erl. From what I can tell, something is compiled incorrectly within the many clauses of yaws_compile:compile_file/4, particularly those involving yaws_compile:parse_binding/1,2.
The text was updated successfully, but these errors were encountered:
https://github.com/jhogberg/otp/tree/john/compiler/fix-missing-match-reposition/ERL-923
There's a lot of polish left (I'll get around to that on Monday), but it ought to work.
Original reporter:
vinoski
Affected version:
OTP-22.0
Component:
compiler
Migrated from: https://bugs.erlang.org/browse/ERL-923
The text was updated successfully, but these errors were encountered: