Programming :: Shared Memory Address Area In Process Address Space?

Feb 21, 2011

if i attach a shared memory to my process whch part of the address space it will add(like stack, heap, data, code...).

View 3 Replies


ADVERTISEMENT

Programming :: Shared Memory - Should They Show The Same Address?

Mar 17, 2010

So I'll try to be brief and to the point here: I've got a couple of C / C++ apps that communicate with one another via shared memory. These worked completely fine until.. well, about twenty minutes ago when I finished making some network card changes and suddenly, I've got a weird problem going on. At one point, Parent app waits for Child app to set a boolean indicating it's finished initialization. This worked fine the last time I ran this app up (a few days ago). But right now, the shared flag never seems to get triggered (I've added a printf("Waiting..."); in Parent app until the flag is set). All the code leading up to it being set in Child app seem to be running smoothly, so I tried spitting out the addresses of the shared memory locations. The addresses mapped by Parent app and Child app are different; this seemed odd, so I went back and wrote a simple miniature app that just opened a shared structure on my own box, and I get the same thing - different addresses - but the miniature apps work just fine.

Is it normal for a shared memory space to be mapped to two different addresses across two processes?

If so, does anyone have any idea what might be the issue at hand with my Parent / Child app scenario? The Child creates the shared memory, the Parent has a wait before it opens it, and if it doesn't exist should fail (opening with PROT_READ | PROT_WRITE)... it doesn't fail so it's evidently there.

All of this worked until literally just a few hours ago and I made some changes to my network cards, and I can't even imagine how that could have changed whether or not shared memory mapping worked...

View 2 Replies View Related

Programming :: Fork() Copies The Address Space Of The Calling Process?

May 13, 2010

I know that fork() copies the address space of the calling process. Say, however, i have a linked list allocated. Will the list be copied over to the child process's space? If so, i would have to free them in the child process as well as the parent process, correct? Or will the variables be copied but not be pointing to any valid address? Or would it just kind of not do anything?example:

Code:
struct ll_ex {
struct ll_ex * next;

[code]....

View 7 Replies View Related

Programming :: Access At Physical Address - I/O Address In My Map Memory?

Dec 17, 2008

When I try to access at physical address (0xD0000), we known that it is necessary to convert physical address to virtual address using function IOREMAP(0xD0000, 1024) and return me 0xC00D0000.

Now our doubt is when I have a board with I/O in address 0x150, is it necessary to convert this address to other virtual address??? or with inb(0x150) return me state of I/O in this address? How can I known where is this I/O address in my map memory?

View 7 Replies View Related

General :: Application Virtual Address Space Memory Allocation - Memory Does Not Get Free

Apr 20, 2010

I am using malloc and frees a lot in my program. It shows its allocated but when i remove it doesnt show as the memory is removed(I am using the top command to view VIRT memory usage). If this continously grows what would happen to my program (Will it go out of memory?)

View 4 Replies View Related

General :: Reattaching To Same Address Space On Process Restart?

Feb 17, 2011

Suppose a process creates multiple shared mem segments as part of it job.Now is it always possible that on restart, that process can reattach to those previously created shared mem segments to the same virtual address spaces (returned on first time creation) ? My intention is use pointers over shared memory.So on restart I want those pointers absolute value to remain valid.

View 1 Replies View Related

Hardware :: Obtain A Real Memory Address From User Space - Mmap() And /dev/mem

Feb 25, 2010

I'm running an embedded Linux kernel, and I want to obtain a real memory address from user space. After goggeling a little, I found that the only way was to use mmap to access /dev/mem. But I never used mmap. I want to load a program in memory, in order to make it available from another processor, that has access to the DDR, but not to the flash memory where program is stored. Here is the code I use:

Code: // Open file and get its size
FILE* program = fopen(argv[3],"rb");
fseek(program, 0, SEEK_END);
long program_size = ftell(program);
fseek(program, 0, SEEK_SET);
// Prepare memory to copy it in
void* program_address = malloc(program_size+1);
FILE* memory_stream = fmemopen(program_real_address, program_size + 1, "wb");
[Code]....

View 5 Replies View Related

Security :: Address Space Randomization On 2.6.28-15-generic Ubuntu 9.04 - Finding Base Address?

Sep 14, 2009

Im an academic (university networks and security lecturer) studying/teaching network and operating system security, and inspired by the work of Hovav Shacham set about testing ASLR on linux. Principley I did this by performing a brute force buffer overflow attack on Fedora 10 and Ubuntu 9. I did this by writting a little concurrent server daemon which accidently on purpose didnt do bounds checking.

I then wrote a client to send it a malicious string brute forcing guessed addresses which caused a return-to-libc to the function usleep with a parameter of 16m causing a delay of 16 seconds as laid out in [URL] Once I hit the delay I new I had found the function and could calculate delta_mmap allowing me to create a standard chained ret-to-libc attack. All of that works fine. However .... To complete my understanding I am trying establish where I can find the standard base address for ubuntu 9 (and other distros) for the following, taken from Shacham:-

Quote:

[code]....

/proc/uid/maps gives me some information but not the base address ldd also gives me the randomised starting address for sections in the user address space but neither gives me the base address. Intrestingly ... when a run ldd with aslr on for over (about) 100 times and checked the start point of libc I determined that the last 3 (least significant) hex digits were always 0's and the fist 4 (most significant) where between 0xB7D7 and 0xB7F9. To me this indicated that bits 22-31 were fixed and bits 12-21 were randomized with bits 11-0 fixed. Although even that doesnt define the boundaries observed correctly.

Note: I am replicating the attack to provide signatures to detect it using IDS, and for teaching purposes. I am NOT a hacker and if needed to could reply from my .ac.uk email address as verification.

View 1 Replies View Related

General :: Virtual Memory Address To Physical Address?

Apr 13, 2010

How can I get the physical address corresponding to a virtual address in linux by using /proc file system

View 1 Replies View Related

General :: Mapping Kernel Virtual Address Space To Physical Memory Zones?

Nov 4, 2010

As i undertsand - out of 1GB of the virtual Address space for Kernel from 3GB to 4GB of the process address space, Kernel image (code, data, bss, stack, heap) resides staring @0x0 address. Vmalloc area starts either at the end of Physical ram size or at 896M. This 896M cap is mandated to ensure that minimum of 128MB is reserved as vmalloc_reserve for vmalloc,kmap etc.

Is the understanding correct? Now trying to map Physical Zones into this 1GB address space

Initial 16MB is mapped to ZONE_DMA
16MB - 896MB is mapped to ZONE_NORMAL
896MB - 1024MB is mapped to ZONE_HIGHMEM

Does this mean that Kernel image is residing in ZONE_DMA area? Any call to vmalloc() in kernel code will return address beyond 896M? insmod of any LKM will internally invoke vmalloc() to obtain contiguous area - where will this code physically located along with rest of kernel code in ZONE_DMA or in ZONE_HIGHMEM?

View 1 Replies View Related

Programming :: Gdb Reports - Cannot Access Memory At Address 0x8049088

Jul 11, 2011

Kernel 2.6.21.5, slackware 12.0
nasm 2.03.01
ld 2.17
GNU gdb 6.6

This GDB was configured as "i486-slackware-linux".

Code:

What could the cause of the message output by gdb possibly be? Reading some tutorials, I've learn the flat memory model is used in linux. So, in particular, I needn't care about the DS segment register.

Also, line 7 in the listing above, suggests nasm is assuming 32-bit addressing and so, I think it is using the flat memory model.

View 3 Replies View Related

Programming :: Calculate Flash Memory End Address Of A Certain File?

Mar 9, 2011

how to calculate (if possible) the end address of an image file in a flash memory. I'm trying to create a checksum and checkheader function and the info that I got is the file's offset, how many sector it consumes and its size. I kinda need the end address, sad thing is, I don't know how to calculate it.test.img's start address is 0, the size is 0x20000 and consumes 3 sectors.

View 6 Replies View Related

Programming :: Seg Fault. Memory Address Not Being Passed To Function?

Apr 19, 2010

I am writing a game in C with SDL. I can successfully display one image on the screen and animate it. However, I am having a lot of issues getting the background to display using the same method. I was asking for help on SDL related forums, but I determined that the issue is not SDL related, and it is actually a pointer issue. However, I can't find where I'm going wrong.

Code:
#include <SDL/SDL.h>
struct image

[code]...

View 4 Replies View Related

Programming :: Find Physical Address Of Memory Provided By Kmalloc

Oct 22, 2009

I allocated a chunk of memory using kmalloc in a Device Driver. Kmalloc provides a pointer to the allocated memory. This is one of my first few drivers.

I assume that the address returned is a Virtual address. I need to find the physical address of the memory location. I am working on an Intel 64 bit Fedora machine. I used the virt_to_phys() routine present in <asm/io_64.h>. I found that this routine returns an unsigned long value (32 bit) instead of an unsigned long long value (64 bit). Moreover, it seems that it simply returns the address - OFFSET instead of extracting the value in the page tables.

So is there any function / system call in Linux which will allow me to see the actual physical address on the Intel 64 arch.

View 3 Replies View Related

Programming :: Pass Ip Address, Port Address And Some Parameters From Command Line?

Apr 1, 2011

I want to pass ip address,port address and some parameters from command line using python script.The ip address and port address for establishing socket connection and remaining parameters to execute different connection.

View 1 Replies View Related

Programming :: Macro To Get Base Address Register In Configuration Space?

Nov 21, 2010

I am trying to understand working of pci_resource_start function So I browsed code via cscope and searched for string pci_resource_start and got following in pci.h

Code:

#define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start)

I am not able to understand how does this above macro works. How does it above macro gets appropriate base address register in configuration space?

View 1 Replies View Related

Programming :: Physical Versus Virtual Mac Address And Mac Address From NIC's Firmware?

Apr 6, 2011

I need a small shell based program that prints the mac address of physical ethernet adapter from it's firmware. I need this utility for license generation and appliance activation. I have tried several example but none of them is flawless, The easiest method I have found is to parse the output of "ifconfig" command but it has also some drawbacks.

1. Firstly program should differentiate between physical and virtual adapters. Physical means installed on board(wired or wireless) or installed additionally. Virtual adapters are those created by VPN or created by virtualization apps such as VirtualBox/VMWare etc. I am not interested in virtual ones.

2. In case of more them one physical adapters(wired and wireless), it should print the mac address and description(name & vendor) of both/all adapters.

3. If media is disconnected then also it should be able to read the mac address and description(name, vendor) of card.

4. This one is bit complex. I know that 'ethtool' can show you the universal mac address but it's limited to use only 2 types of drivers and won't work in all cases.

View 2 Replies View Related

Programming :: Translate Virtual Address To Physical Address In Application?

Nov 18, 2009

I want to translate the virtual address to physical address in linux C application, how to do that?

View 1 Replies View Related

Programming :: Find The Mac Address For A Given Ip Address?

Feb 16, 2010

I am trying to find out the mac address of the eth0 port on linux probe. This port is controlled by kernal and hence I don't have control over it. How do I find out the mac address of this port ? Is there any system call which will take the ip address and will do the lookup on the linux's ip table to get the mac address ?

View 6 Replies View Related

Software :: Accessing Memory Address Outside Standard Memory

Nov 22, 2009

I am writing an application that wants to access periphals registers outside the standard (allowed) memory area.

Doing so gets me "segmentation fault".

I know, this is natural behaviour.

One way of getting around this is writing the module which has to be loaded by linux. I will consider this some time later.

For now, I want to come to some quick result and allow linux or gcc compiler to write to those memory areas of periphals. Is there a direct way to do so?

View 3 Replies View Related

Programming :: Create A Shared Memory And Some Shared Objects?

Jun 11, 2010

I want to create a "Shared Memory" in linux, then create multiple "Shared Objects" that can access to a Table for example; And one of them can write something into the Table and the other can access and read it, so that these operations can be handled by programmer! I'm using Ubuntu 9.04 and I've set it's runlevel at 3 (I have commandline environment now!) I've searched the Internet so much, but couldn't find a good sample code for this! I have no experience about it and need your help to introduce me a sample code about it and advise me how to compile and use it with "GCC"?!

View 6 Replies View Related

CentOS 5 :: Implementing A Two-node Cluster With Shared Storage (GFS) And IP Address?

Jul 8, 2009

I am working on the beginning of implementing a two-node cluster with shared storage (GFS) and IP address. Both machines are virtual on VMware ESX 3.5, that should not make a difference, but that is the background.current status is that I have a single node cluster built with only the IP address configured within the cluster. The issue that I am having is that I have configured a service to contain only the IP address resource, however, when I go into cluster management that "service" does not register. As such, I cannot bring it online, ping it, etc. below is my cluster.conf configuration:

<?xml version="1.0"?>
<cluster alias="tmbackup" config_version="10" name="tmbackup">
<quorumd device="/dev/sdb1" interval="1" min_score="3" tko="10" votes="3">

[code]....

View 1 Replies View Related

Red Hat / Fedora :: Increase Memory Space Allocated For Process?

Jun 1, 2010

I want to know if i can increase the memory space allocated for a process manually while the process is running ,,,, and if it is possible how i can do this .

View 2 Replies View Related

General :: Virtual Address To Physical Memory Access ?

Feb 21, 2010

A process is trying one access to memory, for example through an array (ex.: vect[0]=123. What happens?

Here below what I guess but I'm not sure and accept any comment (please, distinguish between "the system" and "the CPU" in case).

Let's suppose swapping to disk disbled.

We have two scenarios: without and with cache.

If no cache is present in the system:
1. The CPU must discover the phys addr of vect[0] virtual addr. To do that, has to read from 3 (or 2 depending on the system?) pages tables, stored in memory as well.
2. The CPU writes to the final address.

These mean 4 memory accesses.

If cache is present:
1. Like above but, if the pages tables are in cache, we have 3 accesses to that.
2. If the req. page is not in cache, it's reads from ram and transferred to it. Afterwards, cache is written.
In the best case we have 4 cache accesses.

View 2 Replies View Related

Ubuntu Networking :: Port Forwarding From Public Address To Private Address?

Feb 24, 2010

Currently my OS is Ubuntu 9.04 Jaunty Jackalope Desktop OS and my web server is Apache2. I have a public address 60.x.y.z and my pc local address is 10.x.y.z. I have a web app in my Apache2 which currently run in localhost(10.x.y.z).

I would like to enable the web app so that it could be browse from outside. I know there maybe some port forwarding process and some commands involved in order to do that. But I have no idea on the steps to do that.

View 5 Replies View Related

Networking :: Error Str2addr:Address 35 Outside Range Of Address Field Length 1?

May 12, 2011

I am working on implementing a protocol on NS2.34 .I really need help to solve this problem . Actually , I don't now whether the problem is generated by the tcl code or the c++ code when I run the simulation, I get this result :

Code:
num_nodes is set 64
INITIALIZE THE LIST xListHead
34
45
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
SORTING LISTS ...DONE!
code....

View 1 Replies View Related

Networking :: Program To Assign Globa LIPv6 Address And Bind() To The Previously Assigned Address?

Apr 24, 2010

Consider the following program:

Code:
#include <stdio.h>
#include <stdint.h>

[code]...

View 2 Replies View Related

Ubuntu Networking :: Static IP Address And The Install Configures For A DHCP Configured Address - Network Not Starting

Dec 16, 2010

Version 10.04 LTS. Installed desktop version and network worked but I needed a static IP address and the install configures for a DHCP configured address. I tried changing to static address using the System->Preferences->Network Connections application but was unable to get the system to come up with the network up.

So I manually modified the /etc/network/interfaces and the /etc/resolv.conf files. I restart the system but when I do an ifconfig, I don't see a configured IP address on eth0 (only the loopback address). If I run /sbin/ifup eth0 everything then works fine and ifconfig shows the correct address bound to eth0.

My files are as follows:

View 2 Replies View Related

Ubuntu :: Firefox Address Box - Search For Something In The Main Address Bar - Input At The End

Jan 16, 2011

When I try to search for something in the main address bar It always adds the following with my input at the end

View 1 Replies View Related

Ubuntu Networking :: IP Address Set To Manual But Still Queries DHCP For Address

Mar 12, 2011

I'm running Ubuntu 10.10 and I'm having problems trying to assign it a static IP address. No matter what I put in the Preferences->Networking area (identifying the interface as Manual)... it still will query DHCP for an address if I run the dhclient command. I'm using to using ubuntu server where I just set the IP in the interfaces config file.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved