Segfault on x86

classic Classic list List threaded Threaded
4 messages Options
Simon Posnjak Simon Posnjak
Reply | Threaded
Open this post in threaded view
|

Segfault on x86

Hi all!

We are using eLua 0.8 in our project. When we run the script on x86
machine (on arm it works) we get the following segfault:

reallymarkobject() at lgc.c:71 0x808a8e3
markmt() at lgc.c:500 0x808bcb2
markroot() at lgc.c:514 0x808bd99
singlestep() at lgc.c:565 0x808bf73
luaC_step() at lgc.c:625 0x808c182
luaV_execute() at lvm.c:794 0x8073f47
luaD_call() at ldo.c:394 0x8084158
f_call() at lapi.c:842 0x8080436
luaD_rawrunprotected() at ldo.c:120 0x80834b5
luaD_pcall() at ldo.c:480 0x80844cb
lua_pcall() at lapi.c:863 0x8080586

static void reallymarkobject (global_State *g, GCObject *o) {
  lua_assert(iswhite(o) && !isdead(g, o));

DEBUGGER STOPS HERE:
-->  white2gray(o);

  switch (o->gch.tt) {
    case LUA_TSTRING: {
      return;
    }

The wired part is that this only happens if we have a script that has
more then 130 lines. Any idea why this would happen? Is there any
simple way to debug this problem?

Regards Simon
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
BogdanM BogdanM
Reply | Threaded
Open this post in threaded view
|

Re: Segfault on x86

Hi,

On Wed, Dec 14, 2011 at 12:34 PM, Simon Posnjak <[hidden email]> wrote:
Hi all!

We are using eLua 0.8 in our project. When we run the script on x86
machine (on arm it works) we get the following segfault:

How exactly are you running eLua on x86 ? 

reallymarkobject() at lgc.c:71 0x808a8e3
markmt() at lgc.c:500 0x808bcb2
markroot() at lgc.c:514 0x808bd99
singlestep() at lgc.c:565 0x808bf73
luaC_step() at lgc.c:625 0x808c182
luaV_execute() at lvm.c:794 0x8073f47
luaD_call() at ldo.c:394 0x8084158
f_call() at lapi.c:842 0x8080436
luaD_rawrunprotected() at ldo.c:120 0x80834b5
luaD_pcall() at ldo.c:480 0x80844cb
lua_pcall() at lapi.c:863 0x8080586

static void reallymarkobject (global_State *g, GCObject *o) {
 lua_assert(iswhite(o) && !isdead(g, o));

DEBUGGER STOPS HERE:
-->  white2gray(o);

 switch (o->gch.tt) {
   case LUA_TSTRING: {
     return;
   }

The wired part is that this only happens if we have a script that has
more then 130 lines. Any idea why this would happen? Is there any
simple way to debug this problem?

I don't think so. You could try to look at 'o' and check (or guess) if it has a valid value; if it doesn't, we need to check where it's coming from. If you can share the script that's causing the problem I can try to take a look at it.

Best,
Bogdan
 

Regards Simon
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev


_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
jbsnyder jbsnyder
Reply | Threaded
Open this post in threaded view
|

Re: Segfault on x86

On Wed, Dec 14, 2011 at 4:39 AM, Bogdan Marinescu
<[hidden email]> wrote:

> Hi,
>
> On Wed, Dec 14, 2011 at 12:34 PM, Simon Posnjak <[hidden email]> wrote:
>>
>> Hi all!
>>
>> We are using eLua 0.8 in our project. When we run the script on x86
>> machine (on arm it works) we get the following segfault:
>
>
> How exactly are you running eLua on x86 ?
>>
>>
>> reallymarkobject() at lgc.c:71 0x808a8e3
>> markmt() at lgc.c:500 0x808bcb2
>> markroot() at lgc.c:514 0x808bd99
>> singlestep() at lgc.c:565 0x808bf73
>> luaC_step() at lgc.c:625 0x808c182
>> luaV_execute() at lvm.c:794 0x8073f47
>> luaD_call() at ldo.c:394 0x8084158
>> f_call() at lapi.c:842 0x8080436
>> luaD_rawrunprotected() at ldo.c:120 0x80834b5
>> luaD_pcall() at ldo.c:480 0x80844cb
>> lua_pcall() at lapi.c:863 0x8080586
>>
>> static void reallymarkobject (global_State *g, GCObject *o) {
>>  lua_assert(iswhite(o) && !isdead(g, o));
>>
>> DEBUGGER STOPS HERE:
>> -->  white2gray(o);
>>
>>  switch (o->gch.tt) {
>>    case LUA_TSTRING: {
>>      return;
>>    }
>>
>> The wired part is that this only happens if we have a script that has
>> more then 130 lines. Any idea why this would happen? Is there any
>> simple way to debug this problem?
>
>
> I don't think so. You could try to look at 'o' and check (or guess) if it
> has a valid value; if it doesn't, we need to check where it's coming from.
> If you can share the script that's causing the problem I can try to take a
> look at it.

The issue is taking place in the garbage collection code, which
appears to be running a step and is marking objects
(http://lua-users.org/wiki/GarbageCollectionTutorial), where it
apparently encounters some sort of error at the point you're running
into above. Given what white2gray does it's probably some
memory-related error.

One or two things to consider if you haven't already tracked this one down:
You might want to keep track of how much memory your script is using
with collectgarbage("count"), and you might also want to check whether
or not you have the EGC enabled
(http://www.eluaproject.net/doc/v0.8/en_elua_egc.html) which may not
be on by default on all platforms.

>
> Best,
> Bogdan
>
>>
>>
>> Regards Simon
>> _______________________________________________
>> eLua-dev mailing list
>> [hidden email]
>> https://lists.berlios.de/mailman/listinfo/elua-dev
>
>
>
> _______________________________________________
> eLua-dev mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/elua-dev
>
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
BogdanM BogdanM
Reply | Threaded
Open this post in threaded view
|

Re: Segfault on x86



On Fri, Dec 16, 2011 at 4:02 AM, James Snyder <[hidden email]> wrote:
On Wed, Dec 14, 2011 at 4:39 AM, Bogdan Marinescu
<[hidden email]> wrote:
> Hi,
>
> On Wed, Dec 14, 2011 at 12:34 PM, Simon Posnjak <[hidden email]> wrote:
>>
>> Hi all!
>>
>> We are using eLua 0.8 in our project. When we run the script on x86
>> machine (on arm it works) we get the following segfault:
>
>
> How exactly are you running eLua on x86 ?
>>
>>
>> reallymarkobject() at lgc.c:71 0x808a8e3
>> markmt() at lgc.c:500 0x808bcb2
>> markroot() at lgc.c:514 0x808bd99
>> singlestep() at lgc.c:565 0x808bf73
>> luaC_step() at lgc.c:625 0x808c182
>> luaV_execute() at lvm.c:794 0x8073f47
>> luaD_call() at ldo.c:394 0x8084158
>> f_call() at lapi.c:842 0x8080436
>> luaD_rawrunprotected() at ldo.c:120 0x80834b5
>> luaD_pcall() at ldo.c:480 0x80844cb
>> lua_pcall() at lapi.c:863 0x8080586
>>
>> static void reallymarkobject (global_State *g, GCObject *o) {
>>  lua_assert(iswhite(o) && !isdead(g, o));
>>
>> DEBUGGER STOPS HERE:
>> -->  white2gray(o);
>>
>>  switch (o->gch.tt) {
>>    case LUA_TSTRING: {
>>      return;
>>    }
>>
>> The wired part is that this only happens if we have a script that has
>> more then 130 lines. Any idea why this would happen? Is there any
>> simple way to debug this problem?
>
>
> I don't think so. You could try to look at 'o' and check (or guess) if it
> has a valid value; if it doesn't, we need to check where it's coming from.
> If you can share the script that's causing the problem I can try to take a
> look at it.

The issue is taking place in the garbage collection code, which
appears to be running a step and is marking objects
(http://lua-users.org/wiki/GarbageCollectionTutorial), where it
apparently encounters some sort of error at the point you're running
into above. Given what white2gray does it's probably some
memory-related error.

One or two things to consider if you haven't already tracked this one down:
You might want to keep track of how much memory your script is using
with collectgarbage("count"), and you might also want to check whether
or not you have the EGC enabled
(http://www.eluaproject.net/doc/v0.8/en_elua_egc.html) which may not
be on by default on all platforms.

When I see something like this, the default suspect is LTR. However, I can't investigate further if I'm unable to reproduce the problem.

Best,
Bogdan
 

>
> Best,
> Bogdan
>
>>
>>
>> Regards Simon
>> _______________________________________________
>> eLua-dev mailing list
>> [hidden email]
>> https://lists.berlios.de/mailman/listinfo/elua-dev
>
>
>
> _______________________________________________
> eLua-dev mailing list
> [hidden email]
> https://lists.berlios.de/mailman/listinfo/elua-dev
>
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev


_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev