RE: segfault

  • From: William Adams <william_a_adams@xxxxxxx>
  • To: "luajit@xxxxxxxxxxxxx" <luajit@xxxxxxxxxxxxx>
  • Date: Sat, 4 Aug 2012 18:38:45 +0000

if type(tp) == "string" and tp == "address" then
   tp = S.addrtype[af]

When does S.addrtype ever get initialized?

If you're trying to get the value of 'S.addrtype[af]', and it doesn't actually 
exist, that might be a problem.  I don't know if that's your crash, but maybe 
something similar someplace?

I generally implement the __gc method on metatypes so that I can see when 
they're executed, if you're trying to track down something you consider might 
be a gc issue.

-- William

- Shaping clay is easier than digging it out of the ground.
> Date: Sat, 4 Aug 2012 18:49:28 +0100
> Subject: Re: segfault
> From: justin@xxxxxxxxxxxxxxxxxxxxx
> To: luajit@xxxxxxxxxxxxx
> On Fri, Aug 3, 2012 at 10:03 PM, Justin Cormack
> <justin@xxxxxxxxxxxxxxxxxxxxx> wrote:
> > On Fri, Aug 3, 2012 at 9:28 AM, Mike Pall <mike-1208@xxxxxxxxxx> wrote:
> >> Well, the backtrace shows it assumes some type is an enum there.
> >> But that doesn't match your description. Can you try to recompile
> >> with assertions turned on and derive a minimal test case?
> Here is a test case that fails on luajit head with assertions enabled
> (it doesnt actually crash without assertions, unlike the original
> code).
> If I cut it down any further it starts to succeed, suggestion that
> there is something gc related going on.
> Justin

Other related posts: