[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LPEG on Solaris
- From: Daurnimator <quae@...>
- Date: Thu, 2 Jun 2016 00:22:49 +1000
On 2 June 2016 at 00:14, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
>> here is a PR for lpeg that fixes some issues we have had with deploying the
>> it on Solaris / OmniOS.
>> Please consider merging this upstream.
>>
>> https://github.com/LuaDist/lpeg/pull/1
>>
>> """
>> On operating systems like Solaris and Illumos where the stack grows down,
>> lightuserdata and user data cannot be assigned from the stack. This commit
>> patch fixes this behaviour by moving the allocations to the heap (using
>> calloc).
>
> Sorry, but this does not seem to make sense. Of course we can allocate
> and use an automatic array in C no matter the direction the stack
> grows. Your fix probably only hides the bug, instead of fixing it.
>
> Do you have a simple example that exercises the bug?
>
> -- Roberto
>
Looking at his commit message, it seems to be a luajit bug:
> Allocate lightuserdata on the heap.
>
> Solaris (OmniOS, Illumos) version of luajit does not support support
> allocation of lightuserdata on the stack. This gives errors like this:
>
> ```
> $ luajit test.lua
> General tests for LPeg library
> version 1.0.0
> luajit: bad light userdata pointer
> stack traceback:
> [C]: in function 'match'
> test.lua:58: in main chunk
> [C]: at 0x00402d50
> ```
>
> This commit patch fixes this behavior by moving the allocations to the heap.
Heinrich, this seems like an issue that should be fixed in luajit, not LPEG.
Have you reported the issue there?