stdcxx-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Lemings (JIRA)" <j...@apache.org>
Subject [jira] Commented: (STDCXX-841) [Sun C++] SIGFPE in 20.temp.buffer in LP64
Date Fri, 11 Apr 2008 17:02:04 GMT

    [ https://issues.apache.org/jira/browse/STDCXX-841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12588028#action_12588028
] 

Eric Lemings commented on STDCXX-841:
-------------------------------------

Some sort of arithmetic overflow evaluating this test:
{noformat}
file stdcxx/trunk/tests/utilities/20.temp.buffer.cpp:
...
459     test_failure ((BigStruct<MAX_SIZE / 2>*)0, 0);
...
{noformat}
The terminating condition of the loop in test_failure() is not catching it:
{noformat}
file stdcxx/trunk/tests/utilities/20.temp.buffer.cpp:
...
267     for (std::size_t i = 2; i < sizeof (T); i <<= 1) {
268         // exercise arithmetic overflow (not to be confused
269         // with the out-of-memory tests below)
270
271         // attempts to allocate space for an array of elements
272         // with a total size that exceeds SIZE_MAX must fail
273         nelems = _RWSTD_PTRDIFF_MAX / i + 1;
274
275         pa = std::get_temporary_buffer<T>(nelems);
276
277         rw_assert (0 == pa.first && 0 == pa.second, 0, __LINE__,
278                    "get_temporary_buffer<%s>(%ld) == { 0, 0 }, "
279                    "got { %#p, %td }",
280                    tname, nelems, pa.first, pa.second);
281     }
...
{noformat}
Here's what I observed cycling near what should be the end of the loop:
{noformat}
...
(dbx) cont
t@1 (l@1) stopped in test_failure<BigStruct<4611686018427387903UL> > at line 273
in file "20.temp.buffer.cpp"
  273           nelems = _RWSTD_PTRDIFF_MAX / i + 1;
i = 9223372036854775808U
(dbx) cont
t@1 (l@1) stopped in test_failure<BigStruct<4611686018427387903UL> > at line 273
in file "20.temp.buffer.cpp"
  273           nelems = _RWSTD_PTRDIFF_MAX / i + 1;
i = 0
{noformat}

> [Sun C++] SIGFPE in 20.temp.buffer in LP64
> ------------------------------------------
>
>                 Key: STDCXX-841
>                 URL: https://issues.apache.org/jira/browse/STDCXX-841
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: Tests
>    Affects Versions: 4.2.0
>         Environment: Sun C++
>            Reporter: Martin Sebor
>            Assignee: Eric Lemings
>            Priority: Minor
>             Fix For: 4.2.1
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> When compiled with Sun C++ (any version) in LP64 mode, the test [20.temp.buffer.cpp|http://svn.apache.org/viewvc/stdcxx/trunk/tests/utilities/20.temp.buffer.cpp?view=markup]
abends with SIGFPE.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message