Memory corruption with g_spawn_async_with_pipes
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 491
- Forks
- 81
- PR merge metrics
- No merged PRs in 30d
Description
Version 0.9.2-2+b1 (Debian package), reproduces on Lua 5.1, 5.2 and 5.3. Host architecture is i686.
Sample code:
local GLib = require('lgi').GLib
local N = 1000000
local envp = {}
for i = 1, N do
envp[#envp + 1] = ('VAR%u=%u'):format(i, i)
end
GLib.spawn_async_with_pipes('.', { '/bin/true' }, envp, { }, nil)
Depending on the value of N and the Lua version, this may corrupt the heap and fail an assertion on subsequent realloc or crash immediately.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the sample with Lua 5.1, 5.2, and 5.3 on the reported i686 environment, varying N and observing heap corruption around GLib.spawn_async_with_pipes. Trace the binding entry point for that call and its handling of the envp table; done means the sample no longer corrupts memory or crashes during subsequent allocation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100