Ask Your Question
0

Mat ctor produces heap error?!?

asked 2019-12-05 09:55:56 -0600

mael15 gravatar image

I have made a c++ wxWidgets minimal example, unfortunately it is not possible to post it here directly, the format gets distorted and one can only attach images, so here it is: https://drive.google.com/file/d/1NqAj...

It only consists of a wxWidgets window and the lines

include "opencv2/imgproc.hpp"

and cv::Mat src_gray;

The heap error is

Detected memory leaks! Dumping objects -> {7135} normal block at 0x000001B5242D3410, 32 bytes long. Data: < ,$ @ .$ > A0 F8 2C 24 B5 01 00 00 40 80 2E 24 B5 01 00 00 {7134} normal block at 0x000001B5242BFA90, 48 bytes long. Data: <google.protobuf.&gt; 67="" 6f="" 6f="" 67="" 6c="" 65="" 2e="" 70="" 72="" 6f="" 74="" 6f="" 62="" 75="" 66="" 2e="" {7133}="" normal="" block="" at="" 0x000001b5242c20a0,="" 16="" bytes="" long.="" data:="" &lt;<code="">'$ > 60 E4 27 24 B5 01 00 00 00 00 00 00 00 00 00 00 {7132} normal block at 0x000001B52427E440, 88 bytes long. Data: < '$ '$ > A0 E3 27 24 B5 01 00 00 E0 DF 27 24 B5 01 00 00 {7126} normal block at 0x000001B5242D30B0, 32 bytes long. Data: <google.protobuf.> 67 6F 6F 67 6C 65 2E 70 72 6F 74 6F 62 75 66 2E {7125} normal block at 0x000001B5242C1DD0, 16 bytes long. Data: < '$ > 20 E8 27 24 B5 01 00 00 00 00 00 00 00 00 00 00 {7124} normal block at 0x000001B52427E800, 88 bytes long. Data: < j'$ '$ > C0 6A 27 24 B5 01 00 00 00 E3 27 24 B5 01 00 00 {7118} normal block at 0x000001B5242C0510, 48 bytes long. Data: <google.protobuf.> 67 6F 6F 67 6C 65 2E 70 72 6F 74 6F 62 75 66 2E {7117} normal block at 0x000001B5242C2BE0, 16 bytes long. Data: < '$ > 60 EE 27 24 B5 01 00 00 00 00 00 00 00 00 00 00 {7116} normal block at 0x000001B52427EE40, 88 bytes long. Data: < '$ ,$ > 00 E3 27 24 B5 01 00 00 00 EA 2C 24 B5 01 00 00 {7110} normal block at 0x000001B5242D35F0, 32 bytes long. Data: <google.protobuf.&gt; 67="" 6f="" 6f="" 67="" 6c="" 65="" 2e="" 70="" 72="" 6f="" 74="" 6f="" 62="" 75="" 66="" 2e="" {7109}="" normal="" block="" at="" 0x000001b5242c27d0,="" 16="" bytes="" long.="" data:="" &lt;@="" '$="" &gt;="" 40="" e1="" 27="" 24="" b5="" 01="" 00="" 00="" 00="" 00="" 00="" 00="" 00="" 00="" 00="" 00="" {7108}="" normal="" block="" at="" 0x000001b52427e120,="" 88="" bytes="" long.="" data:="" &lt;="" j'$="" '$="" &gt;="" c0="" 6a="" 27="" 24="" b5="" 01="" 00="" 00="" e0="" f8="" 27="" 24="" b5="" 01="" 00="" 00="" {7102}="" normal="" block="" at="" 0x000001b5242d2ed0,="" 32="" bytes="" long.="" data:="" <google.protobuf.&gt;="" 67="" 6f="" 6f="" 67="" 6c="" 65="" 2e="" 70="" 72="" 6f="" 74="" 6f="" 62="" 75="" 66="" 2e="" {7101}="" normal="" block="" at="" 0x000001b5242c2af0,="" 16="" bytes="" long.="" data:="" &lt;="" '$="" &gt;="" 20="" e3="" 27="" 24="" b5="" 01="" 00="" 00="" 00="" 00="" 00="" 00="" 00="" 00="" 00="" 00="" {7100}="" normal="" block="" at="" 0x000001b52427e300,="" 88="" bytes="" long.="" data:="" &lt;="" j'$="" @="" '$="" &gt;="" c0="" 6a="" 27="" 24="" b5="" 01="" 00 ... (more)

edit retag flag offensive close merge delete

Comments

hey, how is that not a real question?!?!

mael15 gravatar imagemael15 ( 2019-12-05 10:02:16 -0600 )edit

Sorry but your first post was empty...

LBerger gravatar imageLBerger ( 2019-12-05 10:29:52 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2019-12-05 12:11:35 -0600

mvuori gravatar image

The report is not a contructor crash report, but a report after the execution ends. It is produced by your MS build system that has heap checking turned on.

Memory leak after a program terminates is not usualky a problem.

edit flag offensive delete link more

Comments

Thanx, but it increases the risk of missing other more important heap errors if this one always appears. I would love to get rid of it, unfortunately _CrtSetBreakAlloc does not work because it probably happens while loading the opencv dll.

mael15 gravatar imagemael15 ( 2019-12-05 12:19:39 -0600 )edit

can I somehow turn off reporting this heap error? It really is annoying and puts me at risk of not seeing other heap errors. I cannot believe that this is supposed to be normal in a commonly used library.

mael15 gravatar imagemael15 ( 2019-12-16 09:10:59 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2019-12-05 09:55:56 -0600

Seen: 380 times

Last updated: Dec 05 '19