Memory Errors in ZXing identified by Xcode Analyze

82 views
Skip to first unread message

notarysojac

unread,
Sep 30, 2013, 4:43:09 PM9/30/13
to zx...@googlegroups.com

There are a number of leaks and other memory related issues which become identified when the Xcode ANALYZE tool is run again ZXing. 


Is there any hope that these problems will be attended? 


Here's the list that shows up in my project: (ZXing 2.1)


ZXingWidget Group

~/zxing-git/cpp/core/src/zxing/common/BitMatrix.cpp

~/zxing-git/cpp/core/src/zxing/common/BitMatrix.cpp:156:3: Address of stack memory associated with temporary object of type 'string_type' returned to caller

~/zxing-git/cpp/core/src/zxing/common/reedsolomon/ReedSolomonDecoder.cpp

~/zxing-git/cpp/core/src/zxing/common/reedsolomon/ReedSolomonDecoder.cpp:114:5: Use of memory after it is freed (within a call to 'operator=')

~/zxing-git/cpp/core/src/zxing/common/reedsolomon/ReedSolomonDecoder.cpp:116:34: Use of memory after it is freed (within a call to 'operator->')

~/zxing-git/cpp/core/src/zxing/common/reedsolomon/ReedSolomonDecoder.cpp:127:3: Use of memory after it is freed (within a call to '~Ref')

~/zxing-git/cpp/core/src/zxing/datamatrix/detector/MonochromeRectangleDetector.cpp

~/zxing-git/cpp/core/src/zxing/datamatrix/detector/MonochromeRectangleDetector.cpp:100:15: Use of memory after it is freed (within a call to 'operator->')

~/zxing-git/cpp/core/src/zxing/datamatrix/detector/MonochromeRectangleDetector.cpp:114:7: Use of memory after it is freed (within a call to 'operator=')

~/zxing-git/cpp/core/src/zxing/datamatrix/detector/Detector.cpp

~/zxing-git/cpp/core/src/zxing/datamatrix/detector/Detector.cpp:421:4: Use of memory after it is freed (within a call to 'operator=')

~/zxing-git/cpp/core/src/zxing/datamatrix/detector/Detector.cpp:425:5: Use of memory after it is freed (within a call to 'reset')

~/zxing-git/cpp/core/src/zxing/datamatrix/detector/Detector.cpp:426:21: Use of memory after it is freed (within a call to 'operator class zxing::datamatrix::ResultPointsAndTransitions *')

~/zxing-git/cpp/core/src/zxing/datamatrix/detector/Detector.cpp:430:2: Use of memory after it is freed (within a call to '~Ref')

~/zxing-git/cpp/core/src/zxing/oned/OneDReader.cpp

~/zxing-git/cpp/core/src/zxing/oned/OneDReader.cpp:173:24: Division by zero

~/zxing-git/cpp/core/src/zxing/qrcode/detector/FinderPatternFinder.cpp

~/zxing-git/cpp/core/src/zxing/qrcode/detector/FinderPatternFinder.cpp:242:11: Use of memory after it is freed (within a call to '~Ref')

~/zxing-git/cpp/core/src/zxing/qrcode/detector/FinderPatternFinder.cpp:276:26: Use of memory after it is freed (within a call to 'operator->')

~/zxing-git/cpp/core/src/zxing/qrcode/detector/FinderPatternFinder.cpp:281:10: Use of memory after it is freed (within a call to '~Ref')

~/zxing-git/cpp/core/src/zxing/qrcode/detector/FinderPatternFinder.cpp:305:34: Use of memory after it is freed (within a call to 'Ref')

~/zxing-git/cpp/core/src/zxing/qrcode/detector/FinderPatternFinder.cpp:398:5: Use of memory after it is freed (within a call to 'operator=')

~/zxing-git/cpp/core/src/zxing/ResultPoint.cpp

~/zxing-git/cpp/core/src/zxing/ResultPoint.cpp:83:5: Use of memory after it is freed (within a call to 'operator=')

~/zxing-git/cpp/core/src/zxing/ResultPoint.cpp:84:5: Use of memory after it is freed (within a call to 'operator=')

~/zxing-git/cpp/core/src/zxing/ResultPoint.cpp:86:1: Use of memory after it is freed (within a call to '~Ref')

~/zxing-git/cpp/core/src/zxing/common/detector/MonochromeRectangleDetector.cpp

~/zxing-git/cpp/core/src/zxing/common/detector/MonochromeRectangleDetector.cpp:115:10: Use of memory after it is freed (within a call to 'operator->')

~/zxing-git/cpp/core/src/zxing/common/detector/MonochromeRectangleDetector.cpp:133:3: Use of memory after it is freed (within a call to 'operator=')

~/zxing-git/cpp/core/src/zxing/common/reedsolomon/GenericGFPoly.cpp

~/zxing-git/cpp/core/src/zxing/common/reedsolomon/GenericGFPoly.cpp:111:5: Use of memory after it is freed (within a call to 'operator=')


I could probably get in there and fix these myself - but then would have to do so with every new release of ZXing I might use.  


What 


Steven Parkes

unread,
Sep 30, 2013, 5:13:23 PM9/30/13
to notarysojac, zx...@googlegroups.com
You'll want to run against the svn trunk/git master.

We'll have to see if any of these are false positives but otherwise, yeah we can fix them.
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "zxing" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to zxing+un...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Toni Huotari

unread,
Nov 22, 2013, 3:45:06 AM11/22/13
to zx...@googlegroups.com, notarysojac
Has there been any updates on this issue? A fix would be greatly appreciated.

Sean Owen

unread,
Nov 22, 2013, 12:33:30 PM11/22/13
to zx...@googlegroups.com, notarysojac
Don't see a patch or follow up from the reporter with results from HEAD. I believe this code is going to be shelved anyway though.
Reply all
Reply to author
Forward
0 new messages