File compiles but produces Memory fault when executed


 
Thread Tools Search this Thread
Top Forums Programming File compiles but produces Memory fault when executed
# 1  
Old 08-28-2008
Question File compiles but produces Memory fault when executed

I run the following
K$ cc -v dtfn.c -o dtfn
Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-java-awt=gtk --host=x86_64-redhat-linux
Thread model: posix
gcc version 3.4.6 20060404 (Red Hat 3.4.6-9)
/usr/libexec/gcc/x86_64-redhat-linux/3.4.6/cc1 -quiet -v dtfn.c -quiet -dumpbase dtfn.c -mtune=k8 -auxbase dtfn -version -o /tmp/ccCjfjZg.s
ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../x86_64-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/lib/gcc/x86_64-redhat-linux/3.4.6/include
/usr/include
End of search list.
GNU C version 3.4.6 20060404 (Red Hat 3.4.6-9) (x86_64-redhat-linux)
compiled by GNU C version 3.4.6 20060404 (Red Hat 3.4.6-9).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
as -V -Qy -o /tmp/ccHube1p.o /tmp/ccCjfjZg.s
GNU assembler version 2.15.92.0.2 (x86_64-redhat-linux) using BFD version 2.15.92.0.2 20040927
/usr/libexec/gcc/x86_64-redhat-linux/3.4.6/collect2 --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o dtfn /usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/3.4.6/crtbegin.o -L/usr/lib/gcc/x86_64-redhat-linux/3.4.6 -L/usr/lib/gcc/x86_64-redhat-linux/3.4.6 -L/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../.. -L/lib/../lib64 -L/usr/lib/../lib64 /tmp/ccHube1p.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-redhat-linux/3.4.6/crtend.o /usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../../../lib64/crtn.o
oracle@CURRENT-enmcgpd1:/users/oracle


It compiles but will not run. I have attached the .c file.

Any help here will be greatly appreciated

Thanks
# 2  
Old 08-28-2008
Brief explanation of the program would be nice alongwith some typical examples of usage...as for troubleshooting what errors are you getting?
# 3  
Old 08-29-2008
Example

It is a handy date time function. We use it on AIX,Solaris,Windows and even 32bit Red Hat but this 64 bit is prewenting a problem.

K$ dtfn -?

Usage: dtfn [-options] Otto P. Bedrosian V1.20 2006-11-10

Default date format is mm/dd/[yy]yy (US) unless specified otherwise.

If date is not entered, system date is substituted if appropriate.

If 2-digit year is entered it will be expanded to 4-digit using
a rolling window based on system date +10 and -90 years.

Valid range of dates is from 1753 to 2799.

${T1} is date and time in the format 'mm/dd/yyyy hh:mi:ss'.

-A months [mm/dd/yyyy] Adjust the date by the number of months.
-a days [mm/dd/yyyy] Adjust the date by the number of days.
-B [mm/dd/yyyy] Beginning of the week (Sunday) for a date.
-b [mm/dd/yyyy] First workday of the month for a date.
-C [mm/dd/yyyy] Day of century for the date.
-c mm/dd/yyyy [mm/dd/yyyy] Compare date1 and date2. Return (date1 - date2).
-D [mm/dd/yyyy] Name of the day for a date (Monday).
-d [mm/dd/yyyy] Abbreviated name of the day for a date (Mon).
-E [mm/dd/yyyy] End of week (Saturday) for a date.
-e [yyyy] Date of Easter for a year.
-F days [mm/dd/yyyy] Adjust the date by the number of workdays.
-f mm/dd/yyyy [mm/dd/yyyy] Workdays between date1 and date2 (inclusive).
-G minutes [${T1}] Adjust the date/time by minutes ('yyyy-mm-dd hh:mi:ss').
-g minutes [${T1}] Adjust the date/time by minutes ('mm/dd/yyyy hh:mi:ss').
-H [yyyy-mm-dd] Abbreviated name of the day for a date (Mon).
-I [yyyy] Daylight Saving Time spring switchover date for US.
-i [yyyy] Daylight Saving Time fall switchover date for US.
-J JD number Date from Julian Date (2,361,222 - 2,743,738).
-j [mm/dd/yyyy] Julian Date number for the date (1753 - 2799).
-K [mm/dd/yyyy] Number of days in a year 'yyyyddd'.
-k [yy][yy]ddd Date from number of days in a year 'mm/dd/yyyy'.
-L [mm/dd/yyyy] Last day of the month for a date.
-l [mm/dd/yyyy] Last workday of the month for a date.
-M [mm/dd/yyyy] Name of the month for the date (January).
-m [mm/dd/yyyy] Abbreviated name of the month for the date (Jan).
-N [mm/dd/yyyy] Work hours in the month for a date (8 hrs/day).
-n weeks [mm/dd/yyyy] Adjust the date by the number of weeks.
-O [dd-MON-yyyy] Convert date from 'dd-MON-yyyy' to 'mm/dd/yyyy'.
-o [mm/dd/yyyy] Convert date from 'mm/dd/yyyy' to 'dd-MON-yyyy'.
-P hours [mm/dd/yyyy] Adjust the date by work hours (8 hrs/day).
-p mm/dd/yyyy [mm/dd/yyyy] Work hours between date1 and date2 (8 hrs/day).
-Q [yyyy-mm-dd] Quarter from date (yyyy-mm-dd to yyyy_qq).
-q [mm/dd/yyyy] Quarter from date (mm/dd/yyyy to yyyy_qq).
-R ${T1} [${T2}] Elapsed time in seconds (input format 'yyyy-mm-dd').
-r ${T1} [${T2}] Elapsed time in 'hh:mi:ss' (input 'yyyy-mm-dd').
-S System date and time (yyyy-mm-dd hh:mi:ss).
-s System date and time (yyyy-mm-dd hh:mi:ss Day).
-T System date and time (mm/dd/yyyy hh:mi:ss).
-t System date and time (mm/dd/yyyy hh:mi:ss Day).
-U ${T1} [${T2}] Elapsed time between two events in seconds.
-u ${T1} [${T2}] Elapsed time between two events in 'hh:mi:ss'.
-V yyyy-mm-dd Verify date: if ok return (yyyy-mm-dd) else '9'.
-v mm/dd/yyyy Verify date: if ok return (mm/dd/yyyy) else '9'.
-W [yyyy-mm-dd] Day of week (0-6, Sunday=0, Monday=1, Saturday=6).
-w [mm/dd/yyyy] Day of week (0-6, Sunday=0, Monday=1, Saturday=6).
-X [mm/dd/yyyy] Date in format 'yyyymmdd_doy_w_Day'.
-x System date and time in 'yyyymmdd_hhmiss_w_Day'.
-Y [yyyy-mm-dd] Convert date from format yyyy-mm-dd to mm/dd/yyyy.
-y [mm/dd/yyyy] Convert date from format mm/dd/yyyy to yyyy-mm-dd.
-Z [dd-mm-yyyy] Convert date from format dd-mm-yyyy to mm/dd/yyyy.
-? or -h List of options. (dtfn -? > dtfn.txt)
oracle@CURRENT-imgsrv1:/oracle/admin/aep_admin/library
K$ dtfn -s
2008-08-29 16:42:37 Fri

