This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/38625] Segmentation fault when dereferencing valid pointer, probably REGRESSION
- From: "l dot jirkovsky at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Jan 2009 11:19:14 -0000
- Subject: [Bug c++/38625] Segmentation fault when dereferencing valid pointer, probably REGRESSION
- References: <bug-38625-16054@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #11 from l dot jirkovsky at gmail dot com 2009-01-29 11:19 -------
First, I'd like to thank you for doing this hard work and for finding out which
patch causes this problem.
Anyway I've done more investigation to the problematic code.
The problem actually begins in
CachedFileImageIteratorBase::operator*()
In correct build (without optimizations, with debugging enabled or with
"--param inline-unit-growth=60") the currentRow pointer is pointer to
"ordinary" array, I'm guessing it's array of unsigned shorts.
But in segfaulting build my debugger (gdb) shows me, that currentRow is:
vigra::TinyVectorBase<unsigned char, 3, unsigned char [3],
vigra::TinyVector<unsigned char, 3> >
which _data structure doesn't exist in memory. Because it deems really weird
I'm not sure the debugger was right (it was run with higly optimized code when
only some parts of enblend actually had debugging information on).
However if I'm wrong in previous statement, the currentRow should still be
valid. I'd took if I was trying to access, lets say, currentRow[1000] which
could be out of array bounds, but this code segfaults when I'm trying to access
currentRow[0].
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38625