Ticket #1187 (closed bug: fixed)

Opened 5 years ago

Last modified 5 years ago

t/src/warnings fails test 2 on optimized build with Ubuntu 9.10 amd64

Reported by: mikehh Owned by:
Priority: normal Milestone:
Component: testing Version: trunk
Severity: medium Keywords:
Cc: Language:
Patch status: Platform:

Description

At r42229 on Ubuntu 9.10 amd64 I get an error in t/src/warnings.t

smolder #29610 and also fails on an --optimize build on MSWin32 on amd64 in smolder #29603 (not mine).

the test passed at r42203 and I first got a failure at r42011 with the same configure options

building with:

perl Configure.pl --optimize --test --maintainer --configure_trace
...
make -j test TEST_JOBS=5
...
...
(I wrapped the 'cc line which is 1404 columns --> to <--)
-->
'cc -D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -DDEBIAN  -pipe -fstack-protector
 -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
 -DHASATTRIBUTE_CONST -DHASATTRIBUTE_DEPRECATED  -DHASATTRIBUTE_MALLOC
 -DHASATTRIBUTE_NONNULL -DHASATTRIBUTE_NORETURN  -DHASATTRIBUTE_PURE
 -DHASATTRIBUTE_UNUSED -DHASATTRIBUTE_WARN_UNUSED_RESULT  -falign-functions=16
 -fvisibility=hidden -funit-at-a-time -maccumulate-outgoing-args -W -Wall
 -Waggregate-return -Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment
 -Wdisabled-optimization -Wendif-labels -Wextra -Wformat -Wformat-extra-args
 -Wformat-nonliteral -Wformat-security -Wformat-y2k -Wimplicit -Wimport
 -Winit-self -Winline -Winvalid-pch -Wlogical-op -Wmissing-braces
 -Wmissing-field-initializers -Wno-missing-format-attribute
 -Wmissing-include-dirs -Wpacked -Wparentheses -Wpointer-arith -Wreturn-type
 -Wsequence-point -Wno-shadow -Wsign-compare -Wstrict-aliasing
 -Wstrict-aliasing=2 -Wswitch -Wswitch-default -Wtrigraphs -Wundef
 -Wunknown-pragmas -Wno-unused -Wvariadic-macros -Wwrite-strings
 -Wbad-function-cast -Wc++-compat -Wdeclaration-after-statement
 -Werror=declaration-after-statement -Wimplicit-function-declaration
 -Wimplicit-int -Wmain -Wmissing-declarations -Wmissing-prototypes
 -Wnested-externs -Wnonnull -DDISABLE_GC_DEBUG=1 -DNDEBUG -O2 -g
 -DHAS_GETTEXT   -I./include -c -o t/src/warnings_2.o
 t/src/warnings_2.c'
 failed with exit code 1
<--
# Failed to build 't/src/warnings_2.o': t/src/warnings_2.c: In function ‘main’:
# t/src/warnings_2.c:15: error: dereferencing pointer to incomplete type

#   Failed test 'Parrot_warn'
#   at t/src/warnings.t line 56.
# Looks like you failed 1 test of 2.
t/src/warnings.t ............................ Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/2 subtests
...

Test Summary Report
-------------------
t/src/warnings.t                          (Wstat: 256 Tests: 2 Failed: 1)
  Failed test:  2
  Non-zero exit status: 1
Files=339, Tests=11265, 76 wallclock secs ( 3.98 usr  0.73 sys + 68.54 cusr 28.41 csys = 101.66 CPU)
Result: FAIL
make: *** [test_core] Error 1

however doing an unoptimized build

perl Configure.pl --test
...
make -j test TEST_JOBS=5
...

All tests successful.
Files=339, Tests=11225, 83 wallclock secs ( 3.51 usr  0.62 sys + 92.83 cusr 26.43 csys = 123.39 CPU)
Result: PASS

BTW: note that the optimize build tests run about 9% faster even with it running more tests

Change History

Changed 5 years ago by dukeleto

Same failure on OS X 10.5 (x86)

(kadath)(~/svn/parrot)$ prove -v t/src/warnings.t 

ok 1 - print_pbc_location
# 'cc -fno-common -no-cpp-precomp  -pipe -fstack-protector -I/usr/local/include -I/opt/local/include -pipe -fno-common -Wno-long-double  -DHASATTRIBUTE_CONST  -DHASATTRIBUTE_DEPRECATED  -DHASATTRIBUTE_MALLOC  -DHASATTRIBUTE_NONNULL  -DHASATTRIBUTE_NORETURN  -DHASATTRIBUTE_PURE  -DHASATTRIBUTE_UNUSED  -DHASATTRIBUTE_WARN_UNUSED_RESULT  -falign-functions=16 -fvisibility=hidden -funit-at-a-time -maccumulate-outgoing-args -W -Wall -Waggregate-return -Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment -Wdisabled-optimization -Wendif-labels -Wextra -Wformat -Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-y2k -Wimplicit -Wimport -Winit-self -Winline -Winvalid-pch -Wmissing-braces -Wmissing-field-initializers -Wno-missing-format-attribute -Wmissing-include-dirs -Wpacked -Wparentheses -Wpointer-arith -Wreturn-type -Wsequence-point -Wno-shadow -Wsign-compare -Wstrict-aliasing -Wstrict-aliasing=2 -Wswitch -Wswitch-default -Wtrigraphs -Wundef -Wunknown-pragmas -Wno-unused -Wvariadic-macros -Wwrite-strings -Wbad-function-cast -Wdeclaration-after-statement -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wnonnull -DDISABLE_GC_DEBUG=1 -DNDEBUG -O3 -DHAS_GETTEXT   -I./include -c -o t/src/warnings_2.o t/src/warnings_2.c' failed with exit code 1
# Failed to build 't/src/warnings_2.o': t/src/warnings_2.c: In function ‘main’:
# t/src/warnings_2.c:15: error: dereferencing pointer to incomplete type
not ok 2 - Parrot_warn

#   Failed test 'Parrot_warn'
#   at t/src/warnings.t line 56.
# Looks like you failed 1 test of 2.
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/2 subtests 

Test Summary Report
-------------------
t/src/warnings.t (Wstat: 256 Tests: 2 Failed: 1)
  Failed test:  2
  Non-zero exit status: 1
Files=1, Tests=2,  2 wallclock secs ( 0.02 usr  0.02 sys +  0.23 cusr  0.11 csys =  0.38 CPU)
Result: FAIL
Failed 1/1 test programs. 1/2 subtests failed.

Changed 5 years ago by mikehh

All tests PASS (pre/post-config, smoke (#29616), fulltest) at r42235 - Ubuntu 9.10 amd64 (no --optimize)

with --optimize t/src/warnings.t fails test: 2 - smoke (#29617), fulltest at r42235 - Ubuntu 9.10 amd64
all other tests PASS

t/src/warnings.t from line 56 - the failure appears to happen on the last line here (line 71)

c_output_is( <<'CODE', <<'OUTPUT', "Parrot_warn" );

#include <parrot/parrot.h>
#include <parrot/embed.h>

int
main(int argc, char* argv[])
{
    Interp *interp;
    int error_val;

    interp = Parrot_new(NULL);
    if (!interp) {
        return 1;
    }
    PARROT_WARNINGS_on(interp, PARROT_WARNINGS_ALL_FLAG);
...

Changed 5 years ago by mikehh

chromatic commented via the mailing list which does not appear in the ticket (don't know why):

This is because an optimized Parrot (built with -DNDEBUG) will not export the Parrot_pcc_warnings_on() symbol, thanks to a series of clever macro definitions in include/parrot/context.h:

$ nm -g blib/lib/libparrot.so | grep Parrot_pcc_warnings

We need to fix those macros so that the symbols always get exported but the Parrot core itself can use the quick accessors.

-- c

with a g++ build (with --optimize) at r42301, I get the following:

# t/src/warnings_2.c:14: error: invalid use of incomplete type ‘struct Parrot_Context_attributes’
# ./include/parrot/context.h:34: error: forward declaration of ‘struct Parrot_Context_attributes’

Changed 5 years ago by mikehh

this test fails on all --optimize builds that I, and others, have tested

the test passes without --optimize

I have tested on Ubuntu 9.04 amd64, Ubuntu 9.10 amd64 and Ubuntu 9.10 i386 with both gcc and g++ and in all cases it fails with an --optimize build and passes without --optimize

with g++ builds I get the additional error:

# ./include/parrot/context.h:34: error: forward declaration of ‘struct Parrot_Context_attributes’

Changed 5 years ago by jkeenan

I got same problem with t/src/warnings.t as reported in TT #1232, which I am closing in favor of this ticket.

kid51

Changed 5 years ago by mikehh

  • status changed from new to closed
  • resolution set to fixed

The test now passes after bacek++ fixed include/parrot/context.h (r42444)

I am closing the ticket as fixed

Note: See TracTickets for help on using tickets.