9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Pietro Gagliardi <pietro10@mac.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] sed crash
Date: Wed,  4 Feb 2009 22:45:16 -0500	[thread overview]
Message-ID: <A951D84C-F042-4315-8C2A-F29AA098FBC0@mac.com> (raw)
In-Reply-To: <515513BE-5416-43D9-8B63-DFABBEF24590@mac.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The bug doesn't seem to be in sed. The match() function calls
rregexec(), which sets a strucuture that is set to loc2, which is made
null for some reason.

On Feb 4, 2009, at 10:08 PM, Pietro Gagliardi wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> 	lp = loc2;
> 	loc2 = sp - genbuf + linebuf;
> 	while(*sp++ = *lp++)
>
> At the point of crash, loc2 is a null pointer when it is assigned to
> lp, so when the while() statement executes, crash. Now to find out
> why and when loc2 becomes null.
>
> On Feb 4, 2009, at 9:59 PM, Pietro Gagliardi wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> On Feb 4, 2009, at 9:28 PM, Uriel wrote:
>>
>>> For those that enjoy fixing bugs:
>>>
>>> % echo foo | sed
>>> 's
>>> /..a|..b|..c|..d|..e|..f|..g|..h|..i|..j|..k|..l|..m|..n|..o|..p//g'
>>>
>>> Will crash both native and p9p sed.
>>>
>>> Yes, I know it is a nonsensical expression, but it is the simplest
>>> one
>>> that still made it crash, I have lost the original version which was
>>> much more complex.
>>>
>>> Note that providing two characters as input will still crash, but if
>>> the input line is a single character it wont crash.
>>>
>>> I have been meaning to get all the fun of tracking this one down
>>> myself for a while, but seems that I never get to it, so I will let
>>> others enjoy the fun of fixing it.
>>>
>>> Peace
>>>
>>> uriel
>>>
>> For me, it crashes on the second line of input, in the dosub()
>> function. Will investigate now.
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.8 (Darwin)
>>
>> iEYEARECAAYFAkmKVgoACgkQuv7AVNQDs+x7ZACfYvtxSB5c8TD8LFFjPPHsgtah
>> 9DwAnjIQ0GM4b82JGPpdJIUYfHjs7+Pv
>> =7lRk
>> -----END PGP SIGNATURE-----
>>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.8 (Darwin)
>
> iEYEARECAAYFAkmKWCEACgkQuv7AVNQDs+xSQQCgoFPwqMsaphtaKBTHHLFryiJr
> eUMAnA9BjuDpMU40VqJp5hu1EDr3mdXp
> =XF/E
> -----END PGP SIGNATURE-----
>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)

iEUEARECAAYFAkmKYMwACgkQuv7AVNQDs+xcpACYi9wXYM/0ONUOOrqPJu4ViRFZ
BACfTLv0GRuZzUP/WYeU72Jm+KqDunw=
=Vrfb
-----END PGP SIGNATURE-----



  reply	other threads:[~2009-02-05  3:45 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-05  2:28 Uriel
2009-02-05  2:59 ` Pietro Gagliardi
2009-02-05  3:08   ` Pietro Gagliardi
2009-02-05  3:45     ` Pietro Gagliardi [this message]
2009-02-05  3:51       ` Akshat Kumar
2009-02-05  3:58         ` andrey mirtchovski
2009-02-05  4:39           ` Pietro Gagliardi
2009-02-05 11:14             ` Iruata Souza
2009-02-05 13:16             ` erik quanstrom
2009-02-05 14:31               ` Joel C. Salomon
2009-02-05 14:44                 ` erik quanstrom
2009-02-05 21:02               ` Pietro Gagliardi
2009-02-05 21:13                 ` erik quanstrom
2009-02-07  0:21                   ` Derek Fawcus
2009-02-05 21:21                 ` john
2009-02-05 23:02             ` Akshat Kumar
2009-02-05 23:11               ` hiro
2009-02-05 23:18                 ` Akshat Kumar
2009-02-05  4:15 ` Russ Cox
2009-02-05 14:41   ` Uriel
2009-02-05 17:27     ` Russ Cox
2009-02-05 22:56       ` Uriel

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=A951D84C-F042-4315-8C2A-F29AA098FBC0@mac.com \
    --to=pietro10@mac.com \
    --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).