Project

General

Profile

Bug #741

Pointer being freed was not allocated

Added by Davide Anastasia almost 11 years ago. Updated almost 11 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
-
Start date:
23 Nov 2010
Due date:
% Done:

0%

Estimated time:

Description

Hi, I'm one of the Luminance HDR developers.
I'm getting this error using EXIV 0.19 from MacPorts:

luminance(98405,0xb018e000) malloc: *** error for object 0xa0103db0: pointer being freed was not allocated
set a breakpoint in malloc_error_break to debug

Using GDB and activating the backtrace, I obtain this:

#0  0x9332df82 in malloc_error_break ()
#1  0x9323db63 in free ()
#2  0x03c552f5 in operator delete ()
#3  0x03c319c1 in std::string::_Rep::_M_destroy ()
#4  0x03c2c626 in std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::Overflow ()
#5  0x03c30f31 in std::basic_streambuf<char, std::char_traits<char> >::xsputn ()
#6  0x90d5418c in std::__ostream_write<char, std::char_traits<char> > ()
#7  0x90d52208 in std::__ostream_insert<char, std::char_traits<char> > ()
#8  0x90d5068a in std::operator<< <char, std::char_traits<char>, std::allocator<char> > ()
#9  0x0038fe0e in Exiv2::AsciiValue::write ()
#10 0x003917f9 in Exiv2::Value::toString ()
#11 0x00387f70 in Exiv2::Internal::TiffReader::visitMnEntry ()
#12 0x003757fa in Exiv2::Internal::TiffMnEntry::doAccept ()
#13 0x00376c0d in Exiv2::Internal::TiffDirectory::doAccept ()
#14 0x0037654d in Exiv2::Internal::TiffSubIfd::doAccept ()
#15 0x00376c0d in Exiv2::Internal::TiffDirectory::doAccept ()
#16 0x0037c9f5 in Exiv2::Internal::TiffParserWorker::parse ()
#17 0x0037d291 in Exiv2::Internal::TiffParserWorker::decode ()
#18 0x0037d3fe in Exiv2::TiffParser::decode ()
#19 0x0037d631 in Exiv2::TiffImage::readMetadata ()
#20 0x00108cd0 in ExifOperations::obtain_avg_lum () at ExifOperations.cpp:108
#21 0x9326485d in _pthread_start ()
#22 0x932646e2 in thread_start ()

The function in Luminance HDR that owns the error is obtain_avg_lum(). You can look at the code here:
http://qtpfsgui.svn.sourceforge.net/viewvc/qtpfsgui/trunk/qtpfsgui/src/Exif/ExifOperations.cpp?revision=788&view=markup
(as you can see, basic stuff).

We are only experiencing this error when we try to read RAW files.

Thanks,
Davide

History

#1

Updated by Andreas Huggel almost 11 years ago

This should be easy to reproduce. Can you please attach an image which causes this, I'd like to try that here.
Andreas

#2

Updated by Davide Anastasia almost 11 years ago

Andreas Huggel wrote:

This should be easy to reproduce. Can you please attach an image which causes this, I'd like to try that here.
Andreas

Use this one: it's a NEX-5 raw file.

http://tolkov.com/valery/DSC02603.ARW

#3

Updated by Andreas Huggel almost 11 years ago

No, I can't reproduce this. Valgrind is happy with this file. Can you reproduce the problem with exiv2 alone?

$ exiv2 DSC02603.ARW

should be all that's needed as the issue is reported within TiffImage::readMetadata()

#4

Updated by Davide Anastasia almost 11 years ago

Andreas Huggel wrote:

No, I can't reproduce this. Valgrind is happy with this file. Can you reproduce the problem with exiv2 alone?

[...]

should be all that's needed as the issue is reported within TiffImage::readMetadata()

It didn't complain. Is my code faulty? What test I can do to find out the error?

#5

Updated by Andreas Huggel almost 11 years ago

I highly recommend valgrind for such issues. Chances are it will tell you exactly what's wrong.

#6

Updated by Davide Anastasia almost 11 years ago

Andreas Huggel wrote:

I highly recommend valgrind for such issues. Chances are it will tell you exactly what's wrong.

Valgrind doesn't give me any error on Linux. I'm using Ubuntu 9.10: what's the Exiv2 version in that distribution?

#7

Updated by Andreas Huggel almost 11 years ago

I'm using Ubuntu 9.10: what's the Exiv2 version in that distribution?

$ exiv2 -V

The latest version of Valgrind also works on Mac OS X, maybe MacPorts has it already (Fink does)

#8

Updated by Davide Anastasia almost 11 years ago

Andreas Huggel wrote:

I'm using Ubuntu 9.10: what's the Exiv2 version in that distribution?

$ exiv2 -V

The latest version of Valgrind also works on Mac OS X, maybe MacPorts has it already (Fink does)

I've tried to use Valgrind on OS X in the past, but Qt (that I use for the UI) is so buggy that Valgrind stops the execution after a few steps (not enough to reach the point where I have the problem with Exiv).

#9

Updated by Davide Anastasia almost 11 years ago

Andreas Huggel wrote:

I'm using Ubuntu 9.10: what's the Exiv2 version in that distribution?

$ exiv2 -V

The latest version of Valgrind also works on Mac OS X, maybe MacPorts has it already (Fink does)

I did find where the bug is and it has no relationship with Evix2. You can close this bug report. Sorry for bothering you.

#10

Updated by Andreas Huggel almost 11 years ago

  • Status changed from New to Rejected

Thanks for the feedback. Closing this, not a bug.

Also available in: Atom PDF