From: mk3god <mk3god@yahoo.co.in>
To: c-programming <linux-c-programming@vger.kernel.org>
Subject: SIGSEGV within strcmp() within localtime() ...?
Date: Tue, 08 Feb 2005 07:01:02 +0000 [thread overview]
Message-ID: <1107846062l.27933l.0l@mithrandir> (raw)
Hello,
A program simulating a monte carlo routine for photon migration written in
standard C core dumps on me with a SIGSEGV. Its being run on an intel P4,
running redhat linux 9, with a 2.4.20-8 kernel. I have listed the backtrace
that I get when using ddd and the function fragment where the signal is
received below.
Apologies for the length of the message. All help is appreciated.
the program backtrace:
---------
Program received signal SIGSEGV, Segmentation fault.
0x4207985a in strcmp () from /lib/tls/libc.so.6
(gdb) frame 9
#9 0x42015704 in __libc_start_main () from /lib/tls/libc.so.6
(gdb) frame 8
#8 0x08048b0c in main (argc=2, argv=0xbfffee84) at trmc_2fls_core.c:55
(gdb) frame 7
#7 0x08048fd3 in doAnisotropicScatter (num_p=100000, tp=0x8159df0) at
trmc_2fls_core.c:159
(gdb) frame 6
#6 0x0804a5b5 in dumpPhotonIntensity (tp=0x8159df0) at trmc_2fls_core.c:662
(gdb) frame 5
#5 0x42095f31 in localtime () from /lib/tls/libc.so.6
(gdb) frame 4
#4 0x42097ae8 in __tz_convert () from /lib/tls/libc.so.6
(gdb) frame 3
#3 0x42096fdc in tzset_internal () from /lib/tls/libc.so.6
(gdb) frame 2
#2 0x4209875e in __tzfile_read () from /lib/tls/libc.so.6
(gdb) frame 1
#1 0x42096e20 in __tzstring () from /lib/tls/libc.so.6
(gdb) frame 0
#0 0x4207985a in strcmp () from /lib/tls/libc.so.6
(gdb)
---------
The begining lines of the function dumpPhotonIntensity():
---------
void dumpPhotonIntensity(const tissue *tp)
{
int i, j;
FILE *fp;
char TRdumpfnames[100];
char timestamp[100];
char temp_floriginname[100], real_floriginname[100];
time_t current_t;
struct tm *current_tm;
current_t = time((time_t *)NULL);
current_tm = localtime(¤t_t); //crashes here :-???
...
}
Thanks,
-kk
reply other threads:[~2005-02-08 7:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1107846062l.27933l.0l@mithrandir \
--to=mk3god@yahoo.co.in \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).