Hi All
I have a structure pointer and setting that pointer as NULL. When i tried to access the elements in the structure i am getting the error message.
"Cannot access memory at address 0x8". This i tried in LINUX.
When the same program is tried thro UNIX (HP-UX), i am not getting the message instead the null value "\0" is printed.
Can any of you tell me why it is so and if possible what is the necessary action that needs to be taken in LInux to avoid that error message.
I have the following program
You are dereferencing a null pointer:
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
or remove the function call
I understood what you said, but it works in HP-UX. As the value in the members are filled with 0's, while in Linux (64 bit)
uname -a
Linux optiplex64 2.6.9-55.0.2.ELsmp #1 SMP Tue Jun 26 14:14:47 EDT 2007 x86_64
it is not working.
One more point is that in another linux box (32 bit )
<lnx22:~>$ uname -a
Linux 2.4.21-37.ELsmp #1 SMP Wed Sep 7 13:28:55 EDT 2005 i686 i686 i386 GNU/Linux
it works.
So ... i am looking for a suitable solution where the same code should work in both in LInux and HP-UX.
Working/not working depends on implementation of kernel.
Basically how particular kernel deals with memory.
Sometimes it might allow you to read whatever your want, or might not.
For example in case of DOS you call is always valid, becuase iterrupts vector area is located in that area.
At the same time it's big security flaw if any procees is allowed to read any piece of memory. It might be a way to easily obtaint passwords, decription keys, etc. That's one of the reasosn, why you have such exception.
Your program is wrong regardless if it's HP-UX or Linux. It does that you didn't intend to do. You must rewrtie in order to avoid defrefencing of tha null-pointer.
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
2. Post Here to Contact Site Administrators and Moderators
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)
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)
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)
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)
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)
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)
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)
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)