• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tarantool / luajit / 6340880138
88%
tarantool/master: 93%

Build:
Build:
LAST BUILD BRANCH: skaplun/lj-1152-stack-buffer-overflow-on-error
DEFAULT BRANCH: tarantool/master
Ran 28 Sep 2023 03:17PM CUT
Jobs 1
Files 89
Run time 6s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Sep 2023 03:15PM CUT coverage: 88.298% (+0.06%) from 88.241%
6340880138

push

github

fckxorg
Restore cur_L for specific Lua/C API use case.

Thanks to Peter Cawley.

(cherry-picked from commit e86990f7f)

Consider the following Lua C API function:

```
static int error_after_coroutine_return(lua_State *L)
{
	lua_State *innerL = lua_newthread(L);
	luaL_loadstring(innerL, "print('inner coro')");
	lua_pcall(innerL, 0, 0, 0);
	luaL_error(L, "my fancy error");
	return 0;
}
```

And the following Lua script:
```
local libcur_L = require('libcur_L')

local function onesnap_f(var)
  if var then
    return 1
  else
    return 0
  end
end

-- Compile function to trace with snapshot.
if jit then jit.opt.start('hotloop=1') end
onesnap_f(true)
onesnap_f(true)

local r, s = pcall(libcur_L.error_after_coroutine_return)
onesnap_f(false)
```

This is the only case when `cur_L` is not restored, according to
the analysis done in https://github.com/LuaJIT/LuaJIT/issues/1066.

This patch changes the error-catching routine, so now the patch
sets the actual cur_L there.
Now it is possible to throw errors on non-executing coroutines,
which is a violation of the Lua C API. So, even though it is now
possible, that behavior should be avoided anyway.

Maxim Kokryashkin:
* added the description for the problem

Resolves tarantool/tarantool#6323

5344 of 5972 branches covered (0.0%)

Branch coverage included in aggregate %.

4 of 4 new or added lines in 1 file covered. (100.0%)

20499 of 23296 relevant lines covered (87.99%)

2744986.07 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
1
72.73
0.08% src/lj_crecord.c
2
91.4
0.41% src/lib_base.c
4
95.69
-0.12% src/lj_state.c
26
89.38
0.0% src/lj_err.c
173
73.0
0.08% src/lj_api.c
Jobs
ID Job ID Ran Files Coverage
1 6340880138.1 28 Sep 2023 03:17PM CUT 89
88.3
GitHub Action Run
Source Files on build 6340880138
  • Tree
  • List 89
  • Changed 80
  • Source Changed 0
  • Coverage Changed 6
Loading...
Coverage∆FileLinesRelevantCoveredMissedHits/LineBranch HitsBranch Misses
13.79
src/lj_utils_leb128.c132 51 7 44 1470123.0 - 5391 6
61.83
src/lj_cparse.c1935 1029 635 394 186995.0 - 64183 111
61.83
src/lj_clib.c431 101 65 36 2737.0 - 1.016 14
64.75
src/lj_cconv.c763 387 238 149 517498.0 - 24489 29
70.38
src/lj_carith.c429 252 175 77 557384.0 - 22465 24
72.73
src/lj_crecord.c1912 927 656 + 1271 - 166.0 - 1.0208 53
72.86
src/lj_strscan.c537 261 188 73 2693057.0 - 162071102 35
73.0
src/lj_api.c1368 - 5859 - 4622 - 2237 - 2962797.0 + 2001173 57
75.0
src/lib_ffi.c866 518 387 131 85597.0 - 4099 31
75.77
src/lj_opt_fold.c2522 971 720 251 21935.0 - 43237 55
Showing 1 to 10 of 89 entries
  • Previous
  • 1
  • 2
  • 3
  • 4
  • 5
  • …
  • 9
  • Next
  • ►
    88.3
    src/
  • Back to Repo
  • Github Actions Build #6340880138
  • ef9f4902 on github
  • Prev Build on fckxorg/gh-6323-fix-curL (#6336699297)
  • Next Build on fckxorg/gh-6323-fix-curL (#6344468326)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc