9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: [9fans] drawterm crash.  small fix.  bug remains?
Date: Thu, 12 Mar 2009 11:33:41 -0400	[thread overview]
Message-ID: <c1f77fe2314d83f19c5ab726794110ad@quanstro.net> (raw)

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



             reply	other threads:[~2009-03-12 15:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-12 15:33 erik quanstrom [this message]
2009-03-12 15:37 ` erik quanstrom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c1f77fe2314d83f19c5ab726794110ad@quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).