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 2005/12/01 02:20:30 UTC
[jira] Created: (STDCXX-79) [MSVC 7] operator new doesn't throw on failure
[MSVC 7] operator new doesn't throw on failure
----------------------------------------------
Key: STDCXX-79
URL: http://issues.apache.org/jira/browse/STDCXX-79
Project: STDCXX
Type: Bug
Components: External
Versions: 4.1.2
Environment: MSVC 7.0, 7.1
Reporter: Martin Sebor
Priority: Critical
The implementation of operaror new in the MSVC 7 runtime library (but not the one in the C++ Standard Library, msvcprtd), fails to throw an exception on failure and instead returns 0. This works correctly in MSVC 8.
Here's a reference to the MSVC 7 documentation of their libraries:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_c_run.2d.time_libraries.asp
$ cat t.cpp && cl /EHsc /MDd t.cpp /c && link /NODEFAULTLIB:msvcprtd t.obj && ./t
#include <cassert>
#include <new>
#include <crtdbg.h>
int main ()
{
_CrtSetReportMode (_CRT_WARN, _CRTDBG_MODE_DEBUG);
_CrtSetReportMode (_CRT_ERROR, _CRTDBG_MODE_DEBUG);
_CrtSetReportMode (_CRT_ASSERT, _CRTDBG_MODE_DEBUG);
int success = 0;
try {
operator new ((unsigned long)-1024);
}
catch (std::bad_alloc&) { success = 1; }
catch (...) { }
assert (success);
}
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
t.cpp
Microsoft (R) Incremental Linker Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.
Assertion failed: success, file t.cpp, line 20
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] Updated: (STDCXX-79) [MSVC 7] operator new doesn't throw on
failure
Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-79?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Sebor updated STDCXX-79:
-------------------------------
Affects Version/s: (was: 4.1.2)
Removed 4..1.2 from Affected Versions -- this is a bug in the compiler, not in stdcxx.
> [MSVC 7] operator new doesn't throw on failure
> ----------------------------------------------
>
> Key: STDCXX-79
> URL: https://issues.apache.org/jira/browse/STDCXX-79
> Project: C++ Standard Library
> Issue Type: Bug
> Components: External
> Environment: MSVC 7.0, 7.1
> Reporter: Martin Sebor
> Assignee: Farid Zaripov
> Priority: Critical
>
> The implementation of operaror new in the MSVC 7 runtime library (but not the one in the C++ Standard Library, msvcprtd), fails to throw an exception on failure and instead returns 0. This works correctly in MSVC 8.
> Here's a reference to the MSVC 7 documentation of their libraries:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_c_run.2d.time_libraries.asp
> $ cat t.cpp && cl /EHsc /MDd t.cpp /c && link /NODEFAULTLIB:msvcprtd t.obj && ./t
> #include <cassert>
> #include <new>
> #include <crtdbg.h>
> int main ()
> {
> _CrtSetReportMode (_CRT_WARN, _CRTDBG_MODE_DEBUG);
> _CrtSetReportMode (_CRT_ERROR, _CRTDBG_MODE_DEBUG);
> _CrtSetReportMode (_CRT_ASSERT, _CRTDBG_MODE_DEBUG);
> int success = 0;
> try {
> operator new ((unsigned long)-1024);
> }
> catch (std::bad_alloc&) { success = 1; }
> catch (...) { }
> assert (success);
> }
> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
> Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
> t.cpp
> Microsoft (R) Incremental Linker Version 7.10.3077
> Copyright (C) Microsoft Corporation. All rights reserved.
> Assertion failed: success, file t.cpp, line 20
> 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] Assigned: (STDCXX-79) [MSVC 7] operator new doesn't throw on
failure
Posted by "Farid Zaripov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-79?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Farid Zaripov reassigned STDCXX-79:
-----------------------------------
Assignee: Farid Zaripov
> [MSVC 7] operator new doesn't throw on failure
> ----------------------------------------------
>
> Key: STDCXX-79
> URL: https://issues.apache.org/jira/browse/STDCXX-79
> Project: C++ Standard Library
> Issue Type: Bug
> Components: External
> Affects Versions: 4.1.2
> Environment: MSVC 7.0, 7.1
> Reporter: Martin Sebor
> Assignee: Farid Zaripov
> Priority: Critical
>
> The implementation of operaror new in the MSVC 7 runtime library (but not the one in the C++ Standard Library, msvcprtd), fails to throw an exception on failure and instead returns 0. This works correctly in MSVC 8.
> Here's a reference to the MSVC 7 documentation of their libraries:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_c_run.2d.time_libraries.asp
> $ cat t.cpp && cl /EHsc /MDd t.cpp /c && link /NODEFAULTLIB:msvcprtd t.obj && ./t
> #include <cassert>
> #include <new>
> #include <crtdbg.h>
> int main ()
> {
> _CrtSetReportMode (_CRT_WARN, _CRTDBG_MODE_DEBUG);
> _CrtSetReportMode (_CRT_ERROR, _CRTDBG_MODE_DEBUG);
> _CrtSetReportMode (_CRT_ASSERT, _CRTDBG_MODE_DEBUG);
> int success = 0;
> try {
> operator new ((unsigned long)-1024);
> }
> catch (std::bad_alloc&) { success = 1; }
> catch (...) { }
> assert (success);
> }
> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
> Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
> t.cpp
> Microsoft (R) Incremental Linker Version 7.10.3077
> Copyright (C) Microsoft Corporation. All rights reserved.
> Assertion failed: success, file t.cpp, line 20
> 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] Closed: (STDCXX-79) [MSVC 7] operator new doesn't throw on
failure
Posted by "Farid Zaripov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-79?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Farid Zaripov closed STDCXX-79.
-------------------------------
Resolution: Won't Fix
Since the Microsoft will not fix this bug, I'm closing the issue with resolution: Won't Fix.
> [MSVC 7] operator new doesn't throw on failure
> ----------------------------------------------
>
> Key: STDCXX-79
> URL: https://issues.apache.org/jira/browse/STDCXX-79
> Project: C++ Standard Library
> Issue Type: Bug
> Components: External
> Environment: MSVC 7.0, 7.1
> Reporter: Martin Sebor
> Assignee: Farid Zaripov
> Priority: Critical
>
> The implementation of operaror new in the MSVC 7 runtime library (but not the one in the C++ Standard Library, msvcprtd), fails to throw an exception on failure and instead returns 0. This works correctly in MSVC 8.
> Here's a reference to the MSVC 7 documentation of their libraries:
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_c_run.2d.time_libraries.asp
> $ cat t.cpp && cl /EHsc /MDd t.cpp /c && link /NODEFAULTLIB:msvcprtd t.obj && ./t
> #include <cassert>
> #include <new>
> #include <crtdbg.h>
> int main ()
> {
> _CrtSetReportMode (_CRT_WARN, _CRTDBG_MODE_DEBUG);
> _CrtSetReportMode (_CRT_ERROR, _CRTDBG_MODE_DEBUG);
> _CrtSetReportMode (_CRT_ASSERT, _CRTDBG_MODE_DEBUG);
> int success = 0;
> try {
> operator new ((unsigned long)-1024);
> }
> catch (std::bad_alloc&) { success = 1; }
> catch (...) { }
> assert (success);
> }
> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
> Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
> t.cpp
> Microsoft (R) Incremental Linker Version 7.10.3077
> Copyright (C) Microsoft Corporation. All rights reserved.
> Assertion failed: success, file t.cpp, line 20
> 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.