bin/100443: awk dies with SIGBUS when processing INDEX-6

Dmitry Marakasov amdmi3 at mail.ru
Mon Jul 17 16:00:37 UTC 2006


>Number:         100443
>Category:       bin
>Synopsis:       awk dies with SIGBUS when processing INDEX-6
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jul 17 16:00:35 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Dmitry Marakasov
>Release:        FreeBSD 6.1-RELEASE i386
>Organization:
>Environment:
System: FreeBSD hades.panopticon 6.1-RELEASE FreeBSD 6.1-RELEASE #0: Thu May 11 15:07:32 MSD 2006 amdmi3 at hades.panopticon:/usr/obj/usr/src/sys/HADES i386

>Description:
Today, after I did `make fetchindex' in my /usr/ports, I've tried to do some `make pretty-print-build-depends-list', which resulted in SIGBUS. After some investigation, here's what revealed: simple command

awk -F\| '{print $1}'

dies when processing part of INDEX-6 file, which is attached. I fear that this bug may be triggered in other places of ports/Mk/bsd.port.mk when processing INDEX file (though I didn't get any SIGBUS'es when updating ports today or running pkg_version).

The bug persists on my 3 boxes, all with FreeBSD-6.1-RELEASE, CPUTYPEs pentium3 and pentium4. Turning off both CPUTYPE and -O* optimisations doesn't seem to affect the bug.

>How-To-Repeat:
cd /usr/ports && make fetchindex && cd astro/stellarium && make pretty-print-build-depends-list
>Fix:
None ATM, but here's piece of INDEX-6 file that kills awk and gdb log.

