On Sat, Nov 02, 2013 at 08:41:03PM -0500, Ranjan Maitra wrote:
On Sat, 2 Nov 2013 20:19:48 -0400 Fred Smith
<snip>
Sorry, I was not clear: I did not change the floats to doubles. Also,
I
forgot to add that the program segfaults at a printf statement. I am
not understanding what the problem is at all. valgrind goes through
just fine on the 32-bit machine:
==15081== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
but not for the 64-bit machine.
==29284== Process terminating with default action of signal 11 (SIGSEGV)
==29284== Access not within mapped region at address 0xAccess not within mapped region
at address 0x1u1
==29284== at 0x36CFC48E29: vfprintf (in /usr/lib64/libc-2.17.so)
==29284== by 0x4048CE: Print
(in /home/maitra/PET/PToft/Recon2D/RadonAna/RadonAna) ==29284== by
0x4027A6: init (in /home/maitra/PET/PToft/Recon2D/RadonAna/RadonAna)
==29284== by 0x4014BE: main
(in /home/maitra/PET/PToft/Recon2D/RadonAna/RadonAna) ==29284== If you
believe this happened as a result of a stack ==29284== overflow in
your program's main thread (unlikely but ==29284== possible), you can
try to increase the size of the ==29284== main thread stack using the
--main-stacksize= flag. ==29284== The main thread stack size used in
this run was 8388608. 0 : type===29284==
.....
What i don't understand is why valgrind's behaviour is so different for
the two cases.
sounds as if there's SOMETHING in there that's assuming a 32-bit machine.
that statement "Access not within mapped region at address 0x1" is
definitely suspicious. if you change the compile command to so that
it uses "-O0 -g" rather than whatever it is using, you may find that
Valgrind gives actual line numbers, if it still fails when compiled
that way.
if you use GDB (or other debugger of your preference) you can get
a backtrace, once it segfaults, that may help you track where it
got a bad parameter (that 0x1 as an address is definitely suspicous.)
--
---- Fred Smith -- fredex(a)fcshome.stoneham.ma.us -----------------------------
God made him who had no sin
to be sin for us, so that in him
we might become the righteousness of God."
--------------------------- Corinthians 5:21 ---------------------------------