aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-07-27 10:55:38 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-07-27 10:55:38 -0300
commit4053eae9ebbf14963a388ba864454f9e4ec16663 (patch)
tree9100d693e015231e41f93a7ef2c8506d12cfafe1
parent6d998055c80a0fe8d4698ba02becb1813203eee9 (diff)
downloadlua-4053eae9ebbf14963a388ba864454f9e4ec16663.tar.gz
lua-4053eae9ebbf14963a388ba864454f9e4ec16663.tar.bz2
lua-4053eae9ebbf14963a388ba864454f9e4ec16663.zip
bug: Lua does not check GC when creating error messages
-rw-r--r--bugs63
1 files changed, 54 insertions, 9 deletions
diff --git a/bugs b/bugs
index 24b16bd7..a071937e 100644
--- a/bugs
+++ b/bugs
@@ -2899,6 +2899,30 @@ patch = [[
2899]] 2899]]
2900} 2900}
2901 2901
2902Bug{
2903what = [[Lua does not check memory use when creating error messages]],
2904report = [[John Dunn, 2012/09/24]],
2905since = [[5.2.0]],
2906fix = nil,
2907example = [[
2908local code = "function test()\n bob.joe.larry = 23\n end"
2909
2910load(code)()
2911
2912-- memory will grow steadly
2913for i = 1, math.huge do
2914 pcall(test)
2915 if i % 100000 == 0 then
2916 io.write(collectgarbage'count'*1024, "\n")
2917 end
2918end
2919]],
2920patch = [[
2921]]
2922}
2923
2924
2925
2902 2926
2903 2927
2904----------------------------------------------------------------- 2928-----------------------------------------------------------------
@@ -3656,9 +3680,9 @@ It needs an "interceptor" 'memcmp' function that continues
3656reading memory after a difference is found.]], 3680reading memory after a difference is found.]],
3657patch = [[ 3681patch = [[
36582c2 36822c2
3659< ** $Id: bugs,v 1.153 2017/05/19 12:58:40 roberto Exp roberto $ 3683< ** $Id: bugs,v 1.154 2017/05/22 12:55:16 roberto Exp roberto $
3660--- 3684---
3661> ** $Id: bugs,v 1.153 2017/05/19 12:58:40 roberto Exp roberto $ 3685> ** $Id: bugs,v 1.154 2017/05/22 12:55:16 roberto Exp roberto $
3662263c263,264 3686263c263,264
3663< for (option = LUA_STRFTIMEOPTIONS; *option != '\0'; option += oplen) { 3687< for (option = LUA_STRFTIMEOPTIONS; *option != '\0'; option += oplen) {
3664--- 3688---
@@ -3780,18 +3804,39 @@ patch = [[
3780]] 3804]]
3781} 3805}
3782 3806
3783
3784--[=[
3785Bug{ 3807Bug{
3786what = [[ ]], 3808what = [[Lua does not check GC when creating error messages]],
3787report = [[ ]], 3809report = [[Viacheslav Usov, 2017/07/06]],
3788since = [[ ]], 3810since = [[5.3.2]],
3789fix = nil, 3811fix = nil,
3790example = [[ ]], 3812example = [[
3813function test()
3814 bob.joe.larry = 23
3815end
3816
3817-- memory will grow steadly
3818for i = 1, math.huge do
3819 pcall(test)
3820 if i % 100000 == 0 then
3821 io.write(collectgarbage'count'*1024, "\n")
3822 end
3823end
3824]],
3791patch = [[ 3825patch = [[
3826--- ldebug.c 2017/04/19 17:20:42 2.121.1.1
3827+++ ldebug.c 2017/07/10 17:08:39
3828@@ -653,6 +653,7 @@
3829 CallInfo *ci = L->ci;
3830 const char *msg;
3831 va_list argp;
3832+ luaC_checkGC(L); /* error message uses memory */
3833 va_start(argp, fmt);
3834 msg = luaO_pushvfstring(L, fmt, argp); /* format message */
3835 va_end(argp);
3792]] 3836]]
3793} 3837}
3794]=] 3838
3839
3795 3840
3796 3841
3797--[=[ 3842--[=[