user/4991: mg bus error when searching on sparc64

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

user/4991: mg bus error when searching on sparc64

Marco S Hyman
>Number:         4991
>Category:       user
>Synopsis:       mg bus error whan searching on sparc64
>Confidential:   yes
>Severity:       critical
>Priority:       medium
>Responsible:    bugs
>State:          open
>Quarter:        
>Keywords:      
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 26 19:10:01 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Marco S Hyman
>Release:        OpenBSD 3.8-current (GENERIC) #14: Sun Jan 15 16:15:45 PST 2006
>Organization:
net
>Environment:
       
        System      : OpenBSD 3.8
        Architecture: OpenBSD.sparc64
        Machine     : sparc64
>Description:
        Search fails with core dump after adding a word to search
        string with ^W.

>How-To-Repeat:
        In mg place cursor on start of a word.
        hit ^S to start search
        hit ^W to add current word to search string
        hit ^S to find next occurance of word
        Bus error (core dumped)

>Fix:
        unknown


>Release-Note:
>Audit-Trail:
>Unformatted:

Reply | Threaded
Open this post in threaded view
|

Re: user/4991: mg bus error when searching on sparc64

Otto Moerbeek
The following reply was made to PR user/4991; it has been noted by GNATS.

From: Otto Moerbeek <[hidden email]>
To: [hidden email]
Cc: [hidden email], [hidden email]
Subject: Re: user/4991: mg bus error when searching on sparc64
Date: Thu, 26 Jan 2006 21:22:30 +0100 (CET)

 On Thu, 26 Jan 2006, [hidden email] wrote:
 
 > >Number:         4991
 > >Category:       user
 > >Synopsis:       mg bus error whan searching on sparc64
 
 > >How-To-Repeat:
 > In mg place cursor on start of a word.
 > hit ^S to start search
 > hit ^W to add current word to search string
 > hit ^S to find next occurance of word
 > Bus error (core dumped)
 
 pptr is -1 if ^W follows the ^S immediately. This seems to fix it, but
 beware, this is the first time I looked at the mg source...
 
  -Otto
 
 Index: search.c
 ===================================================================
 RCS file: /cvs/src/usr.bin/mg/search.c,v
 retrieving revision 1.27
 diff -u -r1.27 search.c
 --- search.c 13 Dec 2005 06:01:27 -0000 1.27
 +++ search.c 26 Jan 2006 20:20:29 -0000
 @@ -296,6 +296,8 @@
  if (ISUPPER(CHARMASK(pat[i])))
  xcase = 1;
 
 + if (pptr < 0)
 + pptr = 0;
  while (cbo < llength(clp)) {
  c = lgetc(clp, cbo++);
  if ((!firstc && !isalnum(c)) || pptr == NPAT)

Reply | Threaded
Open this post in threaded view
|

Re: user/4991: mg bus error when searching on sparc64

Otto Moerbeek
In reply to this post by Marco S Hyman
The following reply was made to PR user/4991; it has been noted by GNATS.

From: Otto Moerbeek <[hidden email]>
To: Marco S Hyman <[hidden email]>, [hidden email]
Cc: [hidden email]
Subject: Re: user/4991: mg bus error when searching on sparc64
Date: Thu, 26 Jan 2006 21:48:05 +0100 (CET)

 On Thu, 26 Jan 2006, Otto Moerbeek wrote:
 
 >  pptr is -1 if ^W follows the ^S immediately. This seems to fix it, but
 >  beware, this is the first time I looked at the mg source...
 
 This is probably better, since it also covers backward searches.
 
  -Otto
 
 Index: search.c
 ===================================================================
 RCS file: /cvs/src/usr.bin/mg/search.c,v
 retrieving revision 1.27
 diff -u -r1.27 search.c
 --- search.c 13 Dec 2005 06:01:27 -0000 1.27
 +++ search.c 26 Jan 2006 20:45:57 -0000
 @@ -285,6 +285,8 @@
  clp = curwp->w_dotp;
  cbo = curwp->w_doto;
  firstc = 1;
 + if (pptr == -1)
 + pptr = 0;
  if (dir == SRCH_BACK) {
  /* when isearching backwards, cbo is the start of the pattern */
  cbo += pptr;

Reply | Threaded
Open this post in threaded view
|

Re: user/4991: mg bus error when searching on sparc64

Marco S Hyman
In reply to this post by Marco S Hyman
The following reply was made to PR user/4991; it has been noted by GNATS.

From: Marco S Hyman <[hidden email]>
To: Otto Moerbeek <[hidden email]>
Cc: [hidden email], [hidden email]
Subject: Re: user/4991: mg bus error when searching on sparc64
Date: Fri, 27 Jan 2006 14:07:43 -0800

 Otto Moerbeek writes:
  >
  > On Thu, 26 Jan 2006, Otto Moerbeek wrote:
  >
  > >  pptr is -1 if ^W follows the ^S immediately. This seems to fix it, but
  > >  beware, this is the first time I looked at the mg source...
  >
  > This is probably better, since it also covers backward searches.
 
 works for me.  Thanks.
 
 // marc