On Tue, Mar 31, 2015 at 3:31 PM, Dibyendu Majumdar <mobile at majumdar.org.uk> wrote:> Hi, > > I constructed a minimal Lua program that reproduces the problem. > Essentially the problem occurs if a JITed function is recursively > called - and there is a longjmp from the inner call. Example: > > function rais(n) > if n == 0 then error() > else rais(n-1) > end > end > ravi.compile(rais) > > function caller(n) > pcall(rais,n) > end > ravi.compile(caller) > > caller(1) > > Here the call to error() triggers a longjmp. The pcall() calls setjmp. > The error only occurs on Windows as reported earlier. >This isn't enough info to solve the problem. Pasting the LLVM IR or C code that calls setjmp and a stack trace of the crash might help figure it out, though.> I ran valgrind on Ubuntu to see if I could detect any memory issues. > Valgrind reports 6 errors of following type - not sure if this is an > issue or not. >These memory leaks look unrelated. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150401/427166a5/attachment.html>
On 1 April 2015 at 17:06, Reid Kleckner <rnk at google.com> wrote:> This isn't enough info to solve the problem. Pasting the LLVM IR or C code > that calls setjmp and a stack trace of the crash might help figure it out, > though.Yes I am working on isolating the issue. There is all the Lua infrastructure - don't know if I can eliminate that ... I compiled Lua / JIT compiler on Ubuntu using -fsanitize=address and ran the original test. No errors reported. I will be checking a number of other things, and report back if I find anything material. Regards
On 1 April 2015 at 20:28, Dibyendu Majumdar <mobile at majumdar.org.uk> wrote:> On 1 April 2015 at 17:06, Reid Kleckner <rnk at google.com> wrote: >> This isn't enough info to solve the problem. Pasting the LLVM IR or C code >> that calls setjmp and a stack trace of the crash might help figure it out, >> though. > > Yes I am working on isolating the issue. There is all the Lua > infrastructure - don't know if I can eliminate that ... >Looks like the error reported by MSVC was incorrect - the actual issue was caused by a part of Lua (the debug API) that I had not fully tested in the JITed environment. Thanks to help from Address Sanitizer I was able to find the real issue and have applied fixes. Thanks and Regards Dibyendu