Bug 160421

Summary: crash when using non-decimal data in command line parameters
Product: [Fedora] Fedora Reporter: Ulrich Drepper <drepper>
Component: gawkAssignee: Karel Zak <kzak>
Status: CLOSED RAWHIDE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideKeywords: Patch
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-06-15 16:54:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch to fix the bug
none
alternative patch by Arnold none

Description Ulrich Drepper 2005-06-15 00:59:26 UTC
Description of problem:
When the --non-decimal-data option is used and a variable gets assigned at the
command line a non-decimal value, gawk crashes.

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

How reproducible:
always

Steps to Reproduce:
1.run gawk --non-decimal-data -v a=0x1 'BEGIN { print a+0 }'
2.
3.
  
Actual results:
gawk: fatal error: internal error
Aborted

(since gawk catches SIGSEGV)

Expected results:
1

Additional info:
I'll attach a patch.  The localeconv() call must in any case be moved before the
loop initializing the variables.  If the setlocale() call, which also is moved,
must really come as late as it did, the patch must be changed to switch back
after the localeconv() call.

Comment 1 Ulrich Drepper 2005-06-15 00:59:27 UTC
Created attachment 115448 [details]
Patch to fix the bug

Comment 2 Karel Zak 2005-06-15 16:54:53 UTC
The patch with small changes sent to upstream and applied to FC4. The update
gawk-3.1.4-5.1 will be available ASAP. Thanks.

Comment 3 Ulrich Drepper 2005-06-15 20:01:09 UTC
Created attachment 115502 [details]
alternative patch by Arnold

The gawk maintainer proposed the following patch.