This is it compiled and running on AIX
# 4  
Old 08-29-2008
Works Now

Recompiled and it works now. It was producing a Memory Fault but it works now.

Thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Homework & Coursework Questions

Memory fault(coredump)

I am writing a program that copies a program and prints the program with a line count. this is the program I wrote: #include <stdio.h> main() { int c; int nl_cnt = 0; while((c = getchar()) != EOF){ if(c = '\n'){ nl_cnt++;... (3 Replies)
Discussion started by: heywoodfloyd
3 Replies

2. UNIX for Dummies Questions & Answers

Page Fault + Memory

I am not sure where to post this so i will put it in the newbie section. I have set up a bog standard debain 6, LAMP environment in the cloud. The specs 1 core at 2GH 2.5gb Memory running Jommla, with about 1.6K visitors a day. I am using AppFirst (appfirst.com) to monitor the... (2 Replies)
Discussion started by: waseem
2 Replies

3. Linux

Help with memory fault

We have migrated our application from HP UX to linux. The code is in 4gl and after migration it has started giving Memory fault while running a batch job. The trace shows segmentation fault after a series of recvfrom and sendto(DB read) sigsegv segmentation fault @ 0 0 killed by SIGSEGV The... (2 Replies)
Discussion started by: aimee
2 Replies

4. UNIX for Dummies Questions & Answers

mysql memory fault

I (think I) installed MYSQL on a Red Hat box. When I try to start mysql I get a memory fault error. Any ideas on how to fix this? Here is some info that might help: My distro info $ cat /proc/version Linux version 2.4.21-40.ELsmp (bhcompile@hs20-bc1-7 .build.redhat.com) (gcc version 3.2.3... (0 Replies)
Discussion started by: wsetchell
0 Replies

5. Ubuntu

Memory fault(coredump)

Hey guys, I am new to the Linux world and have a question to post. When I ssh from a HP-UX machine to a ubuntu machine I get the following error message Memory fault(coredump) i.e. ssh 192.168.1.3 I get this message as shown below Memory fault(coredump) Can someone please explain... (2 Replies)
Discussion started by: fkaba81
2 Replies

6. UNIX for Advanced & Expert Users

Memory fault in ql session

Hi, Am getting memory fault when i start ql session in SCO unix server. Can any one suggest the way to solve this issue. Thanks (0 Replies)
Discussion started by: param_it
0 Replies

7. Programming

memory fault

When I excute a program . It seems to generate an error : memory fault (core dump ) So how can i (1 Reply)
Discussion started by: iwbasts
1 Replies

8. Programming

Memory fault(coredump)

Dear All, I made a program which do some simple jobs like reading data from other process's shared memory and writing messages to the queues of other process. what happens is my program works fine and do all the task as expected but then then program ends it give Memory fault(coredump). I... (0 Replies)
Discussion started by: ralo
0 Replies

9. UNIX for Dummies Questions & Answers

Coredump (memory fault)

We are running a SQR program on Unix Platform with Oracle RDBMS. It's an interfacing program to integrate data from foreign sites to PeopleSoft database, using a flat file input. After many hours of processing, the program stops with a coredump error (memory fault). With top command we noticed... (1 Reply)
Discussion started by: araziki
1 Replies

10. UNIX for Dummies Questions & Answers

Memory Fault

I am using Unix OpenServer Release 5. When a run a application with user different to "Superuser" the application give me the following error: "Memory Fault - Core Dump". What's that mean? Thank you in advance. Roberto Veras. (1 Reply)
Discussion started by: robertoveras
1 Replies
Login or Register to Ask a Question