From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007 Firebird/0.7 Description of problem: egrep will core Version-Release number of selected component (if applicable): grep-2.5.1-19 How reproducible: Always Steps to Reproduce: 1.curl -v http://www.alephnull.com/bz/World.out.gz -o World.out.gz 2.gunzip World.out.gz 3.egrep '(ld:|gcc:|:[0-9]*:|make.*Error)' World.out Actual Results: Thu Nov 20 13:26:25 EST 2003 imake.c:972: warning: string length `1094' is greater than the length `509' ISO C89 compilers are required to support from Imakefile.c:35: from Imakefile.c:35: from Imakefile.c:35: main.c:70:23: warning: ISO C does not permit named variadic macros ../../config/makedepend/makedepend -- -I../.. -I../../exports/include -Dlinux -D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE -D_BSD_SOURCE -D_SVID_SOURCE -D_GNU_SOURCE -DFUNCPROTO=15 -DNARROWPROTO -DXTHREADS -D_REENTRANT -DXUSE_MTSAFE_API -DUSE_SNPRINTF -DLIBXT -DUSE_MAKEDEPEND -- ActionHook.c Alloc.c ArgList.c Callback.c ClickTime.c Composite.c Constraint.c Convert.c Converters.c Core.c Create.c Destroy.c Display.c Error.c Event.c EventUtil.c Functions.c GCManager.c Geometry.c GetActKey.c GetResList.c GetValues.c HookObj.c Hooks.c Initialize.c Intrinsic.c Keyboard.c Manage.c NextEvent.c Object.c PassivGrab.c Pointer.c Popup.c PopupCB.c RectObj.c Resources.c Selection.c SetSens.c SetValues.c SetWMCW.c Shell.c StringDefs.c Threads.c TMaction.c TMgrab.c TMkey.c TMparse.c TMprint.c TMstate.c VarCreate.c VarGet.c Varargs.c Vendor.c sharedlib.c ResConfig.c XKBMAlloc.c:72: warning: comparison is always true due to limited range of data type sm_manager.c:65: warning: nested extern declaration of `_SmsProtocolSetupProc' TextTr.c:159: warning: string length `2544' is greater than the length `509' ISO C89 compilers are required to support TextTr.c:159: warning: string length `2799' is greater than the length `509' ISO C89 compilers are required to support xmlparse.c:1331: warning: function returns an aggregate bdfutils.c:133: warning: nested extern declaration of `MakeAtom' devices.c:1636: warning: function call has aggregate value miregion.c:506: warning: inlining failed in call to `miCoalesce' zsh: 25570 segmentation fault egrep '(ld:|gcc:|:[0-9]*:|make.*Error)' World.out Expected Results: no seg fault Additional info: I've used this expression for years to check these files for errors without problem (they are generated from an XFree86 build).
Created attachment 96116 [details] GDB output from grep on RedHat 9 [paul@uruk down]$ rpm -q grep grep-debuginfo grep-2.5.1-17.1 grep-debuginfo-2.5.1-17.1
Note works as expected doing: LANG=C egrep '(ld:|gcc:|:[0-9]*:|make.*Error)' World.out
Found and fixed two bugs: inputwcs was getting initialized incorrectly from mb_cache->mblen_buf, not mb_cache->wcs_buf (duh) mb_cache->wcs_buf itself was not getting initialized correctly. Although the correct amount of memory was allocated, the call to memcpy forgets to multiply the size by sizeof(wchar_t) (double-duh) Fixed package is grep-2.5.1-20 (rawhide) / grep-2.5.1-17.2 (updates).
An errata has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2004-079.html