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

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

Build:
Build:
LAST BUILD BRANCH: skaplun/lj-1056-arm64-ldp-sdp-misaligned-fusing
DEFAULT BRANCH: tarantool/master
Ran 28 Sep 2023 09:37PM CUT
Jobs 1
Files 89
Run time 5s
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 09:31PM CUT coverage: 88.212% (-0.09%) from 88.298%
6344468326

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 and the test for the problem

Resolves tarantool/tarantool#6323

5338 of 5972 branches covered (0.0%)

Branch coverage included in aggregate %.

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

20480 of 23296 relevant lines covered (87.91%)

2751774.02 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
2
72.56
-0.17% src/lj_crecord.c
6
94.74
-4.31% src/lj_str.c
6
82.22
-2.67% src/lj_sysprof.c
9
89.14
-1.64% src/lj_ffrecord.c
26
89.38
0.0% src/lj_err.c
Jobs
ID Job ID Ran Files Coverage
1 6344468326.1 28 Sep 2023 09:36PM CUT 89
88.21
GitHub Action Run
Source Files on build 6344468326
  • Tree
  • List 89
  • Changed 87
  • Source Changed 0
  • Coverage Changed 6
Loading...
Coverage∆FileLinesRelevantCoveredMissedHits/LineBranch HitsBranch Misses
  • ►
    88.21
    src/
  • Back to Repo
  • Github Actions Build #6344468326
  • 839195a6 on github
  • Prev Build on fckxorg/gh-6323-fix-curL (#6340880138)
  • Next Build on fckxorg/gh-6323-fix-curL (#6405294870)
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