Bug 174551 - Regular expressions fail if srand() is used.
Regular expressions fail if srand() is used.
Product: Fedora
Classification: Fedora
Component: gawk (Show other bugs)
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Karel Zak
Brock Organ
Depends On:
  Show dependency treegraph
Reported: 2005-11-29 17:16 EST by Milan Simanek
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-03-22 17:16:53 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
chroot with all files (1.15 MB, application/x-gzip)
2006-02-22 16:14 EST, Milan Simanek
no flags Details

  None (edit)
Description Milan Simanek 2005-11-29 17:16:34 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8a6) Gecko/20050111

Description of problem:
When srand() is used in BEGIN action, then regular expression pattern will not fire its action for no input line.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
echo good|gawk 'BEGIN {srand();}; /o/ {print "OK";}'


Actual Results:  none

Expected Results:  OK

Additional info:
Comment 1 Karel Zak 2006-02-21 10:45:07 EST
I'm not able to reproduce this bug.

# echo good|gawk 'BEGIN {srand();}; /o/ {print "OK";}'

# rpm -q gawk
Comment 2 Milan Simanek 2006-02-22 16:14:53 EST
Created attachment 125058 [details]
chroot with all files

This archive contains all files necessary to reproduce the bug.
You need also x86_64 architecture and 2.6 kernel.

Untar it and run "./run_me" script.
Comment 3 Milan Simanek 2006-02-22 19:16:00 EST
The bug has been reached on system with kernel 2.6.14-1.1653_FC4,
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 15
model           : 47
model name      : AMD Athlon(tm) 64 Processor 3500+
stepping        : 0
cpu MHz         : 2211.340
cache size      : 512 KB
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt lm 3dnowext 3dnow
pni lahf_lm
bogomips        : 4427.41
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp tm stc

# ldd /usr/bin/gawk
        libdl.so.2 => /lib64/libdl.so.2 (0x0000003fd8d00000)
        libm.so.6 => /lib64/libm.so.6 (0x0000003fd8b00000)
        libc.so.6 => /lib64/libc.so.6 (0x0000003fd8800000)
        /lib64/ld-linux-x86-64.so.2 (0x0000003fd8600000)
# rpm -qf /lib64/libdl.so.2
# rpm -qf /lib64/libm.so.6
# rpm -qf /lib64/libc.so.6
# rpm -qf /lib64/ld-linux-x86-64.so.2
Comment 4 Karel Zak 2006-02-23 09:40:30 EST
Sorry, I've overlooked the architecture ;-( I'm able to preproduce this bug on
x86_64. Thanks!
Comment 5 Fedora Update System 2006-02-24 11:10:44 EST
From User-Agent: XML-RPC

gawk-3.1.4-5.4 has been pushed for FC4, which should resolve this issue.  If these problems are still present in this version, then please make note of it in this bug report.
Comment 6 Milan Simanek 2006-03-01 03:38:15 EST
Yes, I can confirm gawk-3.1.4-5.4 solved this bug.

P.S.: Could you specify the reason of the bug?
Comment 7 Karel Zak 2006-03-22 17:16:53 EST
The reason has been wrong types in the random routines.

Note You need to log in before you can comment on or make changes to this bug.