lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Thanks for feedback. I was running application through valgrind and have not been able to find anything yet, will keep looking

Multithreaded approach is hard, and I want to get it right (it is almost there already).
The reason I chose it over traditional and easier to implement multi process approach is that lua excellent features (small memory footprint, easy C api, thread safety) allow creation web server framework that far outperforms all existing frameworks while keeping scripting easy and with no need to write asynchronous code (unlike luvit https://github.com/luvit/luvit)


On Tue, Dec 11, 2012 at 4:47 AM, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
> I am working on a web framework that uses lua embedded in multithreaded web
> server - https://github.com/sergeyzavadski/breeze.
>
> It uses multiple threads for HTTP requests processing, each having separate
> lua state
>
> When performing benchmarking tests under linux,  I am intermittently seeing
> crash in lua garbage collection (as demonstrated by following stacktrace)
>
> [...]
>
> Is this a legitimate lua issue and is there a workaround possible?

Some points to keep in mind:

* Currently Lua GC has no known bugs, and bugs there are rare (or at least
rarely found).

* Because the GC traverses all objects in the system, it is one of the
main "candidates" to suffer from a memory corruption created somewhere
else.

* The GC is one the most complex parts of Lua, and the most
difficult to test. Bugs there can never be rulled out.

* Multithreading is also notoriously hard to get right.

Have you tried something like valgrind?

-- Roberto