× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



yep 2 programs retrieving the pointer to the same user space will see the
same memory address! why? because the object in question is in the same
place regardless of the process trying to access it.

Thanks,
Tommy Holden



From:
David Gibbs <david@xxxxxxxxxxxx>
To:
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>
Date:
06/19/2008 06:17 AM
Subject:
Re: Memory Leaks in RPG (was: Is RPG 'DEAD")



Scott Klement wrote:
It's theoretically possible to put a pointer in a user space and share
it with another job, but doing so is dangerous for this very reason...
if the job that allocated the memory ends, the pointer will point to
unreserved memory, and produce the same sorts of "unpredictable results"

that you'd have with a buffer overflow.

Even if you handed a pointer around from job to job, would different
jobs even be able to access the same memory? Seems to me that the OS
should protect against memory access across job domains (unless the
memory is allocated in an approved 'shared memory' method).

I'm not at a system right now ... but I'm wondering if, when you
retrieve a pointer to the same user space in two different jobs, you get
the same pointer value?

b) Or, use the shared memory APIs (shmget, shmat, shmdt, etc) to reserve

shared memory.

Hmmm ... this makes me wonder if the shared memory api's use user spaces
under the covers?

Weird as this sounds ... even though I was annoyed at the impetus of
this thread, it's gotten darn interesting.

david


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.