9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: quanstro@quanstro.net (erik quanstrom)
Subject: [9fans] drawterm bug
Date: Tue, 22 Mar 2011 10:40:35 -0400	[thread overview]
Message-ID: <6223ef47198082d6b74693b16a82846b@ladd.quanstro.net> (raw)
In-Reply-To: <6a7e42f7236652d4761e22c1159e92db@ladd.quanstro.net>

On Mon Mar 21 11:38:22 EDT 2011, quanstro at quanstro.net wrote:
> this is drawterm on osx 10.6 to plan 9.
> 
> i don't have time to investigate right now, but here's the bug
> looks like sign extension.
> 
> minooka; cp /mnt/term/tmp/file.gz .
> cp: error reading /mnt/term/tmp/file.gz: negative i/o offset
> minooka; ls -l
> --rw-r--r-- M 1638 xxx xxx 2147483648 Mar 21 11:05 file.gz

it wasn't hard to get a reproducer:

	; dd -iseek 2147483640 -count 10 -if /mnt/term/dev/zero -of fubar -bs 1
	read: negative i/o offset
	8+0 records in
	8+0 records out

this smelled like a sign extension bug, and sure enough, it was
in the first place i looked

hg diff include/fcall.h
diff -r 005885bfe3f2 include/fcall.h
--- a/include/fcall.h	Tue Dec 28 16:40:27 2010 -0500
+++ b/include/fcall.h	Tue Mar 22 10:28:00 2011 -0400
@@ -37,7 +37,7 @@
 #define	GBIT8(p)	((p)[0])
 #define	GBIT16(p)	((p)[0]|((p)[1]<<8))
 #define	GBIT32(p)	((p)[0]|((p)[1]<<8)|((p)[2]<<16)|((p)[3]<<24))
-#define	GBIT64(p)	((vlong)((p)[0]|((p)[1]<<8)|((p)[2]<<16)|((p)[3]<<24)) |\
+#define	GBIT64(p)	((u32int)((p)[0]|((p)[1]<<8)|((p)[2]<<16)|((p)[3]<<24)) |\
 				((vlong)((p)[4]|((p)[5]<<8)|((p)[6]<<16)|((p)[7]<<24)) << 32))
 
 #define	PBIT8(p,v)	(p)[0]=(v)

hg is a pain, so the drawterm-fixes patch queue broke as
soon as russ pulled in some changes.  i'll try to work out
how to get this up while causing minimal chaos.

- erik



  reply	other threads:[~2011-03-22 14:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-21 15:36 erik quanstrom
2011-03-22 14:40 ` erik quanstrom [this message]
2011-03-22 17:40   ` erik quanstrom
2011-03-22 17:59     ` Skip Tavakkolian
2011-03-22 18:57       ` erik quanstrom
2011-03-22 17:45   ` Jeff Sickel
2011-03-22 17:51     ` erik quanstrom
2011-03-22 18:02       ` Jeff Sickel
2011-03-25 19:48         ` Ethan Grammatikidis
2011-03-25 20:09           ` dexen deVries
2011-03-25 21:00             ` Jeff Sickel

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=6223ef47198082d6b74693b16a82846b@ladd.quanstro.net \
    --to=quanstro@quanstro.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).