“Bad allocation” in OpenCV in VS2017 Debug Mode
I'm currently working with C++/OpenCV using VS2017 and had no problems reading a video-stream from a file (using VideoCapture
).
However, I am getting the following error message, when building in Debug Mode
:
warning: Error opening file (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:901)
warning: pΦ∩á╬ (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:902)
[ERROR:0] VIDEOIO(cvCreateCapture_MSMF(filename)): raised C++ exception:
bad allocation
I am wondering where the error might be coming from, as the program works perfectly fine in Release Mode
.
I might add, that the video files I am testing with are approx. 2.7 GB
to 8.8 GB
large.
Is this an allocator issue inside the VS2017-Debugger hitting the int32_max
limit
of 2³¹ bit
(even though it is a 64Bit-Process)?
c++ opencv debugging visual-studio-2017
|
show 1 more comment
I'm currently working with C++/OpenCV using VS2017 and had no problems reading a video-stream from a file (using VideoCapture
).
However, I am getting the following error message, when building in Debug Mode
:
warning: Error opening file (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:901)
warning: pΦ∩á╬ (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:902)
[ERROR:0] VIDEOIO(cvCreateCapture_MSMF(filename)): raised C++ exception:
bad allocation
I am wondering where the error might be coming from, as the program works perfectly fine in Release Mode
.
I might add, that the video files I am testing with are approx. 2.7 GB
to 8.8 GB
large.
Is this an allocator issue inside the VS2017-Debugger hitting the int32_max
limit
of 2³¹ bit
(even though it is a 64Bit-Process)?
c++ opencv debugging visual-studio-2017
Are you linking with the debug build of OpenCV?
– Dan Mašek
Nov 26 '18 at 21:10
nope, I pre-build the OpenCV project (and extra modules) as release version, and I reference it in my project. I was under the impression, that this would not matter, as I do not want to debug OpenCV itself .... or am I wrong?
– Unknown6656
Nov 26 '18 at 22:06
That's a problem, since that ends up mixing together the two Visual C++ runtimes (debug and release)...and (AFAIK, it's true till at least 2015, haven't tried further versions) they're not compatible. Even the standard releases of OpenCV binaries contain the two builds for this reason.
– Dan Mašek
Nov 26 '18 at 22:13
Ah, I see. Coming from a .NET-world I was under the impression that it was the same runtime, with the only difference that release configurations are extremely optimized and do not carry (any) debug symbols.... which would only prevent debugging of the library project - but not the main one. Thank you very much for clearing that up!
– Unknown6656
Nov 26 '18 at 22:16
1
I will rebuild it in debug mode and update the question tomorrow. I am using OpenCV v4.0
– Unknown6656
Nov 26 '18 at 22:41
|
show 1 more comment
I'm currently working with C++/OpenCV using VS2017 and had no problems reading a video-stream from a file (using VideoCapture
).
However, I am getting the following error message, when building in Debug Mode
:
warning: Error opening file (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:901)
warning: pΦ∩á╬ (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:902)
[ERROR:0] VIDEOIO(cvCreateCapture_MSMF(filename)): raised C++ exception:
bad allocation
I am wondering where the error might be coming from, as the program works perfectly fine in Release Mode
.
I might add, that the video files I am testing with are approx. 2.7 GB
to 8.8 GB
large.
Is this an allocator issue inside the VS2017-Debugger hitting the int32_max
limit
of 2³¹ bit
(even though it is a 64Bit-Process)?
c++ opencv debugging visual-studio-2017
I'm currently working with C++/OpenCV using VS2017 and had no problems reading a video-stream from a file (using VideoCapture
).
However, I am getting the following error message, when building in Debug Mode
:
warning: Error opening file (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:901)
warning: pΦ∩á╬ (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:902)
[ERROR:0] VIDEOIO(cvCreateCapture_MSMF(filename)): raised C++ exception:
bad allocation
I am wondering where the error might be coming from, as the program works perfectly fine in Release Mode
.
I might add, that the video files I am testing with are approx. 2.7 GB
to 8.8 GB
large.
Is this an allocator issue inside the VS2017-Debugger hitting the int32_max
limit
of 2³¹ bit
(even though it is a 64Bit-Process)?
c++ opencv debugging visual-studio-2017
c++ opencv debugging visual-studio-2017
edited Nov 26 '18 at 20:47
Unknown6656
asked Nov 26 '18 at 18:37
Unknown6656Unknown6656
1,36421733
1,36421733
Are you linking with the debug build of OpenCV?
– Dan Mašek
Nov 26 '18 at 21:10
nope, I pre-build the OpenCV project (and extra modules) as release version, and I reference it in my project. I was under the impression, that this would not matter, as I do not want to debug OpenCV itself .... or am I wrong?
– Unknown6656
Nov 26 '18 at 22:06
That's a problem, since that ends up mixing together the two Visual C++ runtimes (debug and release)...and (AFAIK, it's true till at least 2015, haven't tried further versions) they're not compatible. Even the standard releases of OpenCV binaries contain the two builds for this reason.
– Dan Mašek
Nov 26 '18 at 22:13
Ah, I see. Coming from a .NET-world I was under the impression that it was the same runtime, with the only difference that release configurations are extremely optimized and do not carry (any) debug symbols.... which would only prevent debugging of the library project - but not the main one. Thank you very much for clearing that up!
– Unknown6656
Nov 26 '18 at 22:16
1
I will rebuild it in debug mode and update the question tomorrow. I am using OpenCV v4.0
– Unknown6656
Nov 26 '18 at 22:41
|
show 1 more comment
Are you linking with the debug build of OpenCV?
– Dan Mašek
Nov 26 '18 at 21:10
nope, I pre-build the OpenCV project (and extra modules) as release version, and I reference it in my project. I was under the impression, that this would not matter, as I do not want to debug OpenCV itself .... or am I wrong?
– Unknown6656
Nov 26 '18 at 22:06
That's a problem, since that ends up mixing together the two Visual C++ runtimes (debug and release)...and (AFAIK, it's true till at least 2015, haven't tried further versions) they're not compatible. Even the standard releases of OpenCV binaries contain the two builds for this reason.
– Dan Mašek
Nov 26 '18 at 22:13
Ah, I see. Coming from a .NET-world I was under the impression that it was the same runtime, with the only difference that release configurations are extremely optimized and do not carry (any) debug symbols.... which would only prevent debugging of the library project - but not the main one. Thank you very much for clearing that up!
– Unknown6656
Nov 26 '18 at 22:16
1
I will rebuild it in debug mode and update the question tomorrow. I am using OpenCV v4.0
– Unknown6656
Nov 26 '18 at 22:41
Are you linking with the debug build of OpenCV?
– Dan Mašek
Nov 26 '18 at 21:10
Are you linking with the debug build of OpenCV?
– Dan Mašek
Nov 26 '18 at 21:10
nope, I pre-build the OpenCV project (and extra modules) as release version, and I reference it in my project. I was under the impression, that this would not matter, as I do not want to debug OpenCV itself .... or am I wrong?
– Unknown6656
Nov 26 '18 at 22:06
nope, I pre-build the OpenCV project (and extra modules) as release version, and I reference it in my project. I was under the impression, that this would not matter, as I do not want to debug OpenCV itself .... or am I wrong?
– Unknown6656
Nov 26 '18 at 22:06
That's a problem, since that ends up mixing together the two Visual C++ runtimes (debug and release)...and (AFAIK, it's true till at least 2015, haven't tried further versions) they're not compatible. Even the standard releases of OpenCV binaries contain the two builds for this reason.
– Dan Mašek
Nov 26 '18 at 22:13
That's a problem, since that ends up mixing together the two Visual C++ runtimes (debug and release)...and (AFAIK, it's true till at least 2015, haven't tried further versions) they're not compatible. Even the standard releases of OpenCV binaries contain the two builds for this reason.
– Dan Mašek
Nov 26 '18 at 22:13
Ah, I see. Coming from a .NET-world I was under the impression that it was the same runtime, with the only difference that release configurations are extremely optimized and do not carry (any) debug symbols.... which would only prevent debugging of the library project - but not the main one. Thank you very much for clearing that up!
– Unknown6656
Nov 26 '18 at 22:16
Ah, I see. Coming from a .NET-world I was under the impression that it was the same runtime, with the only difference that release configurations are extremely optimized and do not carry (any) debug symbols.... which would only prevent debugging of the library project - but not the main one. Thank you very much for clearing that up!
– Unknown6656
Nov 26 '18 at 22:16
1
1
I will rebuild it in debug mode and update the question tomorrow. I am using OpenCV v4.0
– Unknown6656
Nov 26 '18 at 22:41
I will rebuild it in debug mode and update the question tomorrow. I am using OpenCV v4.0
– Unknown6656
Nov 26 '18 at 22:41
|
show 1 more comment
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53487126%2fbad-allocation-in-opencv-in-vs2017-debug-mode%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53487126%2fbad-allocation-in-opencv-in-vs2017-debug-mode%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Are you linking with the debug build of OpenCV?
– Dan Mašek
Nov 26 '18 at 21:10
nope, I pre-build the OpenCV project (and extra modules) as release version, and I reference it in my project. I was under the impression, that this would not matter, as I do not want to debug OpenCV itself .... or am I wrong?
– Unknown6656
Nov 26 '18 at 22:06
That's a problem, since that ends up mixing together the two Visual C++ runtimes (debug and release)...and (AFAIK, it's true till at least 2015, haven't tried further versions) they're not compatible. Even the standard releases of OpenCV binaries contain the two builds for this reason.
– Dan Mašek
Nov 26 '18 at 22:13
Ah, I see. Coming from a .NET-world I was under the impression that it was the same runtime, with the only difference that release configurations are extremely optimized and do not carry (any) debug symbols.... which would only prevent debugging of the library project - but not the main one. Thank you very much for clearing that up!
– Unknown6656
Nov 26 '18 at 22:16
1
I will rebuild it in debug mode and update the question tomorrow. I am using OpenCV v4.0
– Unknown6656
Nov 26 '18 at 22:41