You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by "Martin Sebor (JIRA)" <ji...@apache.org> on 2007/06/18 17:25:25 UTC

[jira] Created: (STDCXX-448) SIGSEGV in std::valarray::operator[](gslice)

SIGSEGV in std::valarray::operator[](gslice)
--------------------------------------------

                 Key: STDCXX-448
                 URL: https://issues.apache.org/jira/browse/STDCXX-448
             Project: C++ Standard Library
          Issue Type: Bug
          Components: 26. Numerics
    Affects Versions: 4.2
         Environment: all
            Reporter: Martin Sebor
            Assignee: Martin Sebor
             Fix For: 4.2


****Created By: micucci @ Dec 13, 1999 09:33:05 AM****
######## WORK NOTES COPIED FROM INCIDENT 879763 ########
**** Entered By: leroy @ Wednesday, November 10, 1999 11:59:53 AM ****
[see Rogue Wave issue 4437: http://insight.roguewave.com/onyxinsight/qa/qa4437.htm]
****Modified By: sebor @ Jan 24, 2000 03:40:38 PM****
This doesn't compile with g++ 2.95.2:
test.cpp:9: `operator *' not defined
but does core dump with edg 2.42

****Modified By: pedretti @ Feb 07, 2000 05:37:33 PM****
This is actually a problem with the valarray constructor that takes a gslice as an argument, which is called by the valarray::operator[] ( gslice );. in fact, the following code would cause the core dump:

------

#include <valarray>

int main()
{  
   std::valarray<double> dval;
   dval[std::gslice()];
}

-----


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


[jira] Issue Comment Edited: (STDCXX-448) SIGSEGV in std::valarray::operator[](gslice)

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

sebor edited comment on STDCXX-448 at 9/24/07 12:06 PM:
---------------------------------------------------------------

Looks like this is covered by DR 543 (http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#543) which clarifies the standard so as to make the behavior of the program above (as well as the behavior of the regression test) is undefined.

We need to decide whether we want to implement some reasonable behavior as a matter of QoI or leave it as is. My feeling is that if we can avoid the undefined behavior without imposing any runtime overhead we should to make valarray slightly less error-prone to use than the standard allows it to be.

      was (Author: sebor):
    Looks like this is covered by DR 253 (http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#253) which clarifies the standard so as to make the behavior of the program above (as well as the behavior of the regression test) is undefined.

We need to decide whether we want to implement some reasonable behavior as a matter of QoI or leave it as is. My feeling is that if we can avoid the undefined behavior without imposing any runtime overhead we should to make valarray slightly less error-prone to use than the standard allows it to be.
  
> SIGSEGV in std::valarray::operator[](gslice)
> --------------------------------------------
>
>                 Key: STDCXX-448
>                 URL: https://issues.apache.org/jira/browse/STDCXX-448
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 26. Numerics
>    Affects Versions: 4.1.2, 4.1.3, 4.1.4
>         Environment: all
>            Reporter: Martin Sebor
>            Assignee: Martin Sebor
>             Fix For: 4.2
>
>
> ****Created By: micucci @ Dec 13, 1999 09:33:05 AM****
> ######## WORK NOTES COPIED FROM INCIDENT 879763 ########
> **** Entered By: leroy @ Wednesday, November 10, 1999 11:59:53 AM ****
> [see Rogue Wave issue 4437: http://insight.roguewave.com/onyxinsight/qa/qa4437.htm]
> ****Modified By: sebor @ Jan 24, 2000 03:40:38 PM****
> This doesn't compile with g++ 2.95.2:
> test.cpp:9: `operator *' not defined
> but does core dump with edg 2.42
> ****Modified By: pedretti @ Feb 07, 2000 05:37:33 PM****
> This is actually a problem with the valarray constructor that takes a gslice as an argument, which is called by the valarray::operator[] ( gslice );. in fact, the following code would cause the core dump:
> ------
> #include <valarray>
> int main()
> {  
>    std::valarray<double> dval;
>    dval[std::gslice()];
> }
> -----

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


[jira] Closed: (STDCXX-448) SIGSEGV in std::valarray::operator[](gslice)

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

Martin Sebor closed STDCXX-448.
-------------------------------

    Resolution: Fixed

Fixed by the just committed patch (http://svn.apache.org/viewvc?rev=579025&view=rev). Confirmed in a manual build.
Closing.

> SIGSEGV in std::valarray::operator[](gslice)
> --------------------------------------------
>
>                 Key: STDCXX-448
>                 URL: https://issues.apache.org/jira/browse/STDCXX-448
>             Project: C++ Standard Library
>          Issue Type: Improvement
>          Components: 26. Numerics
>    Affects Versions: 4.1.2, 4.1.3, 4.1.4
>         Environment: all
>            Reporter: Martin Sebor
>            Assignee: Martin Sebor
>             Fix For: 4.2
>
>
> ****Created By: micucci @ Dec 13, 1999 09:33:05 AM****
> ######## WORK NOTES COPIED FROM INCIDENT 879763 ########
> **** Entered By: leroy @ Wednesday, November 10, 1999 11:59:53 AM ****
> [see Rogue Wave issue 4437: http://insight.roguewave.com/onyxinsight/qa/qa4437.htm]
> ****Modified By: sebor @ Jan 24, 2000 03:40:38 PM****
> This doesn't compile with g++ 2.95.2:
> test.cpp:9: `operator *' not defined
> but does core dump with edg 2.42
> ****Modified By: pedretti @ Feb 07, 2000 05:37:33 PM****
> This is actually a problem with the valarray constructor that takes a gslice as an argument, which is called by the valarray::operator[] ( gslice );. in fact, the following code would cause the core dump:
> ------
> #include <valarray>
> int main()
> {  
>    std::valarray<double> dval;
>    dval[std::gslice()];
> }
> -----

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


[jira] Commented: (STDCXX-448) SIGSEGV in std::valarray::operator[](gslice)

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

Martin Sebor commented on STDCXX-448:
-------------------------------------

The behavior of the regression test (26.valarray.sub.stdcxx-448.cpp) with the latest trunk:

$ ./26.valarray.sub.stdcxx-448
/amd/devco/sebor/stdcxx-trunk/include/rw/_array.h:79: const _TypeT& __rw::__rw_array<_TypeT>::operator[](long unsigned int) const [with _TypeT = double]: Assertion '__inx < size ()' failed.
/build/sebor/stdcxx-trunk-gcc-3.4.6_3-15D/lib/libstd15D.so[0x2a955a8d6b]
/build/sebor/stdcxx-trunk-gcc-3.4.6_3-15D/lib/libstd15D.so(_ZN4__rw16__rw_assert_failEPKcS1_iS1_+0x86)[0x2a955a8e0e]
./26.valarray.sub.stdcxx-448[0x4010d8]
./26.valarray.sub.stdcxx-448(__gxx_personality_v0+0x46b)[0x400dfb]
./26.valarray.sub.stdcxx-448(__gxx_personality_v0+0x13f)[0x400acf]
/lib64/tls/libc.so.6(__libc_start_main+0xdb)[0x3a90a1c3fb]
./26.valarray.sub.stdcxx-448(__gxx_personality_v0+0x7a)[0x400a0a]
Aborted


> SIGSEGV in std::valarray::operator[](gslice)
> --------------------------------------------
>
>                 Key: STDCXX-448
>                 URL: https://issues.apache.org/jira/browse/STDCXX-448
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 26. Numerics
>    Affects Versions: 4.1.2, 4.1.3, 4.1.4
>         Environment: all
>            Reporter: Martin Sebor
>            Assignee: Martin Sebor
>             Fix For: 4.2
>
>
> ****Created By: micucci @ Dec 13, 1999 09:33:05 AM****
> ######## WORK NOTES COPIED FROM INCIDENT 879763 ########
> **** Entered By: leroy @ Wednesday, November 10, 1999 11:59:53 AM ****
> [see Rogue Wave issue 4437: http://insight.roguewave.com/onyxinsight/qa/qa4437.htm]
> ****Modified By: sebor @ Jan 24, 2000 03:40:38 PM****
> This doesn't compile with g++ 2.95.2:
> test.cpp:9: `operator *' not defined
> but does core dump with edg 2.42
> ****Modified By: pedretti @ Feb 07, 2000 05:37:33 PM****
> This is actually a problem with the valarray constructor that takes a gslice as an argument, which is called by the valarray::operator[] ( gslice );. in fact, the following code would cause the core dump:
> ------
> #include <valarray>
> int main()
> {  
>    std::valarray<double> dval;
>    dval[std::gslice()];
> }
> -----

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


[jira] Commented: (STDCXX-448) SIGSEGV in std::valarray::operator[](gslice)

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

Martin Sebor commented on STDCXX-448:
-------------------------------------

Looks like this is covered by DR 253 (http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#253) which clarifies the standard so as to make the behavior of the program above (as well as the behavior of the regression test) is undefined.

We need to decide whether we want to implement some reasonable behavior as a matter of QoI or leave it as is. My feeling is that if we can avoid the undefined behavior without imposing any runtime overhead we should to make valarray slightly less error-prone to use than the standard allows it to be.

> SIGSEGV in std::valarray::operator[](gslice)
> --------------------------------------------
>
>                 Key: STDCXX-448
>                 URL: https://issues.apache.org/jira/browse/STDCXX-448
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 26. Numerics
>    Affects Versions: 4.1.2, 4.1.3, 4.1.4
>         Environment: all
>            Reporter: Martin Sebor
>            Assignee: Martin Sebor
>             Fix For: 4.2
>
>
> ****Created By: micucci @ Dec 13, 1999 09:33:05 AM****
> ######## WORK NOTES COPIED FROM INCIDENT 879763 ########
> **** Entered By: leroy @ Wednesday, November 10, 1999 11:59:53 AM ****
> [see Rogue Wave issue 4437: http://insight.roguewave.com/onyxinsight/qa/qa4437.htm]
> ****Modified By: sebor @ Jan 24, 2000 03:40:38 PM****
> This doesn't compile with g++ 2.95.2:
> test.cpp:9: `operator *' not defined
> but does core dump with edg 2.42
> ****Modified By: pedretti @ Feb 07, 2000 05:37:33 PM****
> This is actually a problem with the valarray constructor that takes a gslice as an argument, which is called by the valarray::operator[] ( gslice );. in fact, the following code would cause the core dump:
> ------
> #include <valarray>
> int main()
> {  
>    std::valarray<double> dval;
>    dval[std::gslice()];
> }
> -----

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


[jira] Updated: (STDCXX-448) SIGSEGV in std::valarray::operator[](gslice)

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

Martin Sebor updated STDCXX-448:
--------------------------------

    Fix Version/s:     (was: 4.2)
                   5.0
       Issue Type: Improvement  (was: Bug)

Since the standard doesn't define the behavior of the included test case I'm changing the issue from Bug to Improvement

A fix would be hard to implement w/o breaking binary compatibility. I have a new binary incompatible implementation of valarray that I plan to commit to the 5.0 branch once it's been created and that handles this case in a more reasonable way.

Deferred for 5.0.

> SIGSEGV in std::valarray::operator[](gslice)
> --------------------------------------------
>
>                 Key: STDCXX-448
>                 URL: https://issues.apache.org/jira/browse/STDCXX-448
>             Project: C++ Standard Library
>          Issue Type: Improvement
>          Components: 26. Numerics
>    Affects Versions: 4.1.2, 4.1.3, 4.1.4
>         Environment: all
>            Reporter: Martin Sebor
>            Assignee: Martin Sebor
>             Fix For: 5.0
>
>
> ****Created By: micucci @ Dec 13, 1999 09:33:05 AM****
> ######## WORK NOTES COPIED FROM INCIDENT 879763 ########
> **** Entered By: leroy @ Wednesday, November 10, 1999 11:59:53 AM ****
> [see Rogue Wave issue 4437: http://insight.roguewave.com/onyxinsight/qa/qa4437.htm]
> ****Modified By: sebor @ Jan 24, 2000 03:40:38 PM****
> This doesn't compile with g++ 2.95.2:
> test.cpp:9: `operator *' not defined
> but does core dump with edg 2.42
> ****Modified By: pedretti @ Feb 07, 2000 05:37:33 PM****
> This is actually a problem with the valarray constructor that takes a gslice as an argument, which is called by the valarray::operator[] ( gslice );. in fact, the following code would cause the core dump:
> ------
> #include <valarray>
> int main()
> {  
>    std::valarray<double> dval;
>    dval[std::gslice()];
> }
> -----

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


[jira] Updated: (STDCXX-448) SIGSEGV in std::valarray::operator[](gslice)

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

Martin Sebor updated STDCXX-448:
--------------------------------

    Affects Version/s:     (was: 4.2)
                       4.1.2
                       4.1.3
                       4.1.4

This is ancient and must affect all prior versions.

> SIGSEGV in std::valarray::operator[](gslice)
> --------------------------------------------
>
>                 Key: STDCXX-448
>                 URL: https://issues.apache.org/jira/browse/STDCXX-448
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 26. Numerics
>    Affects Versions: 4.1.2, 4.1.3, 4.1.4
>         Environment: all
>            Reporter: Martin Sebor
>            Assignee: Martin Sebor
>             Fix For: 4.2
>
>
> ****Created By: micucci @ Dec 13, 1999 09:33:05 AM****
> ######## WORK NOTES COPIED FROM INCIDENT 879763 ########
> **** Entered By: leroy @ Wednesday, November 10, 1999 11:59:53 AM ****
> [see Rogue Wave issue 4437: http://insight.roguewave.com/onyxinsight/qa/qa4437.htm]
> ****Modified By: sebor @ Jan 24, 2000 03:40:38 PM****
> This doesn't compile with g++ 2.95.2:
> test.cpp:9: `operator *' not defined
> but does core dump with edg 2.42
> ****Modified By: pedretti @ Feb 07, 2000 05:37:33 PM****
> This is actually a problem with the valarray constructor that takes a gslice as an argument, which is called by the valarray::operator[] ( gslice );. in fact, the following code would cause the core dump:
> ------
> #include <valarray>
> int main()
> {  
>    std::valarray<double> dval;
>    dval[std::gslice()];
> }
> -----

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