Sponsored Content
Top Forums Programming Segmentation Fault (core dumped) Post 96462 by blowtorch on Friday 20th of January 2006 06:23:18 AM
Old 01-20-2006
Trying to read from an illegal memory location will cause this fault. i.e.

Quote:
1. If you fopen a file, it fails and the file pointer returned is NULL and you try to read from that file pointer. This will give you a segmentation fault.
This User Gave Thanks to blowtorch For This Post:
 

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. 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

3. 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

4. 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

5. 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

6. Programming

getting Segmentation Fault (core dumped) error but Program runs fine.

i am executing following program int main() { char str; FILE * fp; int i=0; ... (4 Replies)
Discussion started by: bhavesh.sapra
4 Replies

7. UNIX for Advanced & Expert Users

Segmentation Fault/ core dumped in metadb

When I was trying to mirror in my v880 server after OS up gradation from 8 to 10 metadb -afc 3 /dev/dsk/c1t1d0s7 I got an error metadb: Segmentation Fault Segmentation Fault (core dumped) Then I logged a case to Oracle/sun team they suggest "Please could you try metadb -ac 3... (0 Replies)
Discussion started by: taherahmed
0 Replies

8. 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

9. 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

10. UNIX for Dummies Questions & Answers

Find a string across line break (because of "segmentation fault core dumped")

Hi, thanks to a precedent post, and thanks to the reply of derekludwig of the forum, I have convert my first awk command as : test.txt is : AAAAAGHIJKLAjKMEFJKLjklABCDJkLEFGHIJKL awk -f findstring.awk test.txt > textreturn.txtfindstring.awk is : BEGIN{ SLENGTH = 3 } { ... (3 Replies)
Discussion started by: thewizarde6
3 Replies
ddi_dev_report_fault(9F)				   Kernel Functions for Drivers 				  ddi_dev_report_fault(9F)

NAME
ddi_dev_report_fault - Report a hardware failure SYNOPSIS
#include <sys/ddi.h> #include <sys/sunddi.h> void ddi_dev_report_fault (dev_info_t *dip, ddi_fault_impact_t impact, ddi_fault_location_t location, const char *message ); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI) PARAMETERS
dip Pointer to the driver's dev_info structure to which the fault report relates. (Normally the caller's own dev_info pointer). impact One of a set of enumerated values indicating the impact of the fault on the device's ability to provide normal service. location One of a set of enumerated values indicating the location of the fault, relative to the hardware controlled by the driver specified by dip. message Text of the message describing the fault being reported. DESCRIPTION
This function provides a standardized mechanism through which device drivers can report hardware faults. Use of this reporting mechanism enables systems equipped with a fault management system to respond to faults discovered by a driver. On a suitably equipped system, this might include automatic failover to an alternative device and/or scheduling replacement of the faulty hardware. The driver must indicate the impact of the fault being reported on its ability to provide service by passing one of the following values for the impact parameter: DDI_SERVICE_LOST Indicates a total loss of service. The driver is unable to implement the normal functions of its hardware. DDI_SERVICE_DEGRADED The driver is unable to provide normal service, but can provide a partial or degraded level of service. The driver may have to make repeated attempts to perform an operation before it succeeds, or it may be running at less than its configured speed. A driver may use this value to indicate that an alternative device should be used if available, but that it can continue operation if no alternative exists. DDI_SERVICE_UNAFFECTED The service provided by the device is currently unaffected by the reported fault. This value may be used to report recovered errors for predictive failure analysis. DDI_SERVICE_RESTORED The driver has resumed normal service, following a previous report that service was lost or degraded. This mes- sage implies that any previously reported fault condition no longer exists. The location parameter should be one of the following values: DDI_DATAPATH_FAULT The fault lies in the datapath between the driver and the device. The device may be unplugged, or a problem may exist in the bus on which the device resides. This value is appropriate if the device is not responding to accesses, (for example, the device may not be present) or if a call to ddi_check_acc_handle(9F) returns DDI_FAILURE. DDI_DEVICE_FAULT The fault lies in the device controlled by the driver. This value is appropriate if the device returns an error from a selftest function, or if the driver is able to determine that device is present and accessible, but is not func- tioning correctly. DDI_EXTERNAL_FAULT The fault is external to the device. For example, an Ethernet driver would use this value when reporting a cable fault. If a device returns detectably bad data during normal operation (an "impossible" value in a register or DMA status area, for example), the driver should check the associated handle using ddi_check_acc_handle(9F) or ddi_check_dma_handle(9F) before reporting the fault. If the fault is associated with the handle, the driver should specify DDI_DATAPATH_FAULT rather than DDI_DEVICE_FAULT. As a consequence of this call, the device's state may be updated to reflect the level of service currently available. See ddi_get_devstate(9F). Note that if a driver calls ddi_get_devstate(9F) and discovers that its device is down, a fault should not be reported- the device is down as the result of a fault that has already been reported. Additionally, a driver should avoid incurring or reporting additional faults when the device is already known to be unusable. The ddi_dev_report_fault() call should only be used to report hardware (device) problems and should not be used to report purely software problems such as memory (or other resource) exhaustion. EXAMPLES
An Ethernet driver receives an error interrupt from its device if various fault conditions occur. The driver must read an error status register to determine the nature of the fault, and report it appropriately: static int xx_error_intr(xx_soft_state *ssp) { ... error_status = ddi_get32(ssp->handle, &ssp->regs->xx_err_status); if (ddi_check_acc_handle(ssp->handle) != DDI_SUCCESS) { ddi_dev_report_fault(ssp->dip, DDI_SERVICE_LOST, DDI_DATAPATH_FAULT, "register access fault"); return DDI_INTR_UNCLAIMED; } if (ssp->error_status & XX_CABLE_FAULT) { ddi_dev_report_fault(ssp->dip, DDI_SERVICE_LOST, DDI_EXTERNAL_FAULT, "cable fault") return DDI_INTR_CLAIMED; } if (ssp->error_status & XX_JABBER) { ddi_dev_report_fault(ssp->dip, DDI_SERVICE_DEGRADED, DDI_EXTERNAL_FAULT, "jabbering detected") return DDI_INTR_CLAIMED; } ... } CONTEXT
The ddi_dev_report_fault() function may be called from user, kernel, or interrupt context. SEE ALSO
ddi_check_acc_handle(9F), ddi_check_dma_handle(9F), ddi_get_devstate(9F) SunOS 5.11 13 August 1999 ddi_dev_report_fault(9F)
All times are GMT -4. The time now is 01:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy