Strange behavior in run-time vs. dbx behavior when using shmget - A question to Paul Pluzhnikov

Strange behavior in run-time vs. dbx behavior when using shmget - A question to Paul Pluzhnikov

Post by israelai » Tue, 01 Jun 2004 04:57:05


Hi Paul,
Thanks for your answer to my problem "Subject: Strange behavior in
run-time vs. dbx behavior when using shmget".
I don't understand how your hint will help me.
Maybe i was misunderstood. I'm writing to the 0x60000000 segment only
once in the beginning of my application, so the code there isn't
supposed to be changed, and in this segment there are no calls to
other procedures in this segment. So only a code from segment
0x10000000 will branch to this segment.
Maybe you mean that before writing to this segment i should flush the
buffer?
Thanks
Israel
 
 
 

Strange behavior in run-time vs. dbx behavior when using shmget - A question to Paul Pluzhnikov

Post by Paul Pluzh » Tue, 01 Jun 2004 05:51:48


XXXX@XXXXX.COM (Israel Waldman) writes:


If you wanted to ask me personally, it is probably would have been
better to just send a private e-mail. However, having decided to
use the usenet, you should have really continued the thread you
have already started, not start a new one. [You do know there is
a difference, don't you?]


What I meant is that this sequence doesn't work on PowerPC:

void *ip = ... // (1) some operation that returns a pointer to
// writable and executable page, e.g. 0x60000000

// (2) code to construct executable instructions at address ip
// (3) [missing steps]

void (*func)(void) = (void (*)())ip;
(*ip)(); // call the dynamically-generated code @ 0x600...

The missing steps in (3) are flushing D-cache and invalidating I-cache.

You may also try to construct a minimal example, which works under
dbx but doesn't work witout it. It would be much easier to find
your mistake if you posted such a test case.

Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.