You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Scott Zhong <sc...@roguewave.com> on 2006/06/05 23:02:44 UTC

IBM VAC++ 8.0 linux placement issues

There are several stdlib test that uses mynew.h and the placement new is
causing it to seg fault.

 

Affected tests:

 

tests/stdlib/containers/deque_modifiers
tests/stdlib/diagnostics/exceptions

tests/stdlib/test/new

tests/stdlib/utilities/temp_buffer

 

---------------- tests/stdlib/containers/deque_modifiers
-------------------------------------

 

Starting program:
/build/scottz/ed9/tests/stdlib/containers/stdlib_rs/deque_modifiers 

 

Program received signal SIGSEGV, Segmentation fault.

0x000000001001fb1c in operator new (n=96) at mynew.h:160

160 {

(gdb) where

#0  0x000000001001fb1c in operator new (n=96) at mynew.h:160

#1  0x00000000100cfb44 in __rw::__rw_allocate (nbytes=96) at
memory.cpp:46

#2  0x0000000010011d3c in std::allocator<X>::allocate
(this=0x1ffffffce48, __n=2) at _allocator.h:138

#3  0x0000000010011e6c in std::deque<X, std::allocator<X> >::_C_push
(this=0x1ffffffd8e8, __at_back=true, __x=@0x10190df8) at deque.cc:178

#4  0x00000000100144fc in std::deque<X, std::allocator<X> >::push_back
(this=0x1ffffffd8e8, __x=@0x10190df8) at deque:825

#5  0x00000000100153bc in std::deque<X, std::allocator<X> >::_C_insert_n
(this=0x1ffffffd8e8, __it=@0x1ffffffd480, __n=1, __x=@0x10190df8)

    at deque.cc:445

#6  0x0000000010015710 in std::deque<X, std::allocator<X> >::insert
(this=0x1ffffffd8e8, __it=@0x1ffffffd480, __n=1, __x=@0x10190df8) at
deque:609

#7  0x0000000010016814 in std::deque<X, std::allocator<X> >::_C_assign_n
(this=0x1ffffffd8e8, __n=1, __x=@0x10190df8) at deque.cc:381

#8  0x00000000100168a8 in std::deque<X, std::allocator<X> >::assign
(this=0x1ffffffd8e8, __n=1, __x=@0x10190df8) at deque:498

#9  0x000000001001ed64 in exception_loop<X*> (t=@0x1ffffffe390,
line=1032, mfun=Assign_n, fcall=0x1ffffffd928 "deque().assign(1, 65)", 

    exceptions=-1, deq=@0x1ffffffd8e8, it=@0x1ffffffdd30, n=1,
x=0x10190df8, first=@0x1ffffffe078, last=@0x1ffffffe078,
n_copy=0x1ffffffdd28, 

    n_asgn=0x1ffffffdd2c) at deque_modifiers.cpp:184

#10 0x00000000100870b0 in test_assign<X*> (t=@0x1ffffffe390, line=1032,
exceptions=-1, dummy=@0x1ffffffe078, nelems=1, 

    seq=0x100fff70 "abcdefghijklmnopqrstuvwxyz", seqlen=0,
asn=0x100fff8c 'A' <repeats 26 times>, asnlen=1, res=0x100fff8c 'A'
<repeats 26 times>, 

    reslen=1) at deque_modifiers.cpp:900

#11 0x000000001008839c in test_assign (t=@0x1ffffffe390) at
deque_modifiers.cpp:1032

#12 0x00000000100886ac in Test::runTest (this=0x1ffffffe390) at
deque_modifiers.cpp:1515

#13 0x00000000100a0fd0 in RWQETest::go (this=0x1ffffffe390) at
rwtest.cpp:857

#14 0x000000001007bbe0 in main (argc=1, argv=0x1ffffffe9e8) at
deque_modifiers.cpp:1534

 

----------------- tests/stdlib/diagnostics/exceptions ----------------

 

Starting program:
/build/scottz/ed9/tests/stdlib/diagnostics/stdlib_rs/exceptions 

 

Program received signal SIGSEGV, Segmentation fault.

0x0000000010013ea8 in operator new (n=65536) at mynew.h:160

warning: Source file is more recent than executable.

 

