Re: probem with dl_runtime.c

From: Tauno Voipio (tauno.voipio_at_iki.fi.NOSPAM.invalid)
Date: 10/31/04


Date: Sun, 31 Oct 2004 16:26:04 GMT

nikhil bhargav wrote:
> hello,
>
> I am running a program implementing 24 trees but i am facing a
> problem. I am usning gettimeofday function to find the total time
> taken by the program. The program executes normally but while printing
> the last line it givs error segmentation fault
> -------------------------------------------------------
> gettimeofday(&end,tz);
> time=(end.tv_sec*1000000)+end.tv_usec;
> time=time-((start.tv_sec*1000000)+start.tv_usec);
> printf("\nTime taken for performing %d operations (insert=%d
> Search=%d,deletions=%d)\nin Redblack tree is\n",tot,ins,sch,del);
> printf("\n %f micro secs\n",time);
> -------------------------------------------------------
> I debugged it by GDB which shows there is some run time library
> missing or problem in printf exercution as this problem is occuring in
> all printfs in the program. All other programs are executing fine.
>
> It gave messages like some problem in dl_runtime.c which i couldnot
> infer.
>
> Please help what should i do to rectify it?
>
> bye n thks for ur time,
>
> nikhil

What is the declared type of your variable 'time'?

If it is not float, printf gets lost and barfs at return (see
the format string).

Tauno Voipio
tauno voipio (at) iki fi



Relevant Pages

  • Re: timer / sigaction question
    ... > well it is not a timer / sigaction problem. ... > Now my question is why printf doesn't output. ... > This is a user app. ... Tauno Voipio ...
    (comp.programming)
  • Re: timer / sigaction question
    ... > well it is not a timer / sigaction problem. ... > Now my question is why printf doesn't output. ... > This is a user app. ... Tauno Voipio ...
    (comp.os.linux.development.apps)
  • Re: timer / sigaction question
    ... >> Now my question is why printf doesn't output. ... >> This is a user app. ... > tauno voipio @ iki fi ... The problem is the printf is not printing out in the loop ...
    (comp.os.linux.development.apps)
  • Re: timer / sigaction question
    ... >> Now my question is why printf doesn't output. ... >> This is a user app. ... > tauno voipio @ iki fi ... The problem is the printf is not printing out in the loop ...
    (comp.programming)