View Issue Details

IDProjectCategoryView StatusLast Update
0000325luatexluatex bugpublic2010-03-12 15:46
ReporterpatrickAssigned ToTaco 
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Product Version 
Target VersionFixed in Version0.51.0 
Summary0000325: lpeg/coroutines segfaults on 64 bit Linux (Ubuntu 9.04)
DescriptionThis segfaults on Linux ubuntu 2.6.28-11-generic 0000042-Ubuntu SMP Fri Apr 17 01:58:03 UTC 2009 x86_64 GNU/Linux

luatex --luaonly thisfile.lua

------
function parse()
  local grammar = lpeg.P{
    "one",
    one = lpeg.V"two" / function() end,
    two = lpeg.V"three" / function() end,
    three = lpeg.V"four" / function() end,
    four = lpeg.C(lpeg.P("5")) / tonumber,
  }

  lpeg.match(grammar,"5")
  print("ok?")
  coroutine.yield()
end


coroutine.resume(coroutine.create(parse))
------

luatex trunk svn revision 3412
Additional InformationSomething similar also crashes on MacOS X
TagsNo tags attached.

Activities

patrick

2010-01-31 21:00

reporter   ~0000406

I didn't succeed in reproducing this error in lua + lpeg from the ubuntu distribution directly.

Taco

2010-02-03 12:08

administrator   ~0000409

I don't even succeed in reproducing the error with luatex r3415 on another linux64 (mandriva 2009.0):

Linux ntg 2.6.27.21-desktop-1mnb 0000001 SMP Thu May 14 18:28:41 EDT 2009 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ GNU/Linux

Can you post a gdb stack backtrace?

2010-02-03 12:47

 

backtrace.log (1,446 bytes)

2010-02-03 12:53

 

backtrace2.log (1,535 bytes)

patrick

2010-02-03 12:53

reporter   ~0000411

backtrace2.log is the correct backtrace from luatex --luaonly ...

patrick

2010-02-03 14:31

reporter   ~0000415

When I compile luatex with CFLAGS="-O0 -g" this file does not segfault, but other testfiles do (both 64bit OS X and 64bit Linux, as above).

Taco

2010-02-03 16:48

administrator   ~0000416

Unable to reproduce this, sorry

Taco

2010-02-05 12:00

administrator   ~0000417


This crashed on my own amd64:

function parse()
  local grammar = lpeg.P{
    "one",
    one = lpeg.V"two" / function() end,
    two = lpeg.V"three" / function() end,
    three = lpeg.V"four" / function() end,
    four = lpeg.V"five" / function() end,
    five = lpeg.V"six" / function() end,
    six = lpeg.C(lpeg.P("5")) / tonumber,
  }


  lpeg.match(grammar,"5")
  print("ok?")
  coroutine.yield()
end


coroutine.resume(coroutine.create(parse))

Taco

2010-02-05 12:06

administrator   ~0000418

Last edited: 2010-02-05 12:12

The problem was the C stack created by the coroutine was too small. I raised it from 64K to 1M (at a guess) and now the test file runs without problems.

If you need an even larger stack, use coroutine.cstacksize() to set a new value.

Issue History

Date Modified Username Field Change
2010-01-31 20:47 patrick New Issue
2010-01-31 21:00 patrick Note Added: 0000406
2010-02-03 12:08 Taco Note Added: 0000409
2010-02-03 12:09 Taco Status new => feedback
2010-02-03 12:47 patrick File Added: backtrace.log
2010-02-03 12:53 patrick File Added: backtrace2.log
2010-02-03 12:53 patrick Note Added: 0000411
2010-02-03 14:31 patrick Note Added: 0000415
2010-02-03 16:48 Taco Note Added: 0000416
2010-02-03 16:48 Taco Status feedback => closed
2010-02-03 16:48 Taco Resolution open => unable to reproduce
2010-02-05 12:00 Taco Note Added: 0000417
2010-02-05 12:00 Taco Assigned To => Taco
2010-02-05 12:00 Taco Status closed => assigned
2010-02-05 12:06 Taco Note Added: 0000418
2010-02-05 12:06 Taco Status assigned => resolved
2010-02-05 12:06 Taco Resolution unable to reproduce => fixed
2010-02-05 12:12 Taco Note Edited: 0000418
2010-03-12 15:46 Taco Fixed in Version => 0.51.0
2010-03-12 15:46 Taco Status resolved => closed