lua-users home
lua-l archive

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


> I don't know what's wrong, I can't get a usable stack trace even if I 
> recompile both lua and lpeg with debug symbols and statically link them 
> together, but so far I haven't been able to crash the (yet unreleased?) 
> 0.12 version of LPeg.

Same here. There seems to be some pretty bad stack corruption going on,
even valgrind can not make sens of this.

I've been able to make a trace by automatically single stepping a few thousand
times in gdb, these were the last lines, if this is any help.

191	}
177	      if (!checkaux(sib1(tree), pred)) return 0;
191	}
headfail (tree=tree@entry=0x6344b4) at lpcode.c:340
340	}
codegen (compst=compst@entry=0x7fffffffdbe0, tree=tree@entry=0x6344ac, opt=opt@entry=0, tt=tt@entry=-1, fl=fl@entry=0x7fffffffdae0 "")
    at lpcode.c:822
822	    case TChoice: codechoice(compst, sib1(tree), sib2(tree), opt, fl); break;
codechoice (fl=0x7fffffffdae0 "", opt=0, p2=0x6344cc, p1=0x6344b4, compst=0x7fffffffdbe0) at lpcode.c:586
586	      (!e1 && (getfirst(p2, fl, st2), cs_disjoint(st1, st2)))) {
getfirst (tree=tree@entry=0x6344cc, follow=follow@entry=0x7fffffffdae0 "", 
    firstset=firstset@entry=0x7fffffffd9a0 "(\333\377\377\377\177") at lpcode.c:242
242	static int getfirst (TTree *tree, const Charset follow, Charset firstset) {
244	  switch (tree->tag) {
259	      int e1 = getfirst(sib1(tree), follow, firstset);
getfirst (tree=tree@entry=0x6344d4, follow=follow@entry=0x7fffffffdae0 "", 
    firstset=firstset@entry=0x7fffffffd9a0 "(\333\377\377\377\177") at lpcode.c:242
242	static int getfirst (TTree *tree, const Charset follow, Charset firstset) {
244	  switch (tree->tag) {
246	      tocharset(tree, firstset);
tocharset (tree=0x6344d4, cs=0x7fffffffd9a0 "(\333\377\377\377\177") at lpcode.c:99
99	  switch (tree->tag) {
98	int tocharset (TTree *tree, byte *cs) {
---Type <return> to continue, or q <return> to quit---tocharset (cs=<optimized out>, tree=<optimized out>) at lpcode.c:105
105	      loopset(i, cs[i] = 0);  /* erase all chars */
106	      setchar(cs, tree->u.n);  /* add that one */
getfirst (tree=tree@entry=0x6344d4, follow=follow@entry=0x7fffffffdae0 "", firstset=firstset@entry=0x7fffffffd9a0 "") at lpcode.c:311
311	}
247	      return 0;
311	}
260	      int e2 = getfirst(sib2(tree), follow, csaux);
getfirst (tree=0x6344dc, follow=follow@entry=0x7fffffffdae0 "", firstset=firstset@entry=0x7fffffffd910 "\250H}\367\377\177")
    at lpcode.c:242
242	static int getfirst (TTree *tree, const Charset follow, Charset firstset) {
244	  switch (tree->tag) {
265	      if (!nullable(sib1(tree))) {
checkaux (tree=tree@entry=0x6344e4, pred=pred@entry=0) at lpcode.c:159
159	int checkaux (TTree *tree, int pred) {
161	  switch (tree->tag) {
191	}
177	      if (!checkaux(sib1(tree), pred)) return 0;
191	}
getfirst (tree=0x6344e4, follow=follow@entry=0x7fffffffdae0 "", firstset=firstset@entry=0x7fffffffd910 "\250H}\367\377\177")
    at lpcode.c:244
244	  switch (tree->tag) {
246	      tocharset(tree, firstset);
tocharset (tree=0x6344e4, cs=0x7fffffffd910 "\250H}\367\377\177") at lpcode.c:99
99	  switch (tree->tag) {
98	int tocharset (TTree *tree, byte *cs) {
tocharset (cs=<optimized out>, tree=<optimized out>) at lpcode.c:105
105	      loopset(i, cs[i] = 0);  /* erase all chars */
106	      setchar(cs, tree->u.n);  /* add that one */
getfirst (tree=0x6344e4, follow=0x7fffffffdae0 "", firstset=0x7fffffffd910 "") at lpcode.c:311
311	}
247	      return 0;
311	}
Warning:
Cannot insert breakpoint 0.
Error accessing memory address 0x0: Input/output error.