lua-users home
lua-l archive

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


And here you have a backtrace:

(gdb) bt
#0  0x00007fff8c5dc82a in __kill ()
#1  0x00007fff96f7ea9c in abort ()
#2  0x00007fff96fdd84c in free ()
#3  0x0000000100015591 in l_alloc (ud=0x13796, ptr=0x6, osize=0,
nsize=140734799803208) at lauxlib.c:631
#4  0x000000010000cdce in luaM_realloc_ (L=Cannot access memory at address 0x0
) at lmem.c:79
#5  0x00000001000112af in luaH_free (L=0x100100bc0, t=0x6) at ltable.c:376
#6  0x000000010000aa0c in freeobj [inlined] () at
/Users/drio/dev/luatools/lua-5.1.4/src/lgc.c:383
#7  0x000000010000aa0c in sweeplist (L=0x13796, p=0x6, count=0) at lgc.c:424
#8  0x000000010000aaba in luaC_freeall (L=0x100100bc0) at lgc.c:487
#9  0x0000000100010888 in close_state [inlined] () at
/Users/drio/dev/luatools/lua-5.1.4/src/lstate.c:108
#10 0x0000000100010888 in lua_close (L=0x100100bc0) at lstate.c:212
#11 0x00000001000009ef in main (argc=2, argv=0x7fff5fbff528) at lua.c:389

On Sat, Feb 18, 2012 at 08:59, David Rio <driodeiros@gmail.com> wrote:
> Thanks for the quick reply.
>
> The c code: http://is04607.com/tmp/ldrdlib.c.txt
> The lua code that uses the previous library: http://is04607.com/tmp/play.c.lua
> To compile the array lib: http://is04607.com:public_html/tmp/compile.sh.txt
>
> -drd
>
> On Sat, Feb 18, 2012 at 07:18, Martin Guy <martinwguy@gmail.com> wrote:
>> On 18 February 2012 03:05, Sam Roberts <vieuxtech@gmail.com> wrote:
>>> On Fri, Feb 17, 2012 at 5:44 PM, David Rio <driodeiros@gmail.com> wrote:
>>>> luaL_newmetatable(L, "LuaBook.array"); // in luaopen_array()
>>>>
>>>> I get an error from malloc because it is trying to free memory that has
>>>> not been allocated:
>>>
>>> Something is broken, you should post more code.
>>
>> Specifically, can you post a complete code example that reproduces the
>> problem whe you run it?
>> I don't feel like typinge in all of Chapter 28 myself to see whether I
>> can reproduce your problem
>>
>>    M
>>