--- index begins here ---
p5-Task-Catalyst-1.90|/usr/ports/www/p5-Task-Catalyst|/usr/local|All you need to start with Catalyst|/usr/ports/www/p5-Task-Catalyst/pkg-descr|lbr at FreeBSD.org|www perl5|expat-2.0.0_1 gettext-0.14.5_2 gmake-3.81_1 libiconv-1.9.2_2 p5-Algorithm-C3-0.01 p5-AppConfig-1.56 p5-Archive-Tar-1.29 p5-Array-Compare-1.13 p5-Authen-Htpasswd-0.14 p5-Authen-SASL-2.10_1 p5-Bit-Vector-6.4_1 p5-CGI-Simple-0.077_1 p5-Cache-Cache-1.05 p5-Carp-Assert-0.18 p5-Carp-Assert-More-1.12 p5-Carp-Clan-5.3 p5-Catalyst-Action-RenderView-0.04 p5-Catalyst-Devel-1.00 p5-Catalyst-Log-Log4perl-0.4 p5-Catalyst-Model-DBIC-Schema-0.16 p5-Catalyst-Plugin-Authentication-0.07 p5-Catalyst-Plugin-Authentication-Store-DBIC-0.07000 p5-Catalyst-Plugin-Authentication-Store-Htpasswd-0.020 p5-Catalyst-Plugin-Authorization-ACL-0.07 p5-Catalyst-Plugin-Authorization-Roles-0.04 p5-Catalyst-Plugin-ConfigLoader-0.11 p5-Catalyst-Plugin-DefaultEnd-0.06 p5-Catalyst-Plugin-HTML-Widget-1.1 p5-Catalyst-Plugin-I18N-0.05 p5-Catalyst-Plugin
 -Pluggable-0.04 p5-Catalyst-Plugin-Prototype-1.32 p5-Catalyst-Plugin-Session-0.05 p5-Catalyst-Plugin-Session-State-Cookie-0.02 p5-Catalyst-Plugin-Session-State-URI-0.02 p5-Catalyst-Plugin-Session-Store-File-0.07 p5-Catalyst-Plugin-Singleton-0.02 p5-Catalyst-Plugin-StackTrace-0.05 p5-Catalyst-Plugin-Static-Simple-0.14 p5-Catalyst-Plugin-SubRequest-0.10 p5-Catalyst-Plugin-XMLRPC-1.0 p5-Catalyst-Runtime-5.7000 p5-Catalyst-View-TT-0.23 p5-Class-Accessor-0.25 p5-Class-Accessor-Chained-0.01 p5-Class-C3-0.11 p5-Class-Data-Accessor-0.03 p5-Class-Data-Inheritable-0.04 p5-Class-Inspector-1.16 p5-Class-Throwable-0.10 p5-Compress-Zlib-1.41 p5-Crypt-PasswdMD5-1.3 p5-DBD-SQLite-1.12 p5-DBI-1.51 p5-DBIx-Class-0.06003 p5-DBIx-Class-Schema-Loader-0.03004 p5-Data-Dump-1.06 p5-Data-Page-2.00 p5-Data-UUID-0.14 p5-Data-Visitor-0.05 p5-Date-Calc-5.4 p5-Devel-StackTrace-1.13 p5-Digest-1.15 p5-Digest-HMAC-1.01 p5-Digest-MD5-2.36 p5-Digest-SHA1-2.11 p5-Email-Valid-0.175_1 p5-Error-0.15.009 p5-ExtUti
 ls-AutoInstall-0.63 p5-ExtUtils-CBuilder-0.18 p5-ExtUtils-MakeMaker-6.30_1 p5-ExtUtils-ParseXS-2.15 p5-File-Copy-Recursive-0.25 p5-File-Modified-0.07_1 p5-File-Slurp-9999.12 p5-File-Temp-0.16_4 p5-GSSAPI-0.22 p5-HTML-Parser-3.55 p5-HTML-Prototype-1.47 p5-HTML-Scrubber-0.08 p5-HTML-Tagset-3.10 p5-HTML-TokeParser-Simple-3.15 p5-HTML-Tree-3.20 p5-HTML-Widget-1.07 p5-HTTP-Body-0.6 p5-HTTP-Request-AsCGI-0.5 p5-HTTP-Server-Simple-0.20 p5-I18N-LangTags-0.35 p5-IO-LockedFile-0.23 p5-IO-Socket-INET6-2.51_1 p5-IO-Socket-SSL-0.97 p5-IO-String-1.08 p5-IO-Zlib-1.04_1 p5-IPC-ShareLite-0.09 p5-Lingua-EN-Inflect-1.89 p5-Lingua-EN-Inflect-Number-1.1 p5-Locale-Maketext-1.10 p5-Locale-Maketext-Lexicon-0.62 p5-Locale-Maketext-Simple-0.16 p5-Log-Log4perl-1.05 p5-MIME-Base64-3.07 p5-MIME-Types-1.16 p5-Mail-Tools-1.74 p5-Math-BigInt-1.77 p5-Memoize-1.01 p5-Module-Build-0.28.03_1 p5-Module-CoreList-2.05 p5-Module-Find-0.05 p5-Module-Install-0.63 p5-Module-Pluggable-3.01 p5-Module-Pluggable-Fast-0.1
 8 p5-Module-ScanDeps-0.61 p5-NEXT-0.60 p5-Net-1.19,1 p5-Net-DNS-0.58 p5-Net-Domain-TLD-1.65 p5-Net-IP-1.25 p5-Net-SSLeay-1.30_1 p5-Object-Signature-1.04 p5-PAR-Dist-0.10 p5-Params-Validate-0.85 p5-Path-Class-0.15 p5-PathTools-3.19 p5-Pod-Parser-1.34 p5-RPC-XML-0.58 p5-Regexp-Common-2.120 p5-SQL-Abstract-1.21 p5-SQL-Abstract-Limit-0.120 p5-Scalar-List-Utils-1.18,1 p5-Set-Object-1.15 p5-Socket6-0.19 p5-Spiffy-0.30 p5-Storable-2.15 p5-Sub-Override-0.08 p5-Sub-Uplevel-0.13 p5-Template-Timer-0.04 p5-Template-Toolkit-2.15 p5-Test-Base-0.51 p5-Test-Deep-0.095 p5-Test-Exception-0.21_1 p5-Test-Harness-2.62 p5-Test-LongString-0.09 p5-Test-MockObject-1.06 p5-Test-NoWarnings-0.082 p5-Test-Simple-0.64 p5-Test-Tester-0.10.3 p5-Test-WWW-Mechanize-1.08 p5-Test-WWW-Mechanize-Catalyst-0.37 p5-Test-Warn-0.08_1 p5-Test-use-ok-0.01 p5-Text-Balanced-1.98 p5-Text-SimpleTable-0.03 p5-Time-HiRes-1.87,1 p5-Tree-DAG_Node-1.05 p5-Tree-Simple-1.15 p5-Tree-Simple-VisitorFactory-0.10 p5-UNIVERSAL-can-1.12
  p5-UNIVERSAL-isa-0.06 p5-UNIVERSAL-require-0.10 p5-URI-1.35 p5-WWW-Mechanize-1.18 p5-XML-Parser-2.34_2 p5-YAML-0.58 p5-libwww-5.805 p5-version-0.64 perl-5.8.8 pkg-config-0.20_2 sqlite-3.3.6|expat-2.0.0_1 gettext-0.14.5_2 gmake-3.81_1 libiconv-1.9.2_2 p5-Algorithm-C3-0.01 p5-AppConfig-1.56 p5-Archive-Tar-1.29 p5-Array-Compare-1.13 p5-Authen-Htpasswd-0.14 p5-Authen-SASL-2.10_1 p5-Bit-Vector-6.4_1 p5-CGI-Simple-0.077_1 p5-Cache-Cache-1.05 p5-Carp-Assert-0.18 p5-Carp-Assert-More-1.12 p5-Carp-Clan-5.3 p5-Catalyst-Action-RenderView-0.04 p5-Catalyst-Devel-1.00 p5-Catalyst-Log-Log4perl-0.4 p5-Catalyst-Model-DBIC-Schema-0.16 p5-Catalyst-Plugin-Authentication-0.07 p5-Catalyst-Plugin-Authentication-Store-DBIC-0.07000 p5-Catalyst-Plugin-Authentication-Store-Htpasswd-0.020 p5-Catalyst-Plugin-Authorization-ACL-0.07 p5-Catalyst-Plugin-Authorization-Roles-0.04 p5-Catalyst-Plugin-ConfigLoader-0.11 p5-Catalyst-Plugin-DefaultEnd-0.06 p5-Catalyst-Plugin-HTML-Widget-1.1 p5-Catalyst-Plugin-I18N-
 0.05 p5-Catalyst-Plugin-Pluggable-0.04 p5-Catalyst-Plugin-Prototype-1.32 p5-Catalyst-Plugin-Session-0.05 p5-Catalyst-Plugin-Session-State-Cookie-0.02 p5-Catalyst-Plugin-Session-State-URI-0.02 p5-Catalyst-Plugin-Session-Store-File-0.07 p5-Catalyst-Plugin-Singleton-0.02 p5-Catalyst-Plugin-StackTrace-0.05 p5-Catalyst-Plugin-Static-Simple-0.14 p5-Catalyst-Plugin-SubRequest-0.10 p5-Catalyst-Plugin-XMLRPC-1.0 p5-Catalyst-Runtime-5.7000 p5-Catalyst-View-TT-0.23 p5-Class-Accessor-0.25 p5-Class-Accessor-Chained-0.01 p5-Class-C3-0.11 p5-Class-Data-Accessor-0.03 p5-Class-Data-Inheritable-0.04 p5-Class-Inspector-1.16 p5-Class-Throwable-0.10 p5-Compress-Zlib-1.41 p5-Crypt-PasswdMD5-1.3 p5-DBD-SQLite-1.12 p5-DBI-1.51 p5-DBIx-Class-0.06003 p5-DBIx-Class-Schema-Loader-0.03004 p5-Data-Dump-1.06 p5-Data-Page-2.00 p5-Data-UUID-0.14 p5-Data-Visitor-0.05 p5-Date-Calc-5.4 p5-Devel-StackTrace-1.13 p5-Digest-1.15 p5-Digest-HMAC-1.01 p5-Digest-MD5-2.36 p5-Digest-SHA1-2.11 p5-Email-Valid-0.175_1 p5-E
 rror-0.15.009 p5-ExtUtils-AutoInstall-0.63 p5-ExtUtils-CBuilder-0.18 p5-ExtUtils-MakeMaker-6.30_1 p5-ExtUtils-ParseXS-2.15 p5-File-Copy-Recursive-0.25 p5-File-Modified-0.07_1 p5-File-Slurp-9999.12 p5-File-Temp-0.16_4 p5-GSSAPI-0.22 p5-HTML-Parser-3.55 p5-HTML-Prototype-1.47 p5-HTML-Scrubber-0.08 p5-HTML-Tagset-3.10 p5-HTML-TokeParser-Simple-3.15 p5-HTML-Tree-3.20 p5-HTML-Widget-1.07 p5-HTTP-Body-0.6 p5-HTTP-Request-AsCGI-0.5 p5-HTTP-Server-Simple-0.20 p5-I18N-LangTags-0.35 p5-IO-LockedFile-0.23 p5-IO-Socket-INET6-2.51_1 p5-IO-Socket-SSL-0.97 p5-IO-String-1.08 p5-IO-Zlib-1.04_1 p5-IPC-ShareLite-0.09 p5-Lingua-EN-Inflect-1.89 p5-Lingua-EN-Inflect-Number-1.1 p5-Locale-Maketext-1.10 p5-Locale-Maketext-Lexicon-0.62 p5-Locale-Maketext-Simple-0.16 p5-Log-Log4perl-1.05 p5-MIME-Base64-3.07 p5-MIME-Types-1.16 p5-Mail-Tools-1.74 p5-Math-BigInt-1.77 p5-Memoize-1.01 p5-Module-Build-0.28.03_1 p5-Module-CoreList-2.05 p5-Module-Find-0.05 p5-Module-Install-0.63 p5-Module-Pluggable-3.01 p5-Mo
 dule-Pluggable-Fast-0.18 p5-Module-ScanDeps-0.61 p5-NEXT-0.60 p5-Net-1.19,1 p5-Net-DNS-0.58 p5-Net-Domain-TLD-1.65 p5-Net-IP-1.25 p5-Net-SSLeay-1.30_1 p5-Object-Signature-1.04 p5-PAR-Dist-0.10 p5-Params-Validate-0.85 p5-Path-Class-0.15 p5-PathTools-3.19 p5-Pod-Parser-1.34 p5-RPC-XML-0.58 p5-Regexp-Common-2.120 p5-SQL-Abstract-1.21 p5-SQL-Abstract-Limit-0.120 p5-Scalar-List-Utils-1.18,1 p5-Set-Object-1.15 p5-Socket6-0.19 p5-Spiffy-0.30 p5-Storable-2.15 p5-Sub-Override-0.08 p5-Sub-Uplevel-0.13 p5-Template-Timer-0.04 p5-Template-Toolkit-2.15 p5-Test-Base-0.51 p5-Test-Deep-0.095 p5-Test-Exception-0.21_1 p5-Test-Harness-2.62 p5-Test-LongString-0.09 p5-Test-MockObject-1.06 p5-Test-NoWarnings-0.082 p5-Test-Simple-0.64 p5-Test-Tester-0.10.3 p5-Test-WWW-Mechanize-1.08 p5-Test-WWW-Mechanize-Catalyst-0.37 p5-Test-Warn-0.08_1 p5-Test-use-ok-0.01 p5-Text-Balanced-1.98 p5-Text-SimpleTable-0.03 p5-Time-HiRes-1.87,1 p5-Tree-DAG_Node-1.05 p5-Tree-Simple-1.15 p5-Tree-Simple-VisitorFactory-0.1
 0 p5-UNIVERSAL-can-1.12 p5-UNIVERSAL-isa-0.06 p5-UNIVERSAL-require-0.10 p5-URI-1.35 p5-WWW-Mechanize-1.18 p5-XML-Parser-2.34_2 p5-YAML-0.58 p5-libwww-5.805 p5-version-0.64 perl-5.8.8 pkg-config-0.20_2 sqlite-3.3.6|http://search.cpan.org/dist/Task-Catalyst/|perl-5.8.8|perl-5.8.8|
p5-Template-GD-2.66|/usr/ports/www/p5-Template-GD|/usr/local|Template Toolkit plugin to interface with GD modules|/usr/ports/www/p5-Template-GD/pkg-descr|glarkin at sourcehosting.net|www textproc perl5|p5-AppConfig-1.56 p5-File-Temp-0.16_4 p5-PathTools-3.19 p5-Scalar-List-Utils-1.18,1 p5-Template-Toolkit-2.15 perl-5.8.8|p5-AppConfig-1.56 p5-File-Temp-0.16_4 p5-PathTools-3.19 p5-Scalar-List-Utils-1.18,1 p5-Template-Toolkit-2.15 perl-5.8.8|http://search.cpan.org/dist/Template-GD/|perl-5.8.8|perl-5.8.8|
--- index ends here ---

--- log begins here ---
% gdb awk
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...
(gdb) run -F\| '{print $1;}' index
Starting program: /usr/bin/awk -F\| '{print $1;}' index
p5-Task-Catalyst-1.90

Program received signal SIGBUS, Bus error.
0x0805109f in getrec (pbuf=0x8066b34, pbufsize=0x80653a8, isrecord=1)
    at /usr/src/usr.bin/awk/../../contrib/one-true-awk/lib.c:149
149                                     fldtab[0]->sval = buf;  /* buf == record */
(gdb) bt
#0  0x0805109f in getrec (pbuf=0x8066b34, pbufsize=0x80653a8, isrecord=1)
    at /usr/src/usr.bin/awk/../../contrib/one-true-awk/lib.c:149
#1  0x080528d1 in program (a=0x8076250, n=258) at run.c:191
#2  0x0805206e in execute (u=0x8076240) at run.c:156
#3  0x08055e60 in run (a=0x8076240) at run.c:131
#4  0x08051389 in main (argc=2, argv=0x0) at main.c:159
(gdb) display buf
1: buf = 0x8079000 "p5-Template-GD-2.66|/usr/ports/www/p5-Template-GD|/usr/local|Template Toolkit plugin to interface with GD modules|/usr/ports/www/p5-Template-GD/pkg-descr|glarkin at sourcehosting.net|www textproc perl5|p"...
(gdb) display fldtab[0]
2: fldtab[0] = (Cell *) 0x8060000
(gdb) display *fldtab[0]
3: *fldtab[0] = {ctype = 29 '\035', csub = 0 '\0', 
  nval = 0x1e <Error reading address 0x1e: Bad address>, 
  sval = 0x20001f <Error reading address 0x20001f: Bad address>, 
  fval = 1.2095376008502052e-312, tval = 2359296, cnext = 0x260025}
(gdb) quit
The program is running.  Exit anyway? (y or n) y
%
--- log ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list