Richard Lowe wrote:
> Peter Memishian wrote:
> > > My memory of talking to John about this, is that Studio changed the way
> > > these were represented. That bug covered the original way (and was
> > fixed in
> > > on10_61, not onnv_61 looking at the bug), the new way shows behaviour as
> > > Roland included (and I snipped).
> >
> > Oops, yes, you're right.
> >
> > > Again, from memory, my recollection is that ctfconvert is unhappy due to
> > the
> > > "#", which ctfconvert's name() (st_parse.c, around line 501) doesn't
> > treat
> > > as valid. Adding it there seemed to bandaid it, but I don't think size
> > > information for the actual symbol would be correct. (/#vla./ represents
> > the
> > > sizor, not the vla itself)
> >
> > Hmm, I didn't see a bug report covering this. Seems like one needs to be
> > filed.
>
> I had thought Roland had filed one when he first noticed this, but I can't
> currently find it either.
>
> Roland?
filed a bug for the problem last year...
... but I can't find a confirmation email from Linda Bernal... which
means the bug report was eaten/lost somewhere... ;-(((
Anyway... I filed a new one, see CR #6575435 ('ctf tools cannot handle
C99 VLAs ("variable length arrays")') ...
----
Bye,
Roland
--
__ . . __
(o.\ \/ /.o) [EMAIL PROTECTED]
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 7950090
(;O/ \/ \O;)--- Begin Message ---
*Synopsis*: ctf tools cannot handle C99 VLAs ("variable length arrays")
http://bt2ws.central.sun.com/CrPrint?id=6575435
*Change Request ID*: 6575435
*Synopsis*: ctf tools cannot handle C99 VLAs ("variable length arrays")
Product: solaris
Category: opensolaris
Subcategory: triage-queue
Type: Defect
Subtype:
Status: 1-Dispatched
Substatus:
Priority: 3-Medium
Introduced In Release:
Introduced In Build:
Responsible Manager: [EMAIL PROTECTED]
Responsible Engineer:
Initial Evaluator: [EMAIL PROTECTED]
Keywords: opensolaris
=== *Description* ============================================================
Category
utility
Sub-Category
ctf
Description
Code in OS/Net currently cannot use C99 VLA ("variable length array")
statements like...
-- snip --
void x(int len)
{
char myarray[len];
/* ... */
}
-- snip --
... such code compiles with the compiler itself but the resulting binary cannot be
processed with "ctfconvert":
-- snip --
/opt/SUNWspro/bin/cc -O -K pic -xspace -Xa -xildoff -errtags=yes
-errwarn=%all -erroff=E_EMPTY_TRANSLATION_UNIT
-erroff=E_STATEMENT_NOT_REACHED -erroff=E_UNRECOGNIZED_PRAGMA_IGNORED
-xc99=%all -D_XOPEN_SOURCE=600 -D__EXTENSIONS__=1 -W0,-xglobalstatic -v
-xstrconst -g -xc99=%all -D_XOPEN_SOURCE=600 -D__EXTENSIONS__=1
-W0,-noglobal -xdebugformat=stabs -DTEXT_DOMAIN="SUNW_OST_OSLIB"
-D_TS_ERRNO -Isrc/cmd/ksh93 -I../common/include
-I/home/test001/ksh93/on_build1/test1_x86/proto/root_i386/usr/include/ast
-DKSHELL -DSHOPT_BRACEPAT -DSHOPT_CMDLIB_BLTIN=0
-DSH_CMDLIB_DIR="/usr/ast/bin" -DSHOPT_CMDLIB_HDR="solaris_cmdlist.h"
-DSHOPT_DYNAMIC -DSHOPT_ESH -DSHOPT_FILESCAN -DSHOPT_HISTEXPAND
-DSHOPT_KIA -DSHOPT_MULTIBYTE -DSHOPT_NAMESPACE -DSHOPT_OPTIMIZE
-DSHOPT_PFSH -DSHOPT_RAWONLY -DSHOPT_SUID_EXEC -DSHOPT_SYSRC -DSHOPT_VSH
-D_BLD_shell -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t
-DUSAGE_LICENSE= "[-author?David Korn <dgk at research.att.com>]"
"[-copyright?Copyright (c) 1982-2007 AT&T Knowledge Ventures]"
"[-license?http://www.opensource.org/licenses/cpl1.0.txt]"
"[--catalog?libshell]" -DPIC -D_REENTRANT -c -o pics/bltins/read.o
../common/bltins/read.c
ERROR: ctfconvert: pics/bltins/read.o: Couldn't parse stab
"#vla0:(0,14)" (source file pics/bltins/read.o)
Removing pics/bltins/read.o
*** Error code 1
The following command caused the error:
/usr/ccs/bin/mcs -d -a "@(#)SunOS 5.11 test1_x86 October 2007"
pics/bltins/read.o ;
/home/test001/ksh93/on_build1/test1_x86/usr/src/tools/proto/opt/onbld/bin/i386/ctfconvert
-i -L VERSION pics/bltins/read.o
make: Fatal error: Command failed for target `pics/bltins/read.o'
Current working directory
/home/test001/ksh93/on_build1/test1_x86/usr/src/lib/libshell/i386
-- snip --
This problem is very frustrating since the matching code needs to be
"downgraded" to use |malloc()|, resulting in a significant performance loss.
Frequency
Always
Regression
No
Steps to Reproduce
1. Add a VLA statement to existing code.
2. Compile the source
3. Run "ctfconvert"
Expected Result
"ctfconvert" works without problems.
Actual Result
"ctfconvert" fails.
Error Message(s)
ERROR: ctfconvert: pics/bltins/read.o: Couldn't parse stab
"#vla0:(0,14)" (source file pics/bltins/read.o)
Removing pics/bltins/read.o
Test Case
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void print2(const char *s1, const char *s2)
{
char buff[strlen(s1)+strlen(s2)+1];
sprintf(buff, "%s%s", s1, s2);
puts(buff);
}
int main( void )
{
print2("hello", "world");
return EXIT_SUCCESS;
}
Workaround
No workaround possible.
|alloca()| only operates on function level and cannot be used in loops blocks
(which would exhaust the stack space depending on the number of loop
iterations).
Submitter wants to work on bug
No
Additional configuration information
Solaris 11/B61
*** (#1 of 1): 2007-06-29 03:45:26 GMT+00:00 [EMAIL PROTECTED]
*** Last Edit: 2007-06-29 03:45:26 GMT+00:00 [EMAIL PROTECTED]
=== *Comments* ===============================================================
=== *Evaluation* =============================================================
=== *Suggested Fix* ==========================================================
=== *Workaround* =============================================================
=== *Justification* ==========================================================
Priority changed from [] to [3-Medium]
Issue requires workaround which causes significant performance loss
[EMAIL PROTECTED] 2007-06-29 03:45:26 GMT
*** (#1 of 1): 2007-06-29 03:45:26 GMT+00:00 [EMAIL PROTECTED]
*** Last Edit: 2007-06-29 03:45:26 GMT+00:00 [EMAIL PROTECTED]
=== *Additional Details* =====================================================
Targeted Release:
Commit To Fix In Build:
Fixed In Build:
Integrated In Build:
Verified In Build:
See Also:
Duplicate of:
Hooks:
Hook1:
Hook2:
Hook3:
Hook4:
Hook5:
Hook6: [EMAIL PROTECTED]
Interest List:
Program Management:
Root Cause:
Requires Security Coordination: false
Fix Affects Documentation: No
Fix Affects Localization: No
Reported by:
=== *History* ================================================================
Date Submitted: 2007-06-29 03:45:26 GMT+00:00
Submitted By: [EMAIL PROTECTED]
Status Changed Date Updated Updated By
=== *Solution* ===============================================================
=== *Service Request* ========================================================
ID: 1-332113706
Customer:
Account Name: opensolaris.org bug logging
Contact Role: D-Development
Impact: Critical
Functionality: Primary
Severity: 1
Synopsis:
Product Name: solaris
Product Release: solaris_nevada
Product Build: snv_61
Operating System: solaris_nevada
Hardware: generic
Reference Number:
Sun Contact: [EMAIL PROTECTED]
Customer Contact: gisburn
Contact Type: E-External Customer
Status: Open
Source: BugTraq2
Reproducible:
Submitted By: [EMAIL PROTECTED]
Submitted Date: 2007-06-29 03:45:27 GMT+00:00
Description:
=== *Activity* ===============================================================
=== *Multiple Release (MR) Cluster* - 0 ======================================
=== *Escalations* ============================================================
--- End Message ---
_______________________________________________
tools-discuss mailing list
[email protected]