Sponsored Content
Full Discussion: Memory Fault,Core dumped
Top Forums Programming Memory Fault,Core dumped Post 302204997 by vguleria on Friday 13th of June 2008 05:57:25 AM
Old 06-13-2008
Hi,


Your code is giving segmentation fault due to wrong use of strcmp(str1,str2) function.

A string can't be compared using strcmp with a NULL pointer. Both the arguments should be not NULL only. Use

str==NULL

for comparison instead.
This 'll remove the segmentation fault. Smilie


Regards,
Vinod.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Segmentation fault (core dumped)

Hello To All! Now anfd then I receive a message on my console: Segmentation fault (core dumped) What does it mean? Or more precisely what are the implications? :confused: (1 Reply)
Discussion started by: Ivo
1 Replies

2. Programming

Segmentation Fault (core dumped)

what r the situations to receive an error msg like the one below Segmentation Fault (core dumped) (2 Replies)
Discussion started by: bankpro
2 Replies

3. UNIX for Advanced & Expert Users

Memory Fault - Core Dumped

I use SCO UNIX 5.07 on a Compaq Proliant Machine. Each time I press the Escape or Delete key while running a program or issuing a FoxBase+ command from the dot prompt, I receive the error message: "Memory Fault - Core Dumped" and the screen locks up immediately. I would appreciate if necessary... (0 Replies)
Discussion started by: bayuz
0 Replies

4. Solaris

Segmentation Fault (core dumped)

i am getting Segmentation Fault (core dumped) on solaris, but when i run the same program with same input on linux it runs successfully. How can i trace the fault in program on solaris. (6 Replies)
Discussion started by: junaid.nehvi
6 Replies

5. UNIX for Dummies Questions & Answers

Segmentaion Fault - Core dumped during cpio

The same cpio script has been working for years without modifications, until the last couple of nights when we get the error Segmentation Fault - core dumped and the cpio aborts. It appears to abort in relatively the same place every time and on multiple tapes. Do I have a bad tape drive,... (8 Replies)
Discussion started by: golfs4us
8 Replies

6. Solaris

segmentation fault core dumped

i am getting segmentation fault (core dumped) i tried following things but couldn't understand what is wrong with my prog and where the problem is.... i have only adb debugger available on solaris.... so plz help bash-3.00$ pstack core core 'core' of 765: ./mod_generalised_tapinread... (4 Replies)
Discussion started by: junaid.nehvi
4 Replies

7. Red Hat

Segmentation fault (core dumped)

Hi All, I am getting "Segmentation fault (core dumped)" error in the runtime. I am new this please can you tell me why is that i am getting this error and I am not sure of my compilation : gcc -c avc_test.c gcc -c md5.c gcc avc_test.o md5.o -shared -Llibcoreavc_sdk.so -o proj ... (1 Reply)
Discussion started by: fido.genial
1 Replies

8. Programming

Memory Fault (core dumped) in ttpy program

I´m writing this program in QNX , I`m kinda new to UNIX and programing in general, and when I try to run it it gives me the Memory Fault error. Can anyone help? #include <stdio.h> #include <fcntl.h> void main(void) {int a,ter; char buf; printf("a="); scanf("%d",a); ter=open... (6 Replies)
Discussion started by: GiganteAsesino
6 Replies

9. Programming

C: Memory Fault (core dumped)

When I run programm show this message: Memory Fault (core dumped) Does anyone can help me and tell me what is wrong? please #include <stdlib.h> #include <stdio.h> #include <process.h> #include <unistd.h> #include <sys/types.h> #include <sys/wait.h> int main(int argc, char *argv) { ... (3 Replies)
Discussion started by: ebasse2
3 Replies

10. UNIX and Linux Applications

Tilda Segmentation fault (core dumped)

Can anyone tell me why I keep getting a Segmentation fault when I try to run tilda? $ tilda Segmentation fault (core dumped) It seemed to run after I deleted my tilda directory like this thread said to do. Unfortunately it wouldn't let me set my keybinding with anything I tried. ... (0 Replies)
Discussion started by: cokedude
0 Replies
core(4) 						     Kernel Interfaces Manual							   core(4)

NAME
core - Format of memory image file SYNOPSIS
#include <sys/core.h> DESCRIPTION
The system writes out a memory image of a terminated process when any of various errors occur. See sigaction(2) for the list of reasons; the most common are memory violations, illegal instructions, bus errors, and user-generated quit signals. The memory image is called core and is written in the process's working directory (provided that it can be; normal access controls apply). The maximum size of a core file is limited. If a process exceeds this limit, any remaining data to be written to the core file is lost. Default behavior is for the system to create a file named core, overwriting any other file with that name in the working directory. You can enable enhanced core file naming, which causes the system to create unique names for core files. Core files are not overwritten, thereby preventing loss of valuable debugging information when the same program fails mulitiple times (and perhaps for mulitple reasons). When enhanced core file naming is enabled, the system produces core files with names in the following format: core.program_name.host_name.numeric_tag The literal string core. Up to sixteen characters taken from the program name as shown by the ps command. The first portion of the system's network host name, or up to 16 characters of the host name, taken from the part of the host name that precedes the first dot. This tag is assigned to the core file to make it unique among all of the core files generated by a pro- gram on a host. The maximum value for this tag, and thus the maximum number of core files for this program and host, is set by a system configuration parameter. Note the tag is not a literal version number. The system selects the first available unique tag for the core file. For example, if a program's core files have tags .0, .1, and .3, the system uses tag .2 for the next core file it creates for that program. If the system-configured limit for core file instances is reached, the system will not create any more core files for that program/host combination. By default, the system can create up to 16 versions of a core file. For example, the fourth core file generated on host buggy.net.ooze.com by the program dropsy would be: core.dropsy.buggy.3 Enhanced core file naming can be enabled at the system level or the program level: At the system level, you can enable enhanced core file naming by setting the enhanced-core-name system configuration variable to 1 in the proc subsystem: proc: enhanced-core-name = 1 At the program level, you can enable enhanced core file naming by calling the uswitch system call with the USW_CORE flag set. See the EXAMPLE section. The system manager can limit the number of unique core file versions that a program can create on a specific host system by setting the system configuration variable enhanced-core-max-versions to the desired value: proc: enhanced-core-name = 1 enhanced-core-max-versions = 8 The miminum value is 1, the maximum is 99,999, and the default is 16. EXAMPLE
The following example shows a code fragment that calls the uswitch system call with the USW_CORE flag set: #include <signal.h> #include <sys/uswitch.h> /* * Request enhanced core file naming for * this process then create a core file. */ main() { long uval = uswitch(USC_GET, 0); uval = uswitch(USC_SET, uval | USW_CORE); if (uval < 0) { perror("uswitch"); exit(1); } raise(SIGQUIT); } In general, the debugger dbx(1) is sufficient to deal with core images. RELATED INFORMATION
sigaction(2), uswitch(2), sysconfigdb(8), dbx(1) delim off core(4)
All times are GMT -4. The time now is 08:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy