You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by "Farid Zaripov (JIRA)" <ji...@apache.org> on 2006/10/06 14:39:19 UTC

[jira] Created: (STDCXX-297) std::bitset constructor addressed memory beyond the object

std::bitset constructor addressed memory beyond the object
----------------------------------------------------------

                 Key: STDCXX-297
                 URL: http://issues.apache.org/jira/browse/STDCXX-297
             Project: C++ Standard Library
          Issue Type: Bug
          Components: 23. Containers
    Affects Versions: 4.1.3
         Environment: All
            Reporter: Farid Zaripov
            Priority: Trivial
             Fix For: 4.2


he program below fails:

------------------------------------------
#include <cassert>
#include <new>
#include <bitset>
#include <string>
#include <cstddef>
#include <string.h>

int main ()
{
    typedef std::bitset<128> BitSet;
    const std::size_t size = sizeof (BitSet);

    char buf [size + 4];
    memset (buf, '\xff', sizeof (buf));

    BitSet* btest = new (buf) BitSet (std::basic_string<int> ());

    for (std::size_t i = size; i < sizeof (buf); ++i)
        assert ('\xff' == buf [i]);

    btest->~BitSet ();

    return 0;
}
------------------------------------------
Assertion failed: '\xff' == buf [i], file test.cpp, line 19

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
------------------------------------------


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (STDCXX-297) std::bitset constructor addressed memory beyond the object

Posted by "Farid Zaripov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-297?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Farid Zaripov closed STDCXX-297.
--------------------------------


The regression test added thus: http://svn.apache.org/viewvc?view=rev&rev=544795

> std::bitset constructor addressed memory beyond the object
> ----------------------------------------------------------
>
>                 Key: STDCXX-297
>                 URL: https://issues.apache.org/jira/browse/STDCXX-297
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 23. Containers
>    Affects Versions: 4.1.3
>         Environment: All
>            Reporter: Farid Zaripov
>            Assignee: Farid Zaripov
>            Priority: Trivial
>             Fix For: 4.2
>
>
> he program below fails:
> ------------------------------------------
> #include <cassert>
> #include <new>
> #include <bitset>
> #include <string>
> #include <cstddef>
> #include <string.h>
> int main ()
> {
>     typedef std::bitset<128> BitSet;
>     const std::size_t size = sizeof (BitSet);
>     char buf [size + 4];
>     memset (buf, '\xff', sizeof (buf));
>     BitSet* btest = new (buf) BitSet (std::basic_string<int> ());
>     for (std::size_t i = size; i < sizeof (buf); ++i)
>         assert ('\xff' == buf [i]);
>     btest->~BitSet ();
>     return 0;
> }
> ------------------------------------------
> Assertion failed: '\xff' == buf [i], file test.cpp, line 19
> This application has requested the Runtime to terminate it in an unusual way.
> Please contact the application's support team for more information.
> ------------------------------------------

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


[jira] Resolved: (STDCXX-297) std::bitset constructor addressed memory beyond the object

Posted by "Farid Zaripov (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/STDCXX-297?page=all ]

Farid Zaripov resolved STDCXX-297.
----------------------------------

    Resolution: Fixed

Fixed thus: http://svn.apache.org/viewvc?view=rev&rev=465512

> std::bitset constructor addressed memory beyond the object
> ----------------------------------------------------------
>
>                 Key: STDCXX-297
>                 URL: http://issues.apache.org/jira/browse/STDCXX-297
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 23. Containers
>    Affects Versions: 4.1.3
>         Environment: All
>            Reporter: Farid Zaripov
>            Priority: Trivial
>             Fix For: 4.2
>
>
> he program below fails:
> ------------------------------------------
> #include <cassert>
> #include <new>
> #include <bitset>
> #include <string>
> #include <cstddef>
> #include <string.h>
> int main ()
> {
>     typedef std::bitset<128> BitSet;
>     const std::size_t size = sizeof (BitSet);
>     char buf [size + 4];
>     memset (buf, '\xff', sizeof (buf));
>     BitSet* btest = new (buf) BitSet (std::basic_string<int> ());
>     for (std::size_t i = size; i < sizeof (buf); ++i)
>         assert ('\xff' == buf [i]);
>     btest->~BitSet ();
>     return 0;
> }
> ------------------------------------------
> Assertion failed: '\xff' == buf [i], file test.cpp, line 19
> This application has requested the Runtime to terminate it in an unusual way.
> Please contact the application's support team for more information.
> ------------------------------------------

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Assigned: (STDCXX-297) std::bitset constructor addressed memory beyond the object

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-297?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Sebor reassigned STDCXX-297:
-----------------------------------

    Assignee: Farid Zaripov

> std::bitset constructor addressed memory beyond the object
> ----------------------------------------------------------
>
>                 Key: STDCXX-297
>                 URL: https://issues.apache.org/jira/browse/STDCXX-297
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 23. Containers
>    Affects Versions: 4.1.3
>         Environment: All
>            Reporter: Farid Zaripov
>         Assigned To: Farid Zaripov
>            Priority: Trivial
>             Fix For: 4.2
>
>
> he program below fails:
> ------------------------------------------
> #include <cassert>
> #include <new>
> #include <bitset>
> #include <string>
> #include <cstddef>
> #include <string.h>
> int main ()
> {
>     typedef std::bitset<128> BitSet;
>     const std::size_t size = sizeof (BitSet);
>     char buf [size + 4];
>     memset (buf, '\xff', sizeof (buf));
>     BitSet* btest = new (buf) BitSet (std::basic_string<int> ());
>     for (std::size_t i = size; i < sizeof (buf); ++i)
>         assert ('\xff' == buf [i]);
>     btest->~BitSet ();
>     return 0;
> }
> ------------------------------------------
> Assertion failed: '\xff' == buf [i], file test.cpp, line 19
> This application has requested the Runtime to terminate it in an unusual way.
> Please contact the application's support team for more information.
> ------------------------------------------

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