9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] drawterm crash.  small fix.  bug remains?
@ 2009-03-12 15:33 erik quanstrom
  2009-03-12 15:37 ` erik quanstrom
  0 siblings, 1 reply; 2+ messages in thread
From: erik quanstrom @ 2009-03-12 15:33 UTC (permalink / raw)
  To: 9fans

ignominously, i am dealing with an x86_64 linux
machine with 64-bit linux.  this always crashes
drawterm

1.	create new rio window
2.	put window in hold mode
3.	cut from an x application
4.	paste into drawterm window from #2.

this change stopped it from crashing.  i don't
know if this is a recent change to the x11 headers.

diff -c x11.c /root/drawterm/gui-x11/
x11.c:1426,1432 - /root/drawterm/gui-x11//x11.c:1426,1432
  	uchar *data, *xdata;
  	Atom clipboard, type, prop;
  	unsigned long lastlen;
- 	unsigned long dummy, len;
+ 	uint dummy, len;
  	int fmt, i;
  	Window w;

but i'm not fully convinced that it's all better.  i
may just be masking the problem.  notice that
c->aux == c in the following debugging output.
it may be just a coincidence, but i'm not so sure.

(gdb) r
Starting program: /root/drawterm/drawterm --c ladd
[Thread debugging using libthread_db enabled]
[New Thread 0x7f855c18c6f0 (LWP 9620)]
[New Thread 0x42455950 (LWP 9621)]
[New Thread 0x42c56950 (LWP 9627)]
[New Thread 0x43457950 (LWP 9628)]
[New Thread 0x43c58950 (LWP 9629)]
[New Thread 0x44459950 (LWP 9630)]
[New Thread 0x412be950 (LWP 9631)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x43c58950 (LWP 9629)]
0x000000000040aefa in consread (c=0x7f8500000000, buf=0x6e36a0,
    n=<value optimized out>, off=0) at devcons.c:762
762				c->aux = clipread();
(gdb) print c
$1 = (Chan *) 0x7f8500000000
(gdb) print *c
Cannot access memory at address 0x7f8500000000
(gdb) where
#0  0x000000000040aefa in consread (c=0x7f8500000000, buf=0x6e36a0,
    n=<value optimized out>, off=0) at devcons.c:762
#1  0x00000000004125f7 in kread (fd=<value optimized out>, buf=0x6e36a0,
    n=<value optimized out>, offp=0x43c57b90) at sysfile.c:408
#2  0x0000000000412665 in _syspread (fd=6877216, buf=0x7f855b830320, n=7388928,
    off=0) at sysfile.c:435
#3  0x0000000000412722 in syspread (fd=10, buf=0x6e36a0, n=1024, off=0)
    at sysfile.c:1046
#4  0x0000000000425356 in slaveread (p=0x6b8770) at exportsrv.c:606
#5  0x00000000004256f9 in blockingslave (x=<value optimized out>) at exportsrv.c:496
#6  0x0000000000415173 in tramp (vp=<value optimized out>) at posix.c:130
#7  0x00007f855ba6c097 in start_thread () from /lib/libpthread.so.0
#8  0x00007f855b7e3ccd in clone () from /lib/libc.so.6
#9  0x0000000000000000 in ?? ()
(gdb) up
#1  0x00000000004125f7 in kread (fd=<value optimized out>, buf=0x6e36a0,
    n=<value optimized out>, offp=0x43c57b90) at sysfile.c:408
408			n = devtab[c->type]->read(c, buf, n, off);
(gdb) p c
$2 = (Chan *) 0x7f8554001960
(gdb) up
#2  0x0000000000412665 in _syspread (fd=6877216, buf=0x7f855b830320, n=7388928,
    off=0) at sysfile.c:435
435		return kread(fd, buf, n, &off);
(gdb) down
#1  0x00000000004125f7 in kread (fd=<value optimized out>, buf=0x6e36a0,
    n=<value optimized out>, offp=0x43c57b90) at sysfile.c:408
408			n = devtab[c->type]->read(c, buf, n, off);
(gdb) p c->type
$3 = 1
(gdb) p c
$4 = (Chan *) 0x7f8554001960
(gdb) p c->aux
$5 = (void *) 0x7f8554001670
(gdb) p *c
$6 = {ref = {lk = {key = 0}, ref = 2}, next = 0x0, link = 0x7f8554001870,
  offset = 0, type = 1, dev = 0, mode = 0, flag = 1, qid = {path = 19, vers = 0,
    type = 0 '\0'}, fid = 133, iounit = 0, umh = 0x0, umc = 0x0, umqlock = {lk = {
      key = 0}, hold = 0x0, first = 0x0, last = 0x0}, uri = 0, dri = 0,
  mountid = 0, mcp = 0x0, mux = 0x0, aux = 0x7f8554001670, pgrpid = {path = 0,
    vers = 0, type = 0 '\0'}, mid = 0, mchan = 0x0, mqid = {path = 0, vers = 0,
    type = 0 '\0'}, session = 0x0, name = 0x7f85540008c0}
(gdb) down
#0  0x000000000040aefa in consread (c=0x7f8500000000, buf=0x6e36a0,
    n=<value optimized out>, off=0) at devcons.c:762
762				c->aux = clipread();
(gdb) p c
$7 = (Chan *) 0x7f8500000000


- erik



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

* Re: [9fans] drawterm crash.  small fix.  bug remains?
  2009-03-12 15:33 [9fans] drawterm crash. small fix. bug remains? erik quanstrom
@ 2009-03-12 15:37 ` erik quanstrom
  0 siblings, 0 replies; 2+ messages in thread
From: erik quanstrom @ 2009-03-12 15:37 UTC (permalink / raw)
  To: 9fans

nevermind.  i guess this is the right fix.  evidently i had a little
dyslexic fit at 2 in the morning.  as

0x7f8554001670 != 0x7f8554001960

- erik



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

end of thread, other threads:[~2009-03-12 15:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-12 15:33 [9fans] drawterm crash. small fix. bug remains? erik quanstrom
2009-03-12 15:37 ` 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).