160 {

(gdb) where

#0  0x0000000010013ea8 in operator new (n=65536) at mynew.h:160

#1  0x0000000010015034 in Test::runTest (this=0x1ffffffe390) at
exceptions.cpp:356

#2  0x000000001002f0e0 in RWQETest::go (this=0x1ffffffe390) at
rwtest.cpp:857

#3  0x0000000010017cdc in main (argc=1, argv=0x1ffffffe9e8) at
exceptions.cpp:451

 

---------------- tests/stdlib/test/new -----------------------------

 

Starting program: /build/scottz/ed9/tests/stdlib/test/stdlib_rs/new 

 

Program received signal SIGSEGV, Segmentation fault.

0x00000000100046a0 in operator new (n=0) at mynew.h:160

warning: Source file is more recent than executable.

 

160 {

(gdb) where

#0  0x00000000100046a0 in operator new (n=0) at mynew.h:160

#1  0x0000000010004d20 in test_bad_alloc (t=@0x1ffffffe3a0) at
new.cpp:141

#2  0x000000001000d01c in Test::runTest (this=0x1ffffffe3a0) at
new.cpp:452

#3  0x00000000100244a0 in RWQETest::go (this=0x1ffffffe3a0) at
rwtest.cpp:857

#4  0x0000000010008350 in main (argc=1, argv=0x1ffffffea08) at
new.cpp:476

 

-------------------  tests/stdlib/utilities/temp_buffer
---------------------

 

Starting program:
/build/scottz/ed9/tests/stdlib/utilities/stdlib_rs/temp_buffer 

 

Program received signal SIGSEGV, Segmentation fault.

0x0000000010004de4 in operator new (n=9223372036854775808) at
mynew.h:160

160 {

(gdb) where

#0  0x0000000010004de4 in operator new (n=9223372036854775808) at
mynew.h:160

#1  0x0000000010058d34 in __rw::__rw_allocate
(nbytes=9223372036854775808) at memory.cpp:46

#2  0x00000000100600fc in __rw_tmpbuf (pptr=0x1ffffffdda0,
nelems=2305843009213693952, size=4) at tmpbuf.cpp:108

#3  0x0000000010005a28 in std::get_temporary_buffer<int, long>
(__nelems=2305843009213693952) at _rawiter.h:125

#4  0x00000000100065d0 in std::get_temporary_buffer<int>
(__n=2305843009213693952) at _rawiter.h:139

#5  0x000000001000cad0 in test_failure<int> (t=@0x1ffffffe390) at
temp_buffer.cpp:278

#6  0x0000000010012bd0 in test_get_temporary_buffer<int>
(t=@0x1ffffffe390, dummy=0x0) at temp_buffer.cpp:401

#7  0x0000000010012cfc in Test::runTest (this=0x1ffffffe390) at
temp_buffer.cpp:410

#8  0x000000001002a1c0 in RWQETest::go (this=0x1ffffffe390) at
rwtest.cpp:857

#9  0x0000000010010d44 in main (argc=1, argv=0x1ffffffe9e8) at
temp_buffer.cpp:468

 

 

 

Yu (Scott) Zhong

Consulting Engineer

Rogue Wave Software, a Quovadxtm division

scottz@roguewave.com

ph: 303 545 3182

 


Re: IBM VAC++ 8.0 linux placement issues

Posted by Martin Sebor <se...@roguewave.com>.
I reproduced the crash in a small compiler-only test case
(specific to XLC++) and filed a PMR with IBM. Here are the
details: http://issues.apache.org/jira/browse/STDCXX-199.
It looks to me like exceptions are essentially unusable
in this configuration.

Martin

Martin Sebor wrote:
> Scott Zhong wrote:
> 
>> There are several stdlib test that uses mynew.h and the placement new is
>> causing it to seg fault.
>>
>>  
>>
>> Affected tests:
>>
>>  
>>
>> tests/stdlib/containers/deque_modifiers
>> tests/stdlib/diagnostics/exceptions
>>
>> tests/stdlib/test/new
> 
> 
> This test exercises the correctness of the replaced operators
> themselves (i.e., those defined by the test suite to exercise
> the rest of the library). The other tests most likely all crash
> because there's something wrong with the operator. The test runs
> with the expected results when compiled with gcc so it seems that
> this might be specific to XLC++.
> 
> The stack trace from the core dump (below) shows that it occurs
> in the replacement operator new which is just a forwarding
> function with hardly any body:
> 
> 166     void* operator new (_RWSTD_SIZE_T n) _THROWS ((_RWSTD_BAD_ALLOC))
> 167     {
> 168         return operator_new (n, false);
> 169     }
> 
> That seems to suggest some kind of runtime library problem.
> Let me try to reproduce it in a smaller test case.
> 
> Here's the backtrace:
> 
> (gdb) where
> #0  0x0000000010003e78 in operator new (n=0) at rw_new.h:167
> #1  0x00000000100044fc in test_bad_alloc ()
>     at /amd/devco/sebor/dev/stdlib/tests/test/00_new.cpp:138
> #2  0x00000000100083f8 in run_test ()
>     at /amd/devco/sebor/dev/stdlib/tests/test/00_new.cpp:470
> #3  0x000000001000a080 in rw_vtest (argc=1, argv=0x1ffffffeff8,
>     file_name=0x100a719c 
> "/amd/devco/sebor/dev/stdlib/tests/test/00_new.cpp",
>     clause=0x0, comment=0x0,
>     fun=@0x100f7050: 0x10008398 <run_test(int, char**)>,
>     optstr=0x100a72ec "|-no-new-delete# |-no-bad_alloc# |-no-mismatch# 
> |-no-bad-delete# |-no-double-delete# |-no-corruption# |-no-leaks# 
> |-no-stress-test#",
>     va=0x1ffffffea48 "")
>     at /amd/devco/sebor/dev/stdlib/tests/src/driver.cpp:1043
> #4  0x000000001000b1fc in rw_test (argc=1, argv=0x1ffffffeff8,
>     fname=0x100a719c "/amd/devco/sebor/dev/stdlib/tests/test/00_new.cpp",
>     clause=0x0, comment=0x0,
>     testfun=@0x100f7050: 0x10008398 <run_test(int, char**)>,
>     optstr=0x100a72ec "|-no-new-delete# |-no-bad_alloc# |-no-mismatch# 
> |-no-bad-delete# |-no-double-delete# |-no-corruption# |-no-leaks# 
> |-no-stress-test#")
>     at /amd/devco/sebor/dev/stdlib/tests/src/driver.cpp:1140
> #5  0x0000000010005f7c in main (argc=1, argv=0x1ffffffeff8)
>     at /amd/devco/sebor/dev/stdlib/tests/test/00_new.cpp:485


Re: IBM VAC++ 8.0 linux placement issues

Posted by Martin Sebor <se...@roguewave.com>.
Scott Zhong wrote:
> There are several stdlib test that uses mynew.h and the placement new is
> causing it to seg fault.
> 
>  
> 
> Affected tests:
> 
>  
> 
> tests/stdlib/containers/deque_modifiers
> tests/stdlib/diagnostics/exceptions
> 
> tests/stdlib/test/new

This test exercises the correctness of the replaced operators
themselves (i.e., those defined by the test suite to exercise
the rest of the library). The other tests most likely all crash
because there's something wrong with the operator. The test runs
with the expected results when compiled with gcc so it seems that
this might be specific to XLC++.

The stack trace from the core dump (below) shows that it occurs
in the replacement operator new which is just a forwarding
function with hardly any body:

166     void* operator new (_RWSTD_SIZE_T n) _THROWS ((_RWSTD_BAD_ALLOC))
167     {
168         return operator_new (n, false);
169     }

That seems to suggest some kind of runtime library problem.
Let me try to reproduce it in a smaller test case.

Here's the backtrace:

(gdb) where
#0  0x0000000010003e78 in operator new (n=0) at rw_new.h:167
#1  0x00000000100044fc in test_bad_alloc ()
     at /amd/devco/sebor/dev/stdlib/tests/test/00_new.cpp:138
#2  0x00000000100083f8 in run_test ()
     at /amd/devco/sebor/dev/stdlib/tests/test/00_new.cpp:470
#3  0x000000001000a080 in rw_vtest (argc=1, argv=0x1ffffffeff8,
     file_name=0x100a719c 
"/amd/devco/sebor/dev/stdlib/tests/test/00_new.cpp",
     clause=0x0, comment=0x0,
     fun=@0x100f7050: 0x10008398 <run_test(int, char**)>,
     optstr=0x100a72ec "|-no-new-delete# |-no-bad_alloc# |-no-mismatch# 
|-no-bad-delete# |-no-double-delete# |-no-corruption# |-no-leaks# 
|-no-stress-test#",
     va=0x1ffffffea48 "")
     at /amd/devco/sebor/dev/stdlib/tests/src/driver.cpp:1043
#4  0x000000001000b1fc in rw_test (argc=1, argv=0x1ffffffeff8,
     fname=0x100a719c "/amd/devco/sebor/dev/stdlib/tests/test/00_new.cpp",
     clause=0x0, comment=0x0,
     testfun=@0x100f7050: 0x10008398 <run_test(int, char**)>,
     optstr=0x100a72ec "|-no-new-delete# |-no-bad_alloc# |-no-mismatch# 
|-no-bad-delete# |-no-double-delete# |-no-corruption# |-no-leaks# 
|-no-stress-test#")
     at /amd/devco/sebor/dev/stdlib/tests/src/driver.cpp:1140
#5  0x0000000010005f7c in main (argc=1, argv=0x1ffffffeff8)
     at /amd/devco/sebor/dev/stdlib/tests/test/00_new.cpp:485