Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.theory > #31239 > unrolled thread
| Started by | olcott <NoOne@NoWhere.com> |
|---|---|
| First post | 2021-04-17 09:17 -0500 |
| Last post | 2021-04-19 13:47 -0400 |
| Articles | 20 on this page of 37 — 6 participants |
Back to article view | Back to comp.theory
Infinite recursion detection criteria (Please correct me if I am wrong) olcott <NoOne@NoWhere.com> - 2021-04-17 09:17 -0500
Infinite recursion detection criteria (Please correct me if I am wrong)(update) olcott <NoOne@NoWhere.com> - 2021-04-17 19:18 -0500
Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) Kaz Kylheku <563-365-8930@kylheku.com> - 2021-04-18 02:02 +0000
Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) olcott <NoOne@NoWhere.com> - 2021-04-17 21:04 -0500
Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) Kaz Kylheku <563-365-8930@kylheku.com> - 2021-04-18 02:19 +0000
Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) olcott <NoOne@NoWhere.com> - 2021-04-17 21:24 -0500
Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-04-17 19:05 -0700
Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) olcott <NoOne@NoWhere.com> - 2021-04-17 21:12 -0500
Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-04-17 19:18 -0700
Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-04-18 03:08 +0100
Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) olcott <NoOne@NoWhere.com> - 2021-04-17 21:16 -0500
Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-04-18 21:56 +0100
Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) olcott <NoOne@NoWhere.com> - 2021-04-18 16:08 -0500
Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-04-18 14:21 -0700
Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-04-18 14:22 -0700
Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-04-19 01:11 +0100
Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) olcott <NoOne@NoWhere.com> - 2021-04-18 19:32 -0500
Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-04-19 01:38 +0100
Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) olcott <NoOne@NoWhere.com> - 2021-04-18 19:52 -0500
Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-04-19 02:10 +0100
Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) olcott <NoOne@NoWhere.com> - 2021-04-18 19:57 -0500
Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-04-18 20:47 -0700
Re: Infinite recursion detection criteria (Please correct me if I am wrong) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-04-18 01:34 +0100
Re: Infinite recursion detection criteria (Please correct me if I am wrong) olcott <NoOne@NoWhere.com> - 2021-04-17 19:37 -0500
Re: Infinite recursion detection criteria (Please correct me if I am wrong) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-04-18 02:13 +0100
Re: Infinite recursion detection criteria (Please correct me if I am wrong) olcott <NoOne@NoWhere.com> - 2021-04-17 20:28 -0500
Re: Infinite recursion detection criteria (Please correct me if I am wrong) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-04-18 02:49 +0100
Re: Infinite recursion detection criteria (Please correct me if I am wrong) olcott <NoOne@NoWhere.com> - 2021-04-17 21:01 -0500
Re: Infinite recursion detection criteria (Please correct me if I am wrong) olcott <NoOne@NoWhere.com> - 2021-04-17 19:49 -0500
Re: Infinite recursion detection criteria (Please correct me if I am wrong) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-04-18 02:36 +0100
Re: Infinite recursion detection criteria (Please correct me if I am wrong) olcott <NoOne@NoWhere.com> - 2021-04-17 20:43 -0500
Re: Infinite recursion detection criteria (Please correct me if I am wrong) olcott <NoOne@NoWhere.com> - 2021-04-18 13:21 -0500
Re: Infinite recursion detection criteria (Please correct me if I am wrong) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-04-18 23:30 +0100
Re: Infinite recursion detection criteria (Please correct me if I am wrong) olcott <NoOne@NoWhere.com> - 2021-04-18 13:24 -0500
Re: Infinite recursion detection criteria (Please correct me if I am wrong) Mikko <mikko.levanto@outlook.com> - 2021-04-19 19:43 +0300
Re: Infinite recursion detection criteria (Please correct me if I am wrong) olcott <NoOne@NoWhere.com> - 2021-04-19 11:53 -0500
Re: Infinite recursion detection criteria (Please correct me if I am wrong) Richard Damon <Richard@Damon-Family.org> - 2021-04-19 13:47 -0400
Page 1 of 2 [1] 2 Next page →
| From | olcott <NoOne@NoWhere.com> |
|---|---|
| Date | 2021-04-17 09:17 -0500 |
| Subject | Infinite recursion detection criteria (Please correct me if I am wrong) |
| Message-ID | <HridnZb_Jp2ac-f9nZ2dnUU7-KdQAAAA@giganews.com> |
If a function X() is called by function Y() twice in sequence from the same machine address of Y() with the same parameters to X() and the execution trace shows no conditional branch instructions in Y() or function call returns in X() then the function call from Y() to X() is infinitely recursive unless X() stops it. The referenced execution trace is on x86 machine language, disassembled for human consumption. -- Copyright 2021 Pete Olcott "Great spirits have always encountered violent opposition from mediocre minds." Einstein
[toc] | [next] | [standalone]
| From | olcott <NoOne@NoWhere.com> |
|---|---|
| Date | 2021-04-17 19:18 -0500 |
| Subject | Infinite recursion detection criteria (Please correct me if I am wrong)(update) |
| Message-ID | <ZPKdnSyBUrN_5-b9nZ2dnUU7-efNnZ2d@giganews.com> |
| In reply to | #31239 |
On 4/17/2021 9:17 AM, olcott wrote:
> If a function X() is called by function Y() twice in sequence from the
> same machine address of Y() with the same parameters to X() and the
> execution trace shows no conditional branch instructions in Y() or
> function call returns in X() then the function call from Y() to X() is
> infinitely recursive unless X() stops it.
>
> The referenced execution trace is on x86 machine language, disassembled
> for human consumption.
>
void X(u32 P, i32 I)
{
Simulate(P, I);
}
void Y(u32 P)
{
X(P, P);
}
int main()
{
X((u32)Y, (u32)Y);
}
If the execution trace of function X() called by function Y() shows:
(1) Function X() is called twice in sequence from the same machine
address of Y().
(2) With the same parameters to X().
(3) With no conditional branch or indexed jump instructions in Y().
(4) With no function call returns from X().
then the function call from Y() to X() is infinitely recursive unless
X() stops it.
--
Copyright 2021 Pete Olcott
"Great spirits have always encountered violent opposition from mediocre
minds." Einstein
[toc] | [prev] | [next] | [standalone]
| From | Kaz Kylheku <563-365-8930@kylheku.com> |
|---|---|
| Date | 2021-04-18 02:02 +0000 |
| Subject | Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) |
| Message-ID | <20210417185831.149@kylheku.com> |
| In reply to | #31280 |
["Followup-To:" header set to comp.theory.]
On 2021-04-18, olcott <NoOne@NoWhere.com> wrote:
> On 4/17/2021 9:17 AM, olcott wrote:
>> If a function X() is called by function Y() twice in sequence from the
>> same machine address of Y() with the same parameters to X() and the
>> execution trace shows no conditional branch instructions in Y() or
>> function call returns in X() then the function call from Y() to X() is
>> infinitely recursive unless X() stops it.
>>
>> The referenced execution trace is on x86 machine language, disassembled
>> for human consumption.
>>
>
> void X(u32 P, i32 I)
> {
> Simulate(P, I);
^^^^
This necessariy has a shitload of conditional execution in it.
> }
>
> void Y(u32 P)
> {
> X(P, P);
> }
>
> int main()
> {
> X((u32)Y, (u32)Y);
> }
>
>
> If the execution trace of function X() called by function Y() shows:
> (1) Function X() is called twice in sequence from the same machine
> address of Y().
> (2) With the same parameters to X().
> (3) With no conditional branch or indexed jump instructions in Y().
> (4) With no function call returns from X().
> then the function call from Y() to X() is infinitely recursive unless
> X() stops it.
Wrong:
(3) a) With no conditional branch or indirect jump instructions
anywhere in the recursive loop, including the bodies of Y,
X, or any subroutine they call, or any child thereof.
b) There be no extensions to the Intel x86 instruction set.
which perpetrate conditional behavior inside the simulator
which subsequently affects the control flow.
The criterion that only Y has an basic block of instructions being
executed repeatedly are ridiculously insufficient for establishing that
there is a runaway recursion.
--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
[toc] | [prev] | [next] | [standalone]
| From | olcott <NoOne@NoWhere.com> |
|---|---|
| Date | 2021-04-17 21:04 -0500 |
| Subject | Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) |
| Message-ID | <QaSdnZaATossDub9nZ2dnUU7-R2dnZ2d@giganews.com> |
| In reply to | #31299 |
On 4/17/2021 9:02 PM, Kaz Kylheku wrote:
> ["Followup-To:" header set to comp.theory.]
> On 2021-04-18, olcott <NoOne@NoWhere.com> wrote:
>> On 4/17/2021 9:17 AM, olcott wrote:
>>> If a function X() is called by function Y() twice in sequence from the
>>> same machine address of Y() with the same parameters to X() and the
>>> execution trace shows no conditional branch instructions in Y() or
>>> function call returns in X() then the function call from Y() to X() is
>>> infinitely recursive unless X() stops it.
>>>
>>> The referenced execution trace is on x86 machine language, disassembled
>>> for human consumption.
>>>
>>
>> void X(u32 P, i32 I)
>> {
>> Simulate(P, I);
> ^^^^
>
> This necessariy has a shitload of conditional execution in it.
>
Yet my criteria decides correctly anyway.
--
Copyright 2021 Pete Olcott
"Great spirits have always encountered violent opposition from mediocre
minds." Einstein
[toc] | [prev] | [next] | [standalone]
| From | Kaz Kylheku <563-365-8930@kylheku.com> |
|---|---|
| Date | 2021-04-18 02:19 +0000 |
| Subject | Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) |
| Message-ID | <20210417191806.342@kylheku.com> |
| In reply to | #31301 |
On 2021-04-18, olcott <NoOne@NoWhere.com> wrote:
> On 4/17/2021 9:02 PM, Kaz Kylheku wrote:
>> ["Followup-To:" header set to comp.theory.]
>> On 2021-04-18, olcott <NoOne@NoWhere.com> wrote:
>>> On 4/17/2021 9:17 AM, olcott wrote:
>>>> If a function X() is called by function Y() twice in sequence from the
>>>> same machine address of Y() with the same parameters to X() and the
>>>> execution trace shows no conditional branch instructions in Y() or
>>>> function call returns in X() then the function call from Y() to X() is
>>>> infinitely recursive unless X() stops it.
>>>>
>>>> The referenced execution trace is on x86 machine language, disassembled
>>>> for human consumption.
>>>>
>>>
>>> void X(u32 P, i32 I)
>>> {
>>> Simulate(P, I);
>> ^^^^
>>
>> This necessariy has a shitload of conditional execution in it.
>>
>
> Yet my criteria decides correctly anyway.
By this you mean "the incomplete/incorrect criteria I'm produces the
expected behavior, so I'm pleased with that."
That's the software engineering spirit!
--
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
[toc] | [prev] | [next] | [standalone]
| From | olcott <NoOne@NoWhere.com> |
|---|---|
| Date | 2021-04-17 21:24 -0500 |
| Subject | Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) |
| Message-ID | <2_ydnfKeYefwBeb9nZ2dnUU7-YOdnZ2d@giganews.com> |
| In reply to | #31309 |
On 4/17/2021 9:19 PM, Kaz Kylheku wrote:
> On 2021-04-18, olcott <NoOne@NoWhere.com> wrote:
>> On 4/17/2021 9:02 PM, Kaz Kylheku wrote:
>>> ["Followup-To:" header set to comp.theory.]
>>> On 2021-04-18, olcott <NoOne@NoWhere.com> wrote:
>>>> On 4/17/2021 9:17 AM, olcott wrote:
>>>>> If a function X() is called by function Y() twice in sequence from the
>>>>> same machine address of Y() with the same parameters to X() and the
>>>>> execution trace shows no conditional branch instructions in Y() or
>>>>> function call returns in X() then the function call from Y() to X() is
>>>>> infinitely recursive unless X() stops it.
>>>>>
>>>>> The referenced execution trace is on x86 machine language, disassembled
>>>>> for human consumption.
>>>>>
>>>>
>>>> void X(u32 P, i32 I)
>>>> {
>>>> Simulate(P, I);
>>> ^^^^
>>>
>>> This necessariy has a shitload of conditional execution in it.
>>>
>>
>> Yet my criteria decides correctly anyway.
>
> By this you mean "the incomplete/incorrect criteria I'm produces the
> expected behavior, so I'm pleased with that."
>
> That's the software engineering spirit!
>
If you can find a counter-example feel free to share it.
Simply guessing that it is incorrect will not do.
--
Copyright 2021 Pete Olcott
"Great spirits have always encountered violent opposition from mediocre
minds." Einstein
[toc] | [prev] | [next] | [standalone]
| From | "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> |
|---|---|
| Date | 2021-04-17 19:05 -0700 |
| Subject | Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) |
| Message-ID | <s5g45l$1vc4$1@gioia.aioe.org> |
| In reply to | #31280 |
On 4/17/2021 5:18 PM, olcott wrote:
> On 4/17/2021 9:17 AM, olcott wrote:
>> If a function X() is called by function Y() twice in sequence from the
>> same machine address of Y() with the same parameters to X() and the
>> execution trace shows no conditional branch instructions in Y() or
>> function call returns in X() then the function call from Y() to X() is
>> infinitely recursive unless X() stops it.
>>
>> The referenced execution trace is on x86 machine language,
>> disassembled for human consumption.
>>
>
> void X(u32 P, i32 I)
> {
> Simulate(P, I);
> }
>
> void Y(u32 P)
> {
> X(P, P);
> }
>
> int main()
> {
> X((u32)Y, (u32)Y);
> }
>
>
> If the execution trace of function X() called by function Y() shows:
> (1) Function X() is called twice in sequence from the same machine
> address of Y().
> (2) With the same parameters to X().
> (3) With no conditional branch or indexed jump instructions in Y().
> (4) With no function call returns from X().
> then the function call from Y() to X() is infinitely recursive unless
> X() stops it.
>
>
Does your simulator handle the CMPXCHG instruction?
[toc] | [prev] | [next] | [standalone]
| From | olcott <NoOne@NoWhere.com> |
|---|---|
| Date | 2021-04-17 21:12 -0500 |
| Subject | Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) |
| Message-ID | <tMOdnQyFAPvyCOb9nZ2dnUU7-fHNnZ2d@giganews.com> |
| In reply to | #31302 |
On 4/17/2021 9:05 PM, Chris M. Thomasson wrote:
> On 4/17/2021 5:18 PM, olcott wrote:
>> On 4/17/2021 9:17 AM, olcott wrote:
>>> If a function X() is called by function Y() twice in sequence from
>>> the same machine address of Y() with the same parameters to X() and
>>> the execution trace shows no conditional branch instructions in Y()
>>> or function call returns in X() then the function call from Y() to
>>> X() is infinitely recursive unless X() stops it.
>>>
>>> The referenced execution trace is on x86 machine language,
>>> disassembled for human consumption.
>>>
>>
>> void X(u32 P, i32 I)
>> {
>> Simulate(P, I);
>> }
>>
>> void Y(u32 P)
>> {
>> X(P, P);
>> }
>>
>> int main()
>> {
>> X((u32)Y, (u32)Y);
>> }
>>
>>
>> If the execution trace of function X() called by function Y() shows:
>> (1) Function X() is called twice in sequence from the same machine
>> address of Y().
>> (2) With the same parameters to X().
>> (3) With no conditional branch or indexed jump instructions in Y().
>> (4) With no function call returns from X().
>> then the function call from Y() to X() is infinitely recursive unless
>> X() stops it.
>>
>>
>
> Does your simulator handle the CMPXCHG instruction?
The actual x86 emulator handles all of the x86 32-bit instructions.
If this screws up my criteria then I simply screen it out.
I may end up creating a machine much closer to a Turing machine except
that it will have 32-bit signed relative addressing at the very least.
--
Copyright 2021 Pete Olcott
"Great spirits have always encountered violent opposition from mediocre
minds." Einstein
[toc] | [prev] | [next] | [standalone]
| From | "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> |
|---|---|
| Date | 2021-04-17 19:18 -0700 |
| Subject | Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) |
| Message-ID | <s5g4tj$bg1$1@gioia.aioe.org> |
| In reply to | #31304 |
On 4/17/2021 7:12 PM, olcott wrote:
> On 4/17/2021 9:05 PM, Chris M. Thomasson wrote:
>> On 4/17/2021 5:18 PM, olcott wrote:
>>> On 4/17/2021 9:17 AM, olcott wrote:
>>>> If a function X() is called by function Y() twice in sequence from
>>>> the same machine address of Y() with the same parameters to X() and
>>>> the execution trace shows no conditional branch instructions in Y()
>>>> or function call returns in X() then the function call from Y() to
>>>> X() is infinitely recursive unless X() stops it.
>>>>
>>>> The referenced execution trace is on x86 machine language,
>>>> disassembled for human consumption.
>>>>
>>>
>>> void X(u32 P, i32 I)
>>> {
>>> Simulate(P, I);
>>> }
>>>
>>> void Y(u32 P)
>>> {
>>> X(P, P);
>>> }
>>>
>>> int main()
>>> {
>>> X((u32)Y, (u32)Y);
>>> }
>>>
>>>
>>> If the execution trace of function X() called by function Y() shows:
>>> (1) Function X() is called twice in sequence from the same machine
>>> address of Y().
>>> (2) With the same parameters to X().
>>> (3) With no conditional branch or indexed jump instructions in Y().
>>> (4) With no function call returns from X().
>>> then the function call from Y() to X() is infinitely recursive unless
>>> X() stops it.
>>>
>>>
>>
>> Does your simulator handle the CMPXCHG instruction?
>
> The actual x86 emulator handles all of the x86 32-bit instructions.
Ahh, okay. So it can handle the LOCK prefix as well, right? CMPXCHG is a
32-bit instruction and, well, you know about the LOCK prefix so, thanks
for answering my question.
https://www.felixcloutier.com/x86/cmpxchg
https://www.felixcloutier.com/x86/lock
Does your simulator lock the bus, and/or the cache line in its emulation
of these instructions? Think of trying, and failing to lock the cache
line a bunch of times in a row, then finally resorting to the bus lock.
How do you do it in your simulator?
> If this screws up my criteria then I simply screen it out.
I do not know what you mean. CMPXCHG, XADD, XCHG, all of the x86 32-bit
instructions must be in your simulator right?
> I may end up creating a machine much closer to a Turing machine except
> that it will have 32-bit signed relative addressing at the very least.
Did you emulator x86 or not?
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2021-04-18 03:08 +0100 |
| Subject | Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) |
| Message-ID | <87eef873a2.fsf@bsb.me.uk> |
| In reply to | #31280 |
olcott <NoOne@NoWhere.com> writes:
> On 4/17/2021 9:17 AM, olcott wrote:
>> If a function X() is called by function Y() twice in sequence from the same machine address of Y() with the same parameters to X() and the execution trace shows no conditional branch instructions in Y() or function call returns in X() then the function call from Y() to X() is infinitely recursive unless X() stops it.
>>
>> The referenced execution trace is on x86 machine language, disassembled for human consumption.
>>
>
> void X(u32 P, i32 I)
> {
> Simulate(P, I);
> }
>
> void Y(u32 P)
> {
> X(P, P);
> }
>
> int main()
> {
> X((u32)Y, (u32)Y);
> }
>
>
> If the execution trace of function X() called by function Y() shows:
> (1) Function X() is called twice in sequence from the same machine address of Y().
> (2) With the same parameters to X().
> (3) With no conditional branch or indexed jump instructions in Y().
> (4) With no function call returns from X().
> then the function call from Y() to X() is infinitely recursive unless
> X() stops it.
Can you tell if this is or is not infinite recursion:
0x00005555555551de <main+0>: endbr64
0x00005555555551e2 <main+4>: push %rbp
0x00005555555551e3 <main+5>: mov %rsp,%rbp
0x00005555555551e6 <main+8>: lea -0x4a(%rip),%rdx
0x00005555555551ed <main+15>: lea -0x51(%rip),%rax
0x00005555555551f4 <main+22>: lea (%rdx),%rsi
0x00005555555551f7 <main+25>: lea (%rax),%rdi
0x00005555555551fa <main+28>: callq 0x555555555174 <X>
0x0000555555555174 <X+0>: endbr64
0x0000555555555178 <X+4>: push %rbp
0x0000555555555179 <X+5>: lea (%rsp),%rbp
0x000055555555517d <X+9>: lea -0x10(%rsp),%rsp
0x0000555555555182 <X+14>: mov %rdi,-0x8(%rbp)
0x0000555555555186 <X+18>: mov %rsi,-0x10(%rbp)
0x000055555555518a <X+22>: mov -0x10(%rbp),%rdx
0x000055555555518e <X+26>: mov -0x8(%rbp),%rax
0x0000555555555192 <X+30>: mov %rdx,%rsi
0x0000555555555195 <X+33>: mov %rax,%rdi
0x0000555555555198 <X+36>: callq 0x555555555129 <Simulate>
0x0000555555555129 <Simulate+0>: endbr64
0x000055555555512d <Simulate+4>: push %rbp
0x000055555555512e <Simulate+5>: lea (%rsp),%rbp
0x0000555555555132 <Simulate+9>: lea -0x10(%rsp),%rsp
0x0000555555555137 <Simulate+14>: mov %rdi,-0x8(%rbp)
0x000055555555513b <Simulate+18>: mov %rsi,-0x10(%rbp)
0x000055555555513f <Simulate+22>: mov 0x2f07(%rip),%eax
0x0000555555555145 <Simulate+28>: mov %eax,%edx
0x0000555555555147 <Simulate+30>: add $0x1,%edx
0x000055555555514a <Simulate+33>: mov %edx,0x2efc(%rip)
0x0000555555555150 <Simulate+39>: cltq
0x0000555555555152 <Simulate+41>: lea 0x0(,%rax,8),%rdx
0x000055555555515a <Simulate+49>: lea 0x2ebf(%rip),%rax
0x0000555555555161 <Simulate+56>: mov (%rdx,%rax,1),%rdx
0x0000555555555165 <Simulate+60>: mov -0x10(%rbp),%rax
0x0000555555555169 <Simulate+64>: mov %rax,%rdi
0x000055555555516c <Simulate+67>: callq *%rdx
0x00005555555551a3 <Y+0>: endbr64
0x00005555555551a7 <Y+4>: push %rbp
0x00005555555551a8 <Y+5>: lea (%rsp),%rbp
0x00005555555551ac <Y+9>: lea -0x10(%rsp),%rsp
0x00005555555551b1 <Y+14>: mov %rdi,-0x8(%rbp)
0x00005555555551b5 <Y+18>: mov -0x8(%rbp),%rdx
0x00005555555551b9 <Y+22>: mov -0x8(%rbp),%rax
0x00005555555551bd <Y+26>: mov %rdx,%rsi
0x00005555555551c0 <Y+29>: mov %rax,%rdi
0x00005555555551c3 <Y+32>: callq 0x555555555174 <X>
0x0000555555555174 <X+0>: endbr64
0x0000555555555178 <X+4>: push %rbp
0x0000555555555179 <X+5>: lea (%rsp),%rbp
0x000055555555517d <X+9>: lea -0x10(%rsp),%rsp
0x0000555555555182 <X+14>: mov %rdi,-0x8(%rbp)
0x0000555555555186 <X+18>: mov %rsi,-0x10(%rbp)
0x000055555555518a <X+22>: mov -0x10(%rbp),%rdx
0x000055555555518e <X+26>: mov -0x8(%rbp),%rax
0x0000555555555192 <X+30>: mov %rdx,%rsi
0x0000555555555195 <X+33>: mov %rax,%rdi
0x0000555555555198 <X+36>: callq 0x555555555129 <Simulate>
0x0000555555555129 <Simulate+0>: endbr64
0x000055555555512d <Simulate+4>: push %rbp
0x000055555555512e <Simulate+5>: lea (%rsp),%rbp
0x0000555555555132 <Simulate+9>: lea -0x10(%rsp),%rsp
0x0000555555555137 <Simulate+14>: mov %rdi,-0x8(%rbp)
0x000055555555513b <Simulate+18>: mov %rsi,-0x10(%rbp)
0x000055555555513f <Simulate+22>: mov 0x2f07(%rip),%eax
0x0000555555555145 <Simulate+28>: mov %eax,%edx
0x0000555555555147 <Simulate+30>: add $0x1,%edx
0x000055555555514a <Simulate+33>: mov %edx,0x2efc(%rip)
0x0000555555555150 <Simulate+39>: cltq
0x0000555555555152 <Simulate+41>: lea 0x0(,%rax,8),%rdx
0x000055555555515a <Simulate+49>: lea 0x2ebf(%rip),%rax
0x0000555555555161 <Simulate+56>: mov (%rdx,%rax,1),%rdx
0x0000555555555165 <Simulate+60>: mov -0x10(%rbp),%rax
0x0000555555555169 <Simulate+64>: mov %rax,%rdi
0x000055555555516c <Simulate+67>: callq *%rdx
0x00005555555551a3 <Y+0>: endbr64
0x00005555555551a7 <Y+4>: push %rbp
0x00005555555551a8 <Y+5>: lea (%rsp),%rbp
0x00005555555551ac <Y+9>: lea -0x10(%rsp),%rsp
0x00005555555551b1 <Y+14>: mov %rdi,-0x8(%rbp)
0x00005555555551b5 <Y+18>: mov -0x8(%rbp),%rdx
0x00005555555551b9 <Y+22>: mov -0x8(%rbp),%rax
0x00005555555551bd <Y+26>: mov %rdx,%rsi
0x00005555555551c0 <Y+29>: mov %rax,%rdi
0x00005555555551c3 <Y+32>: callq 0x555555555174 <X>
0x0000555555555174 <X+0>: endbr64
0x0000555555555178 <X+4>: push %rbp
0x0000555555555179 <X+5>: lea (%rsp),%rbp
0x000055555555517d <X+9>: lea -0x10(%rsp),%rsp
0x0000555555555182 <X+14>: mov %rdi,-0x8(%rbp)
0x0000555555555186 <X+18>: mov %rsi,-0x10(%rbp)
0x000055555555518a <X+22>: mov -0x10(%rbp),%rdx
0x000055555555518e <X+26>: mov -0x8(%rbp),%rax
0x0000555555555192 <X+30>: mov %rdx,%rsi
0x0000555555555195 <X+33>: mov %rax,%rdi
0x0000555555555198 <X+36>: callq 0x555555555129 <Simulate>
0x0000555555555129 <Simulate+0>: endbr64
0x000055555555512d <Simulate+4>: push %rbp
0x000055555555512e <Simulate+5>: lea (%rsp),%rbp
0x0000555555555132 <Simulate+9>: lea -0x10(%rsp),%rsp
0x0000555555555137 <Simulate+14>: mov %rdi,-0x8(%rbp)
0x000055555555513b <Simulate+18>: mov %rsi,-0x10(%rbp)
0x000055555555513f <Simulate+22>: mov 0x2f07(%rip),%eax
0x0000555555555145 <Simulate+28>: mov %eax,%edx
0x0000555555555147 <Simulate+30>: add $0x1,%edx
0x000055555555514a <Simulate+33>: mov %edx,0x2efc(%rip)
0x0000555555555150 <Simulate+39>: cltq
0x0000555555555152 <Simulate+41>: lea 0x0(,%rax,8),%rdx
0x000055555555515a <Simulate+49>: lea 0x2ebf(%rip),%rax
0x0000555555555161 <Simulate+56>: mov (%rdx,%rax,1),%rdx
0x0000555555555165 <Simulate+60>: mov -0x10(%rbp),%rax
0x0000555555555169 <Simulate+64>: mov %rax,%rdi
0x000055555555516c <Simulate+67>: callq *%rdx
0x00005555555551a3 <Y+0>: endbr64
0x00005555555551a7 <Y+4>: push %rbp
0x00005555555551a8 <Y+5>: lea (%rsp),%rbp
0x00005555555551ac <Y+9>: lea -0x10(%rsp),%rsp
0x00005555555551b1 <Y+14>: mov %rdi,-0x8(%rbp)
0x00005555555551b5 <Y+18>: mov -0x8(%rbp),%rdx
0x00005555555551b9 <Y+22>: mov -0x8(%rbp),%rax
0x00005555555551bd <Y+26>: mov %rdx,%rsi
0x00005555555551c0 <Y+29>: mov %rax,%rdi
0x00005555555551c3 <Y+32>: callq 0x555555555174 <X>
0x0000555555555174 <X+0>: endbr64
0x0000555555555178 <X+4>: push %rbp
0x0000555555555179 <X+5>: lea (%rsp),%rbp
0x000055555555517d <X+9>: lea -0x10(%rsp),%rsp
0x0000555555555182 <X+14>: mov %rdi,-0x8(%rbp)
0x0000555555555186 <X+18>: mov %rsi,-0x10(%rbp)
0x000055555555518a <X+22>: mov -0x10(%rbp),%rdx
0x000055555555518e <X+26>: mov -0x8(%rbp),%rax
0x0000555555555192 <X+30>: mov %rdx,%rsi
0x0000555555555195 <X+33>: mov %rax,%rdi
0x0000555555555198 <X+36>: callq 0x555555555129 <Simulate>
0x0000555555555129 <Simulate+0>: endbr64
0x000055555555512d <Simulate+4>: push %rbp
0x000055555555512e <Simulate+5>: lea (%rsp),%rbp
0x0000555555555132 <Simulate+9>: lea -0x10(%rsp),%rsp
0x0000555555555137 <Simulate+14>: mov %rdi,-0x8(%rbp)
0x000055555555513b <Simulate+18>: mov %rsi,-0x10(%rbp)
0x000055555555513f <Simulate+22>: mov 0x2f07(%rip),%eax
0x0000555555555145 <Simulate+28>: mov %eax,%edx
0x0000555555555147 <Simulate+30>: add $0x1,%edx
0x000055555555514a <Simulate+33>: mov %edx,0x2efc(%rip)
0x0000555555555150 <Simulate+39>: cltq
0x0000555555555152 <Simulate+41>: lea 0x0(,%rax,8),%rdx
0x000055555555515a <Simulate+49>: lea 0x2ebf(%rip),%rax
0x0000555555555161 <Simulate+56>: mov (%rdx,%rax,1),%rdx
0x0000555555555165 <Simulate+60>: mov -0x10(%rbp),%rax
0x0000555555555169 <Simulate+64>: mov %rax,%rdi
0x000055555555516c <Simulate+67>: callq *%rdx
0x00005555555551a3 <Y+0>: endbr64
0x00005555555551a7 <Y+4>: push %rbp
0x00005555555551a8 <Y+5>: lea (%rsp),%rbp
0x00005555555551ac <Y+9>: lea -0x10(%rsp),%rsp
0x00005555555551b1 <Y+14>: mov %rdi,-0x8(%rbp)
0x00005555555551b5 <Y+18>: mov -0x8(%rbp),%rdx
0x00005555555551b9 <Y+22>: mov -0x8(%rbp),%rax
0x00005555555551bd <Y+26>: mov %rdx,%rsi
0x00005555555551c0 <Y+29>: mov %rax,%rdi
0x00005555555551c3 <Y+32>: callq 0x555555555174 <X>
0x0000555555555174 <X+0>: endbr64
0x0000555555555178 <X+4>: push %rbp
0x0000555555555179 <X+5>: lea (%rsp),%rbp
0x000055555555517d <X+9>: lea -0x10(%rsp),%rsp
0x0000555555555182 <X+14>: mov %rdi,-0x8(%rbp)
0x0000555555555186 <X+18>: mov %rsi,-0x10(%rbp)
0x000055555555518a <X+22>: mov -0x10(%rbp),%rdx
0x000055555555518e <X+26>: mov -0x8(%rbp),%rax
0x0000555555555192 <X+30>: mov %rdx,%rsi
0x0000555555555195 <X+33>: mov %rax,%rdi
0x0000555555555198 <X+36>: callq 0x555555555129 <Simulate>
0x0000555555555129 <Simulate+0>: endbr64
0x000055555555512d <Simulate+4>: push %rbp
0x000055555555512e <Simulate+5>: lea (%rsp),%rbp
0x0000555555555132 <Simulate+9>: lea -0x10(%rsp),%rsp
0x0000555555555137 <Simulate+14>: mov %rdi,-0x8(%rbp)
0x000055555555513b <Simulate+18>: mov %rsi,-0x10(%rbp)
0x000055555555513f <Simulate+22>: mov 0x2f07(%rip),%eax
0x0000555555555145 <Simulate+28>: mov %eax,%edx
0x0000555555555147 <Simulate+30>: add $0x1,%edx
0x000055555555514a <Simulate+33>: mov %edx,0x2efc(%rip)
0x0000555555555150 <Simulate+39>: cltq
0x0000555555555152 <Simulate+41>: lea 0x0(,%rax,8),%rdx
0x000055555555515a <Simulate+49>: lea 0x2ebf(%rip),%rax
0x0000555555555161 <Simulate+56>: mov (%rdx,%rax,1),%rdx
0x0000555555555165 <Simulate+60>: mov -0x10(%rbp),%rax
0x0000555555555169 <Simulate+64>: mov %rax,%rdi
0x000055555555516c <Simulate+67>: callq *%rdx
...
--
Ben.
[toc] | [prev] | [next] | [standalone]
| From | olcott <NoOne@NoWhere.com> |
|---|---|
| Date | 2021-04-17 21:16 -0500 |
| Subject | Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) |
| Message-ID | <2_ydnfCeYecbC-b9nZ2dnUU7-YPNnZ2d@giganews.com> |
| In reply to | #31303 |
On 4/17/2021 9:08 PM, Ben Bacarisse wrote:
> olcott <NoOne@NoWhere.com> writes:
>
>> On 4/17/2021 9:17 AM, olcott wrote:
>>> If a function X() is called by function Y() twice in sequence from the same machine address of Y() with the same parameters to X() and the execution trace shows no conditional branch instructions in Y() or function call returns in X() then the function call from Y() to X() is infinitely recursive unless X() stops it.
>>>
>>> The referenced execution trace is on x86 machine language, disassembled for human consumption.
>>>
>>
>> void X(u32 P, i32 I)
>> {
>> Simulate(P, I);
>> }
>>
>> void Y(u32 P)
>> {
>> X(P, P);
>> }
>>
>> int main()
>> {
>> X((u32)Y, (u32)Y);
>> }
>>
>>
>> If the execution trace of function X() called by function Y() shows:
>> (1) Function X() is called twice in sequence from the same machine address of Y().
>> (2) With the same parameters to X().
>> (3) With no conditional branch or indexed jump instructions in Y().
>> (4) With no function call returns from X().
>> then the function call from Y() to X() is infinitely recursive unless
>> X() stops it.
>
> Can you tell if this is or is not infinite recursion:
>
I cannot afford to expend energy in fruitless paths. Either you can show
me your counter example in Intel x86 or I will simply tentatively
dismiss it.
If you can explain its basic process I might be able to envision the x86
of that. For the time being is it simply gibberish to me.
--
Copyright 2021 Pete Olcott
"Great spirits have always encountered violent opposition from mediocre
minds." Einstein
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2021-04-18 21:56 +0100 |
| Subject | Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) |
| Message-ID | <87lf9f5n1k.fsf@bsb.me.uk> |
| In reply to | #31306 |
olcott <NoOne@NoWhere.com> writes: > On 4/17/2021 9:08 PM, Ben Bacarisse wrote: >> Can you tell if this is or is not infinite recursion: >> > I cannot afford to expend energy in fruitless paths. You don't know it's fruitless! As it happens, apart form the fun you get from boasting and felling "listened to" here, everything you've done on halting is fruitless. What has any of it gained you? > If you can explain its basic process I might be able to envision the > x86 of that. For the time being is it simply gibberish to me. Extraordinary. If I didn't think it was just a ploy to avoid looking, I'd be shocked that you think it would take more than a few moments to understand that nothing mysterious is going on. Anyway, your job is done. You can ignore this trace. -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | olcott <NoOne@NoWhere.com> |
|---|---|
| Date | 2021-04-18 16:08 -0500 |
| Subject | Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) |
| Message-ID | <vuudnbAGxpgyAuH9nZ2dnUU7-Y3NnZ2d@giganews.com> |
| In reply to | #31368 |
On 4/18/2021 3:56 PM, Ben Bacarisse wrote: > olcott <NoOne@NoWhere.com> writes: > >> On 4/17/2021 9:08 PM, Ben Bacarisse wrote: >>> Can you tell if this is or is not infinite recursion: >>> >> I cannot afford to expend energy in fruitless paths. > > You don't know it's fruitless! As it happens, apart form the fun you > get from boasting and felling "listened to" here, everything you've done > on halting is fruitless. What has any of it gained you? > I studied until I understood it and the dismissed the x64 architecture on the basis that it is not needed for my proof. >> If you can explain its basic process I might be able to envision the >> x86 of that. For the time being is it simply gibberish to me. > > Extraordinary. If I didn't think it was just a ploy to avoid looking, > I'd be shocked that you think it would take more than a few moments to > understand that nothing mysterious is going on. > > Anyway, your job is done. You can ignore this trace. > It took me more that a few minutes to understand that the AT&T operand order is reversed. Then I discovered that the RIP relative addressing was used like a jump table when a value was assigned to the RIP register. -- Copyright 2021 Pete Olcott "Great spirits have always encountered violent opposition from mediocre minds." Einstein
[toc] | [prev] | [next] | [standalone]
| From | "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> |
|---|---|
| Date | 2021-04-18 14:21 -0700 |
| Subject | Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) |
| Message-ID | <s5i7sb$37k$1@gioia.aioe.org> |
| In reply to | #31373 |
On 4/18/2021 2:08 PM, olcott wrote: > On 4/18/2021 3:56 PM, Ben Bacarisse wrote: >> olcott <NoOne@NoWhere.com> writes: >> >>> On 4/17/2021 9:08 PM, Ben Bacarisse wrote: >>>> Can you tell if this is or is not infinite recursion: >>>> >>> I cannot afford to expend energy in fruitless paths. >> >> You don't know it's fruitless! As it happens, apart form the fun you >> get from boasting and felling "listened to" here, everything you've done >> on halting is fruitless. What has any of it gained you? >> > > I studied until I understood it and the dismissed the x64 architecture > on the basis that it is not needed for my proof. You seem fond of dismissing things that you don't understand. So, your x86 emulator can handle the cmpxchg instruction and the lock prefix right? What about the xadd instruction? > >>> If you can explain its basic process I might be able to envision the >>> x86 of that. For the time being is it simply gibberish to me. >> >> Extraordinary. If I didn't think it was just a ploy to avoid looking, >> I'd be shocked that you think it would take more than a few moments to >> understand that nothing mysterious is going on. >> >> Anyway, your job is done. You can ignore this trace. >> > > It took me more that a few minutes to understand that the AT&T operand > order is reversed. Then I discovered that the RIP relative addressing > was used like a jump table when a value was assigned to the RIP register. > >
[toc] | [prev] | [next] | [standalone]
| From | "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> |
|---|---|
| Date | 2021-04-18 14:22 -0700 |
| Subject | Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) |
| Message-ID | <s5i7v1$37k$2@gioia.aioe.org> |
| In reply to | #31373 |
On 4/18/2021 2:08 PM, olcott wrote: > On 4/18/2021 3:56 PM, Ben Bacarisse wrote: >> olcott <NoOne@NoWhere.com> writes: >> >>> On 4/17/2021 9:08 PM, Ben Bacarisse wrote: >>>> Can you tell if this is or is not infinite recursion: >>>> >>> I cannot afford to expend energy in fruitless paths. >> >> You don't know it's fruitless! As it happens, apart form the fun you >> get from boasting and felling "listened to" here, everything you've done >> on halting is fruitless. What has any of it gained you? >> > > I studied until I understood it and the dismissed the x64 architecture > on the basis that it is not needed for my proof. Why is x86 needed for your proof? > >>> If you can explain its basic process I might be able to envision the >>> x86 of that. For the time being is it simply gibberish to me. >> >> Extraordinary. If I didn't think it was just a ploy to avoid looking, >> I'd be shocked that you think it would take more than a few moments to >> understand that nothing mysterious is going on. >> >> Anyway, your job is done. You can ignore this trace. >> > > It took me more that a few minutes to understand that the AT&T operand > order is reversed. Then I discovered that the RIP relative addressing > was used like a jump table when a value was assigned to the RIP register. > >
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2021-04-19 01:11 +0100 |
| Subject | Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) |
| Message-ID | <87tuo32kwe.fsf@bsb.me.uk> |
| In reply to | #31373 |
olcott <NoOne@NoWhere.com> writes: > It took me more that a few minutes to understand that the AT&T operand > order is reversed. Then I discovered that the RIP relative addressing > was used like a jump table when a value was assigned to the RIP > register. RIP is a red-herring. The code is compiled from standard C. If I compile it for the 32-bit architecture, no IP relative addressing is used, but the pattern of calls remains the same. -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | olcott <NoOne@NoWhere.com> |
|---|---|
| Date | 2021-04-18 19:32 -0500 |
| Subject | Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) |
| Message-ID | <bL-dnbVmEtoJUuH9nZ2dnUU7-YfNnZ2d@giganews.com> |
| In reply to | #31405 |
On 4/18/2021 7:11 PM, Ben Bacarisse wrote: > olcott <NoOne@NoWhere.com> writes: > >> It took me more that a few minutes to understand that the AT&T operand >> order is reversed. Then I discovered that the RIP relative addressing >> was used like a jump table when a value was assigned to the RIP >> register. > > RIP is a red-herring. The code is compiled from standard C. If I > compile it for the 32-bit architecture, no IP relative addressing is > used, but the pattern of calls remains the same. > 0x000055555555517d <main+0>: endbr64 0x0000555555555181 <main+4>: push %rbp 0x0000555555555182 <main+5>: mov %rsp,%rbp 0x0000555555555185 <main+8>: callq 0x555555555129 <Y> 0x0000555555555129 <Y+0>: endbr64 0x000055555555512d <Y+4>: push %rbp 0x000055555555512e <Y+5>: mov %rsp,%rbp 0x0000555555555131 <Y+8>: mov 0x2f15(%rip),%eax 0x0000555555555137 <Y+14>: lea 0x1(%rax),%edx 0x000055555555513a <Y+17>: mov %edx,0x2f0c(%rip) The above instruction moves the contents of the edx register into an offset relative to the rip (instruction pointer register). This could easily make self-modifying code. -- Copyright 2021 Pete Olcott "Great spirits have always encountered violent opposition from mediocre minds." Einstein
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2021-04-19 01:38 +0100 |
| Subject | Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) |
| Message-ID | <877dkz2jmt.fsf@bsb.me.uk> |
| In reply to | #31408 |
olcott <NoOne@NoWhere.com> writes: > On 4/18/2021 7:11 PM, Ben Bacarisse wrote: >> olcott <NoOne@NoWhere.com> writes: >> >>> It took me more that a few minutes to understand that the AT&T operand >>> order is reversed. Then I discovered that the RIP relative addressing >>> was used like a jump table when a value was assigned to the RIP >>> register. >> >> RIP is a red-herring. The code is compiled from standard C. If I >> compile it for the 32-bit architecture, no IP relative addressing is >> used, but the pattern of calls remains the same. > > 0x000055555555517d <main+0>: endbr64 > 0x0000555555555181 <main+4>: push %rbp > 0x0000555555555182 <main+5>: mov %rsp,%rbp > 0x0000555555555185 <main+8>: callq 0x555555555129 <Y> > 0x0000555555555129 <Y+0>: endbr64 > 0x000055555555512d <Y+4>: push %rbp > 0x000055555555512e <Y+5>: mov %rsp,%rbp > 0x0000555555555131 <Y+8>: mov 0x2f15(%rip),%eax > 0x0000555555555137 <Y+14>: lea 0x1(%rax),%edx > 0x000055555555513a <Y+17>: mov %edx,0x2f0c(%rip) > > The above instruction moves the contents of the edx register into an > offset relative to the rip (instruction pointer register). This could > easily make self-modifying code. However it does not. RIP is a red-herring. The code is compiled from standard C. If I compile it for the 32-bit architecture, no IP relative addressing is used, but the pattern of calls remains the same. -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | olcott <NoOne@NoWhere.com> |
|---|---|
| Date | 2021-04-18 19:52 -0500 |
| Subject | Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) |
| Message-ID | <bsadnbvY6KHJSeH9nZ2dnUU7-fWdnZ2d@giganews.com> |
| In reply to | #31409 |
On 4/18/2021 7:38 PM, Ben Bacarisse wrote: > olcott <NoOne@NoWhere.com> writes: > >> On 4/18/2021 7:11 PM, Ben Bacarisse wrote: >>> olcott <NoOne@NoWhere.com> writes: >>> >>>> It took me more that a few minutes to understand that the AT&T operand >>>> order is reversed. Then I discovered that the RIP relative addressing >>>> was used like a jump table when a value was assigned to the RIP >>>> register. >>> >>> RIP is a red-herring. The code is compiled from standard C. If I >>> compile it for the 32-bit architecture, no IP relative addressing is >>> used, but the pattern of calls remains the same. >> >> 0x000055555555517d <main+0>: endbr64 >> 0x0000555555555181 <main+4>: push %rbp >> 0x0000555555555182 <main+5>: mov %rsp,%rbp >> 0x0000555555555185 <main+8>: callq 0x555555555129 <Y> >> 0x0000555555555129 <Y+0>: endbr64 >> 0x000055555555512d <Y+4>: push %rbp >> 0x000055555555512e <Y+5>: mov %rsp,%rbp >> 0x0000555555555131 <Y+8>: mov 0x2f15(%rip),%eax >> 0x0000555555555137 <Y+14>: lea 0x1(%rax),%edx >> 0x000055555555513a <Y+17>: mov %edx,0x2f0c(%rip) >> >> The above instruction moves the contents of the edx register into an >> offset relative to the rip (instruction pointer register). This could >> easily make self-modifying code. > > However it does not. RIP is a red-herring. The code is compiled from > standard C. If I compile it for the 32-bit architecture, no IP relative > addressing is used, but the pattern of calls remains the same. > THIS IS RIP RELATIVE ADDRESSING >> 0x000055555555513a <Y+17>: mov %edx,0x2f0c(%rip) -- Copyright 2021 Pete Olcott "Great spirits have always encountered violent opposition from mediocre minds." Einstein
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2021-04-19 02:10 +0100 |
| Subject | Re: Infinite recursion detection criteria (Please correct me if I am wrong)(update) |
| Message-ID | <871rb72i5h.fsf@bsb.me.uk> |
| In reply to | #31412 |
olcott <NoOne@NoWhere.com> writes: > On 4/18/2021 7:38 PM, Ben Bacarisse wrote: >> olcott <NoOne@NoWhere.com> writes: >> >>> On 4/18/2021 7:11 PM, Ben Bacarisse wrote: >>>> olcott <NoOne@NoWhere.com> writes: >>>> >>>>> It took me more that a few minutes to understand that the AT&T operand >>>>> order is reversed. Then I discovered that the RIP relative addressing >>>>> was used like a jump table when a value was assigned to the RIP >>>>> register. >>>> >>>> RIP is a red-herring. The code is compiled from standard C. If I >>>> compile it for the 32-bit architecture, no IP relative addressing is >>>> used, but the pattern of calls remains the same. >>> >>> 0x000055555555517d <main+0>: endbr64 >>> 0x0000555555555181 <main+4>: push %rbp >>> 0x0000555555555182 <main+5>: mov %rsp,%rbp >>> 0x0000555555555185 <main+8>: callq 0x555555555129 <Y> >>> 0x0000555555555129 <Y+0>: endbr64 >>> 0x000055555555512d <Y+4>: push %rbp >>> 0x000055555555512e <Y+5>: mov %rsp,%rbp >>> 0x0000555555555131 <Y+8>: mov 0x2f15(%rip),%eax >>> 0x0000555555555137 <Y+14>: lea 0x1(%rax),%edx >>> 0x000055555555513a <Y+17>: mov %edx,0x2f0c(%rip) >>> >>> The above instruction moves the contents of the edx register into an >>> offset relative to the rip (instruction pointer register). This could >>> easily make self-modifying code. >> >> However it does not. RIP is a red-herring. The code is compiled from >> standard C. If I compile it for the 32-bit architecture, no IP relative >> addressing is used, but the pattern of calls remains the same. >> > > THIS IS RIP RELATIVE ADDRESSING >>> 0x000055555555513a <Y+17>: mov %edx,0x2f0c(%rip) Yes but RIP is a red-herring. The code is compiled from standard C. If I compile it for the 32-bit architecture, no IP relative addressing is used, but the pattern of calls remains the same. -- Ben.
[toc] | [prev] | [next] | [standalone]
Page 1 of 2 [1] 2 Next page →
Back to top | Article view | comp.theory
csiph-web