9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] troff pic bug report -> acid debug -> no fix yet
@ 2011-03-08  1:49 Fernan Bolando
  2011-03-08 14:55 ` erik quanstrom
  0 siblings, 1 reply; 2+ messages in thread
From: Fernan Bolando @ 2011-03-08  1:49 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hi all

Here is a bug report for troffs pic preprocessor.
It crashes when the commands is in a square bracket and you loose
track of the labels


-----------> test file contents
pseudo@helios; cat test.p
.PS

define missing { [
	O: box invis wid 2.5 ht 1;
	circle diam 0.1 with .e at P1;
] }

missing with .c at 0,0

.PE

-------> crash report and acid
pseudo@helios; cat test.p | pic
.lf 1 -
pic: no such place as P1 near -:8
 context is
		circle diam 0.1 with .e at >>>  P1; <<<  with .c at 0,0
pic 44699: suicide: sys: trap: fault read addr=0x10 pc=0x89b9
pseudo@helios; acid 44699
/proc/44699/text:386 plan 9 executable
/sys/lib/acid/port
/sys/lib/acid/386
acid: src(0x89b9)
/sys/src/cmd/pic/circgen.c:49
 44			case WITH:
 45				with = ap->a_val.i;
 46				break;
 47			case AT:
 48				ppos = ap->a_val.o;
>49				curx = ppos->o_x;
 50				cury = ppos->o_y;
 51				at++;
 52				break;
 53			case INVIS:
 54				battr |= INVIS;
acid:



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [9fans] troff pic bug report -> acid debug -> no fix yet
  2011-03-08  1:49 [9fans] troff pic bug report -> acid debug -> no fix yet Fernan Bolando
@ 2011-03-08 14:55 ` erik quanstrom
  0 siblings, 0 replies; 2+ messages in thread
From: erik quanstrom @ 2011-03-08 14:55 UTC (permalink / raw)


; diffy -c symtab.c
/n/dump/2011/0308/sys/src/cmd/pic/symtab.c:8,22 - symtab.c:8,26
  YYSTYPE getvar(char *s)	/* return value of variable s (usually pointer) */
  {
  	struct symtab *p;
- 	static YYSTYPE bug;
+ 	static YYSTYPE bug, bugplace;
  
  	p = lookup(s);
  	if (p == NULL) {
- 		if (islower(s[0]))
+ 		if (islower(s[0])) {
  			ERROR "no such variable as %s", s WARNING;
- 		else
+ 			return(bug);
+ 		} else {
  			ERROR "no such place as %s", s WARNING;
- 		return(bug);
+ 			if(bugplace.o == NULL)
+ 				bugplace.o = makepos(0., 0.);
+ 			return(bugplace);
+ 		}
  	}
  	return(p->s_val);
  }

- erik



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-08 14:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-08  1:49 [9fans] troff pic bug report -> acid debug -> no fix yet Fernan Bolando
2011-03-08 14:55 ` erik quanstrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).