Re: Curious segmentation fault - please help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 5/13/06, Shriramana Sharma <samjnaa@xxxxxxxxx> wrote:
Saturday 13 May 2006 22:50 samaye, Steve Graegert alekhiit:

> > vaasara[6] does give the correct output. The fault is seen *after*
> > vaasara[6] is read and written to stdout:
>
> which accesses the last element correctly.  Nevertheless, the function
> tries to read one more character causing a segfault.  Please don't
> misinterpret valgind's output: we are still in listsplpanchaanga().

Of course. But all I am doing is using the standard fprintf function. Is it
possible that the behaviour of this function would have changed from glibc
2.36 to glibc 2.4?

OK, now I got the code.  You're right, it's not as simple as it seemed
at first glance.  Just oversaw some lines of the valgrind output,
showing that accessing element 0 (zero) is indeed failing all the
time.  Sorry, just did not get it at first.

Let's try another thing before filing a bug or something: instruct
valgrind to attach to a debugger when the error occurs:

% valgrind --tool=memcheck --db-attach=yes -v ./monthpan

when entered the debugger call

(gdb) where
... /* stack trace */
(gdb) whatis grahanaama
... /* prints type and size of expression */
(gdb) print grahanaama[0]
... /* should display contents of expression; may result in an error*/

Try to capture the output and mail it to me privately.  You can also
send me the complete program and I'll have a look at it.

If all goes well here, you may have uncovered some weird behaviour
which may indeed be a bug either in glibc or gcc.

> Hm, don't know what could have changed.  I am not a SuSEr anymore;
> returned to Debian and NetBSD.

So can't see you anymore on SLE?

Yes, I simply don't have the time to follow SLE discussions anymore.

	\Steve
-
: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Assembler]     [Git]     [Kernel List]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [C Programming]     [Yosemite Campsites]     [Yosemite News]     [GCC Help]

  Powered by Linux