🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #1048

regex-0.11 bug?

#1048
From: Jim Meyering
Date: Fri, 06 Nov 1992 15:34
36 lines
1377 bytes
Summary: re_search hangs in infinite loop

Using regex.[ch] from the 0.11 distribution, the following program
doesn't terminate.  The example is based on one from the tests in
GNU m4.  I've tried this with {sun,sgi} and {gcc-2.3.1,cc} with -g.
The version of regex (rather old) that came with m4-1.0 showed
similar problems with gcc on an SGI.

--
Jim Meyering             | Member of the League for Programming Freedom
meyering@cs.utexas.edu   | Contact me or lpf@uunet.uu.net for more info.

----
#include <sys/types.h>
#include "regex.h"
#define REG_EXPR "\\w+"
#define STRING "a"

int
main ()
{
  struct re_pattern_buffer pat_buf;
  char *msg;

  pat_buf.translate = 0;
  pat_buf.fastmap = 0;
  pat_buf.buffer = 0;
  pat_buf.allocated = 0;

  msg = re_compile_pattern (REG_EXPR, strlen (REG_EXPR), &pat_buf);
  if (msg)
    abort ();

  re_search (&pat_buf, STRING, strlen (STRING), 0, strlen (STRING), 0);
  exit (0);
}
Technical Details
Message-ID: <9211070334.AA29926@ai.cs.utexas.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cs.utexas.edu!meyering

Show Full Headers
Complete Article Headers
Newsgroups: gnu.utils.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!cs.utexas.edu!meyering
From: meyering@cs.utexas.edu (Jim Meyering)
Subject: regex-0.11 bug?
Message-ID: <9211070334.AA29926@ai.cs.utexas.edu>
Sender: gnulists@ai.mit.edu
Organization: U of TX at Austin CS Dept
Distribution: gnu
Date: Fri, 6 Nov 1992 15:34:00 GMT
Approved: bug-gnu-utils@prep.ai.mit.edu
Lines: 37