Sponsored Content
Top Forums Programming Cannot access memory at address 0x8 Post 302212249 by spirtle on Monday 7th of July 2008 04:26:41 AM
Old 07-07-2008
You are dereferencing a null pointer:
Code:
ims_fp=NULL;
...
printf("%d",ims_fp->j);

According to the language definition, the behaviour is undefined if you do this, so that's why you have different behaviour on different platforms.
In order to make your code run correctly, you need to either remove the lines
Code:
free(ims_fp);
ims_fp=NULL;

or remove the function call
Code:
IMS_feof(ims_fp);

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Restricting access to a machine by IP Address

I have a need to allow only certain IP addresses to access a machine running solaris 9. I am not sure how this can be accomplished. Thanks in advance for your help. Patch (2 Replies)
Discussion started by: patch
2 Replies

2. Programming

how to round up a memory address(memory alignment problem)

Hi, I try to marshal a unsigned int and a char * into a buffer, and then unmarshal them later to get them out. I need to put the char * in the front and unsigned int at the end of the buffer. However, my system always give me "BUS ERROR". I am using Sun Sparcs Sloris 2.10. My code to marshal... (6 Replies)
Discussion started by: nj302
6 Replies

3. UNIX for Advanced & Expert Users

Can kernel process access user address space ?

Can kernel process access user address space ? (2 Replies)
Discussion started by: subhotech
2 Replies

4. Solaris

Error: Memory Address Not aligned

Hi, The following error message occured when I was trying to reboot my SUN machine: Memory address not aligned Its a Sun 280 R , Ultra SPARC III What should I do. Varma (3 Replies)
Discussion started by: gunnervarma
3 Replies

5. Linux

Block RSH access by IP address

Hi All i need to use RSH ( i can hear you all banging your head against a wall ) but i want to block a certain IP address from access my machine via RSH, is there way to do this thanks A (3 Replies)
Discussion started by: ab52
3 Replies

6. Cybersecurity

How to access private IP address?

HI, I'm doing a research on client/server connection. I need to run the server code to open socket connection with the client code. To make the test real, I need to run the server code from a a machine far away from the client over the Internet. IN ORDER TO RUN THE CODE, the client has to know the... (3 Replies)
Discussion started by: ENG_MOHD
3 Replies

7. Solaris

Restrict XWindows Server Access by IP Address

We want to disable graphical logins on our Solaris 10(64bit sparc )boxes, but I haven't found any information on how to do it via google. Most likely I am using the wrong search terms (i've been looking for "xdmcp" and "x11" "disable") . While looking through the output of "svcs -a | grep... (3 Replies)
Discussion started by: the.gooch
3 Replies

8. What is on Your Mind?

Plan to Restrict RSS Access by IP Address

Hello Everyone, We plan to restrict all RSS news feed access soon based on IP address. This means that if you have a website or application that using our site RSS feeds, you can still do it; but your must register you site in this thread. So please reply with your IP address of your server... (7 Replies)
Discussion started by: Neo
7 Replies

9. Post Here to Contact Site Administrators and Moderators

Register Here to Permit RSS Access by IP Address

Hello Everyone, We now (only) permit access to our RSS news feed access based on IP address. This means that if you have a website or application that using our site RSS feeds, you can still do it; but your must register you site in this thread. So please reply with your IP address of your... (9 Replies)
Discussion started by: Neo
9 Replies

10. UNIX for Beginners Questions & Answers

How to write a value to a physical memory address in bash script?

How would I write a value to a physical memory address? I was able to read a physical memory address (for example, 0x400) using this line: dd if=/dev/mem count=4 bs=1 skip=$(( 0x400 )) But I get an error: dd: 'standard input': cannot skip to specified offset when I try to write using... (1 Reply)
Discussion started by: rabrandt
1 Replies
BADADDR(9r)															       BADADDR(9r)

NAME
BADADDR - General: Probes the address during device autoconfiguration SYNOPSIS
int BADADDR( caddr_t addr, int length, struct bus_ctlr_common *ptr ); ARGUMENTS
Specifies the address of the device registers or memory. Specifies the length (in bytes) of the data to be checked. Valid values are 1, 2, and 4 on 32-bit machines and 4 and 8 on 64-bit machines. Specifies a pointer to a bus_ctlr_common structure. You cast this argument as a pointer to either a bus or controller structure. DESCRIPTION
The BADADDR routine generates a call to a machine-dependent routine that does a read access check of the data at the supplied address and dismisses any machine check exception that may result from the attempted access. You call this routine to probe for memory or I/O devices at a specified address during device autoconfiguration. NOTES
You can use BADADDR in device drivers that are statically configured into the kernel. However, you cannot use BADADDR if the driver is dynamically configured into the kernel. If you implement the driver to be both statically and dynamically configured, you can declare a variable and use it to control the call to BADADDR. The following code fragment shows the use of such a variable used in the probe routine for the /dev/none driver: . . . if (none_is_dynamic) { /* Code to handle tasks associated with a dynamically * * configured driver */ . . . } else { /* Code to handle tasks (including the call to BADADDR) * * associated with a statically configured driver * * including call to BADADDR */ } . . . The EISA and ISA buses do not generate a machine check when BADADDR performs a read access to a nonexistent location. These buses always return success when BADADDR performs a read access to their address space. For the PCI bus and the VMEbus, you must do the following before calling BADADDR: Call the iohandle_to_phys routine to convert the I/O han- dle to a valid system physical address Call the PHYS_TO_KSEG routine to convert the valid system physical address to a kernel-unmapped vir- tual address Call the BADADDR routine, passing this kernel-unmapped virtual address as the first argument RETURN VALUES
The BADADDR routine returns the value 0 (zero) if the data is accessible or a nonzero value if the data is not accessible. BADADDR(9r)
All times are GMT -4. The time now is 03:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy