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_check_acc_handle(9F)				   Kernel Functions for Drivers 				  ddi_check_acc_handle(9F)

NAME
ddi_check_acc_handle, ddi_check_dma_handle - Check data access and DMA handles SYNOPSIS
#include <sys/ddi.h> #include <sys/sunddi.h> int ddi_check_acc_handle(ddi_acc_handle_t acc_handle ); int ddi_check_dma_handle(ddi_dma_handle_t dma_handle ); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI) PARAMETERS
acc_handle Data access handle obtained from a previous call to ddi_regs_map_setup(9F), ddi_dma_mem_alloc(9F), or similar function. dma_handle DMA handle obtained from a previous call to ddi_dma_setup(9F) or one of its derivatives. DESCRIPTION
The ddi_check_acc_handle() and ddi_check_dma_handle() functions check for faults that can interfere with communication between a driver and the device it controls. Each function checks a single handle of a specific type and returns a status value indicating whether faults affecting the resource mapped by the supplied handle have been detected. If a fault is indicated when checking a data access handle, this implies that the driver is no longer able to access the mapped registers or memory using programmed I/O through that handle. Typically, this might occur after the device has failed to respond to an I/O access (for example, has incurred a bus error or timed out). The effect of programmed I/O accesses made after this happens is undefined; for exam- ple, read accesses (for example, ddi_get8(9F)) may return random values, and write accesses (for example, ddi_put8(9F)) may or may not have any effect. This type of fault is normally fatal to the operation of the device, and the driver should report it via ddi_dev_report_fault(9F) specifying DDI_SERVICE_LOST for the impact, and DDI_DATAPATH_FAULT for the location. If a fault is indicated when checking a DMA handle, it implies that a fault has been detected that has (or will) affect DMA transactions between the device and the memory currently bound to the handle (or most recently bound, if the handle is currently unbound). Possible causes include the failure of a component in the DMA data path, or an attempt by the device to make an invalid DMA access. The driver may be able to continue by falling back to a non-DMA mode of operation, but in general, DMA faults are non-recoverable. The contents of the memory currently (or previously) bound to the handle should be regarded as indeterminate. The fault indication associated with the current transaction is lost once the handle is (re-)bound, but because the fault may persist, future DMA operations may not succeed. Note that some implementations cannot detect all types of failure. If a fault is not indicated, this does not constitute a guarantee that communication is possible. However, if a check fails, this is a positive indication that a problem does exist with respect to communication using that handle. RETURN VALUES
The ddi_check_acc_handle() and ddi_check_dma_handle() functions return DDI_SUCCESS if no faults affecting the supplied handle are detected and DDI_FAILURE if any fault affecting the supplied handle is detected. EXAMPLES
static int xxattach(dev_info_t *dip, ddi_attach_cmd_t cmd) { ... /* This driver uses only a single register-access handle */ status = ddi_regs_map_setup(dip, REGSET_ZERO, &regaddr, 0, 0, , &acc_attrs, &acc_hdl); if (status != DDI_SUCCESS) return (DDI_FAILURE); ... } static int xxread(dev_t dev, struct uio *uio_p, cred_t *cred_p) { ... if (ddi_check_acc_handle(acc_hdl) != DDI_SUCCESS) { ddi_dev_report_fault(dip, DDI_SERVICE_LOST, DDI_DATAPATH_FAULT, "register access fault during read"); return (EIO); } ... CONTEXT
The ddi_check_acc_handle() and ddi_check_dma_handle() functions may be called from user, kernel, or interrupt context. SEE ALSO
ddi_regs_map_setup(9F), ddi_dma_setup(9F), ddi_dev_report_fault(9F), ddi_get8(9F), ddi_put8(9F) SunOS 5.11 13 August 1999 ddi_check_acc_handle(9F)
All times are GMT -4. The time now is 06:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy