Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IronPython 2.7.9 strange issue on mono 5.16 #11489

Closed
equiclouds opened this issue Oct 31, 2018 · 11 comments

Comments

@equiclouds
Copy link

@equiclouds equiclouds commented Oct 31, 2018

I installed ironpython 2.7.9 on rasperberry pi, and code bellow:

class test:
    def extend(self, a, *b):
        return a, b
def main():
    c1 = test().extend({},{})
    for i in range(0,100):
        c2 = test().extend({},{})
        if c1!=c2:
            print(i,c1,c2)
            return
main()

Randomly, after some times, the extend function b paramters will be valued with test() object...

root@raspberrypi:/tmp/tmp# ipy test.ipy 
(39, ({}, ({},)), ({}, <__main__.test instance at 0x000000000000006C>))
root@raspberrypi:/tmp/tmp# ipy test.ipy 
(82, ({}, ({},)), ({}, <__main__.test instance at 0x000000000000006C>))

The result above means after call test().extend fuctions 39 or 82 times, the test instance will pass to *b paremeter. While the code return None on X86 Devices.

Is mono compile differences for ARM and X86 caused the issue?

@marek-safar

This comment has been minimized.

Copy link
Member

@marek-safar marek-safar commented Oct 31, 2018

What ARM is this and could you reproduce the issue it with previous Mono versions?

@equiclouds

This comment has been minimized.

Copy link
Author

@equiclouds equiclouds commented Oct 31, 2018

@marek-safar My platform is RASPBERRY PI DESKTOP run on RASPBERRY PI 3B+:

Linux raspberrypi 4.14.71-v7+ #1145 SMP Fri Sep 21 15:38:35 BST 2018 armv7l GNU/Linux

I haven't test the code on previous Mono versions yet.

@equiclouds

This comment has been minimized.

Copy link
Author

@equiclouds equiclouds commented Nov 1, 2018

@marek-safar My platform is RASPBERRY PI DESKTOP run on RASPBERRY PI 3B+, and I can't reproduce the issue it with mono 5.12.

@lewurm

This comment has been minimized.

Copy link
Member

@lewurm lewurm commented Nov 5, 2018

@equiclouds with what mono version do you see this problem? could you try export MONO_ENV_OPTIONS='-O=-aot' and run your example code again?

@lewurm lewurm added this to Bugs Pool in Bugs Week via automation Nov 5, 2018
@lewurm

This comment has been minimized.

Copy link
Member

@lewurm lewurm commented Nov 6, 2018

I can reproduce with current master on armv7 (armhf). suggested workaround from my previous comment does not work. will investigate

@lewurm lewurm self-assigned this Nov 6, 2018
@lewurm

This comment has been minimized.

Copy link
Member

@lewurm lewurm commented Nov 6, 2018

As a workaround: MONO_ENV_OPTIONS=--interp works, but it's significant slower.

@lewurm

This comment has been minimized.

Copy link
Member

@lewurm lewurm commented Nov 6, 2018

diff --git a/mono/mini/mini-arm.c b/mono/mini/mini-arm.c
index b44ecd7..9f98aa7 100644
--- a/mono/mini/mini-arm.c
+++ b/mono/mini/mini-arm.c
@@ -1814,6 +1814,8 @@ mono_arch_tailcall_supported (MonoCompile *cfg, MonoMethodSignature *caller_sig,
        g_assert (caller_sig);
        g_assert (callee_sig);
 
+       return FALSE;
+
        CallInfo *caller_info = get_call_info (NULL, caller_sig);
        CallInfo *callee_info = get_call_info (NULL, callee_sig);

makes it work. @jaykrell this looks like a problem around tail calls.

@lewurm lewurm removed their assignment Nov 6, 2018
@marek-safar

This comment has been minimized.

Copy link
Member

@marek-safar marek-safar commented Nov 20, 2018

@jaykrell are you aware of this regression?

/cc @luhenry

@jaykrell

This comment has been minimized.

Copy link
Collaborator

@jaykrell jaykrell commented Dec 4, 2018

I reproduced the problem, on armhf, on a builder.

@jaykrell

This comment has been minimized.

Copy link
Collaborator

@jaykrell jaykrell commented Dec 6, 2018

Strange that it requires the loop and doesn't repro at the same loop iteration every time.

@lewurm

This comment has been minimized.

Copy link
Member

@lewurm lewurm commented Dec 6, 2018

@jaykrell run with -v, you will see that right before the crash some method will be compiled. I assume IronPython rewrites the AST or something during execution.

jaykrell added a commit to jaykrell/mono that referenced this issue Dec 14, 2018
This is a simple optimization.

- When moving parameters for tailcall, and having pushed ip,
and adjusting the offset to account for that, split the adjustment
between sp and frame pointer, as frame pointer may or may not be sp.
This fixes mono#11489.
jaykrell added a commit to jaykrell/mono that referenced this issue Dec 15, 2018
This is a simple optimization.

- When moving parameters for tailcall, and having pushed ip,
and adjusting the offset to account for that, split the adjustment
between sp and frame pointer, as frame pointer may or may not be sp.
This fixes mono#11489.
@marek-safar marek-safar removed this from Bugs Pool in Bugs Week Dec 17, 2018
jaykrell added a commit to jaykrell/mono that referenced this issue Dec 27, 2018
This is a simple optimization.

- When moving parameters for tailcall, and having pushed ip,
and adjusting the offset to account for that, split the adjustment
between sp and frame pointer, as frame pointer may or may not be sp.
This fixes mono#11489.
jaykrell added a commit to jaykrell/mono that referenced this issue Dec 28, 2018
This is a simple optimization.

- When moving parameters for tailcall, and having pushed ip,
and adjusting the offset to account for that, split the adjustment
between sp and frame pointer, as frame pointer may or may not be sp.
This fixes mono#11489.
jaykrell added a commit to jaykrell/mono that referenced this issue Dec 28, 2018
This is a simple optimization.

- When moving parameters for tailcall, and having pushed ip,
and adjusting the offset to account for that, split the adjustment
between sp and frame pointer, as frame pointer may or may not be sp.
This fixes mono#11489.
jaykrell added a commit to jaykrell/mono that referenced this issue Jan 4, 2019
This is a simple optimization.

- When moving parameters for tailcall, and having pushed ip,
and adjusting the offset to account for that, split the adjustment
between sp and frame pointer, as frame pointer may or may not be sp.
This fixes mono#11489.
jaykrell added a commit to jaykrell/mono that referenced this issue Jan 6, 2019
This is a simple optimization.

- When moving parameters for tailcall, and having pushed ip,
and adjusting the offset to account for that, split the adjustment
between sp and frame pointer, as frame pointer may or may not be sp.
This fixes mono#11489.
thaystg added a commit to thaystg/mono that referenced this issue Jan 30, 2019
…ng the offset to account for that, split the adjustment between sp and frame pointer, as frame pointer may or may not be sp.

Fixes mono#11489
Based on PR mono#12070 of JayKrell.
thaystg added a commit to thaystg/mono that referenced this issue Jan 31, 2019
…ARMREG_IP and after that get destination in ARMREG_IP, then it's not necessary the PUSH and POP to SP nor the saved_ip_offset.

Fixes mono#11489
marek-safar added a commit that referenced this issue Feb 1, 2019
* When moving parameters for tailcall, first copy the parameters using ARMREG_IP and after that get destination in ARMREG_IP, then it's not necessary the PUSH and POP to SP nor the saved_ip_offset.
Fixes #11489

* Removing unused variable.
monojenkins added a commit to monojenkins/mono that referenced this issue Feb 1, 2019
…ARMREG_IP and after that get destination in ARMREG_IP, then it's not necessary the PUSH and POP to SP nor the saved_ip_offset. Fixes mono#11489
thaystg added a commit that referenced this issue Feb 1, 2019
)

* When moving parameters for tailcall, first copy the parameters using ARMREG_IP and after that get destination in ARMREG_IP, then it's not necessary the PUSH and POP to SP nor the saved_ip_offset. Fixes #11489

* Removing unused variable.
thaystg added a commit to thaystg/mono that referenced this issue Feb 4, 2019
* When moving parameters for tailcall, first copy the parameters using ARMREG_IP and after that get destination in ARMREG_IP, then it's not necessary the PUSH and POP to SP nor the saved_ip_offset.
Fixes mono#11489
luhenry added a commit that referenced this issue Feb 4, 2019
* When moving parameters for tailcall, first copy the parameters using ARMREG_IP and after that get destination in ARMREG_IP, then it's not necessary the PUSH and POP to SP nor the saved_ip_offset.
Fixes #11489
jaykrell added a commit to jaykrell/mono that referenced this issue Apr 23, 2019
This is a simple optimization.

- When moving parameters for tailcall, and having pushed ip,
and adjusting the offset to account for that, split the adjustment
between sp and frame pointer, as frame pointer may or may not be sp.
This fixes mono#11489.
jaykrell added a commit to jaykrell/mono that referenced this issue Apr 23, 2019
This is a simple optimization.

- When moving parameters for tailcall, and having pushed ip,
and adjusting the offset to account for that, split the adjustment
between sp and frame pointer, as frame pointer may or may not be sp.
This fixes mono#11489.
jaykrell added a commit to jaykrell/mono that referenced this issue Apr 23, 2019
and adjusting the offset to account for that, split the adjustment
between sp and frame pointer, as frame pointer may or may not be sp.
This fixes mono#11489.
jaykrell added a commit to jaykrell/mono that referenced this issue Apr 23, 2019
and adjusting the offset to account for that, split the adjustment
between sp and frame pointer, as frame pointer may or may not be sp.
This fixes mono#11489.
jaykrell added a commit to jaykrell/mono that referenced this issue Apr 23, 2019
and adjusting the offset to account for that, split the adjustment
between sp and frame pointer, as frame pointer may or may not be sp.
This fixes mono#11489.
jaykrell added a commit to jaykrell/mono that referenced this issue Apr 23, 2019
and adjusting the offset to account for that, split the adjustment
between sp and frame pointer, as frame pointer may or may not be sp.
This fixes mono#11489.
jaykrell added a commit to jaykrell/mono that referenced this issue Apr 23, 2019
and adjusting the offset to account for that, split the adjustment
between sp and frame pointer, as frame pointer may or may not be sp.
This fixes mono#11489.
jonpryor added a commit to xamarin/xamarin-android that referenced this issue Apr 24, 2019
Bumps to mono/api-snapshot@ae01378
Bumps to mono/reference-assemblies@e5173a5
Bumps to mono/bockbuild@d30329d
Bumps to mono/boringssl@3d87996
Bumps to mono/corefx@72f7d76
Bumps to mono/corert@1b7d4a1
Bumps to mono/helix-binaries@7e893ea
Bumps to mono/illinker-test-assets@f21ff68
Bumps to mono/linker@13d864e
Bumps to mono/llvm@1aaaaa5 [mono]
Bumps to mono/llvm@2c2cffe [xamarin-android]
Bumps to mono/NUnitLite@0029561
Bumps to mono/roslyn-binaries@0bbc9b4
Bumps to mono/xunit-binaries@8f6e62e

	$ git diff --shortstat 886c4901..e66c7667      # mono
        3597 files changed, 350850 insertions(+), 91128 deletions(-)
	$ git diff --shortstat 349752c464c5fc93b32e7d45825f2890c85c8b7d..2c2cffedf01e0fe266b9aaad2c2563e05b750ff4
	 240 files changed, 18562 insertions(+), 6581 deletions(-)

Context: dotnet/coreclr#22046

Fixes: CVE 2018-8292 on macOS
Fixes: http://work.devdiv.io/737323
Fixes: dotnet/corefx#33965
Fixes: dotnet/standard#642
Fixes: mono/mono#6997
Fixes: mono/mono#7326
Fixes: mono/mono#7517
Fixes: mono/mono#7750
Fixes: mono/mono#7859
Fixes: mono/mono#8360
Fixes: mono/mono#8460
Fixes: mono/mono#8766
Fixes: mono/mono#8922
Fixes: mono/mono#9418
Fixes: mono/mono#9507
Fixes: mono/mono#9951
Fixes: mono/mono#10024
Fixes: mono/mono#10030
Fixes: mono/mono#10038
Fixes: mono/mono#10448
Fixes: mono/mono#10735
Fixes: mono/mono#10735
Fixes: mono/mono#10737
Fixes: mono/mono#10743
Fixes: mono/mono#10834
Fixes: mono/mono#10837
Fixes: mono/mono#10838
Fixes: mono/mono#10863
Fixes: mono/mono#10945
Fixes: mono/mono#11020
Fixes: mono/mono#11021
Fixes: mono/mono#11021
Fixes: mono/mono#11049
Fixes: mono/mono#11091
Fixes: mono/mono#11095
Fixes: mono/mono#11123
Fixes: mono/mono#11138
Fixes: mono/mono#11146
Fixes: mono/mono#11202
Fixes: mono/mono#11214
Fixes: mono/mono#11317
Fixes: mono/mono#11326
Fixes: mono/mono#11378
Fixes: mono/mono#11385
Fixes: mono/mono#11478
Fixes: mono/mono#11479
Fixes: mono/mono#11488
Fixes: mono/mono#11489
Fixes: mono/mono#11527
Fixes: mono/mono#11529
Fixes: mono/mono#11596
Fixes: mono/mono#11603
Fixes: mono/mono#11613
Fixes: mono/mono#11623
Fixes: mono/mono#11663
Fixes: mono/mono#11681
Fixes: mono/mono#11684
Fixes: mono/mono#11693
Fixes: mono/mono#11697
Fixes: mono/mono#11779
Fixes: mono/mono#11809
Fixes: mono/mono#11858
Fixes: mono/mono#11895
Fixes: mono/mono#11898
Fixes: mono/mono#11898
Fixes: mono/mono#11965
Fixes: mono/mono#12182
Fixes: mono/mono#12193
Fixes: mono/mono#12218
Fixes: mono/mono#12235
Fixes: mono/mono#12263
Fixes: mono/mono#12307
Fixes: mono/mono#12331
Fixes: mono/mono#12362
Fixes: mono/mono#12374
Fixes: mono/mono#12402
Fixes: mono/mono#12421
Fixes: mono/mono#12461
Fixes: mono/mono#12479
Fixes: mono/mono#12479
Fixes: mono/mono#12552
Fixes: mono/mono#12603
Fixes: mono/mono#12747
Fixes: mono/mono#12831
Fixes: mono/mono#12843
Fixes: mono/mono#12881
Fixes: mono/mono#13030
Fixes: mono/mono#13284
Fixes: mono/mono#13297
Fixes: mono/mono#13455
Fixes: mono/mono#13460
Fixes: mono/mono#13478
Fixes: mono/mono#13479
Fixes: mono/mono#13522
Fixes: mono/mono#13607
Fixes: mono/mono#13610
Fixes: mono/mono#13610
Fixes: mono/mono#13639
Fixes: mono/mono#13672
Fixes: mono/mono#13834
Fixes: mono/mono#13878
Fixes: mono/mono#6352
Fixes: mono/monodevelop#6898
Fixes: xamarin/maccore#1069
Fixes: xamarin/maccore#1407
Fixes: xamarin/maccore#604
Fixes: xamarin/xamarin-macios#4984
Fixes: xamarin/xamarin-macios#5289
Fixes: xamarin/xamarin-macios#5363
Fixes: xamarin/xamarin-macios#5381
Fixes: https://issuetracker.unity3d.com/issues/editor-crashes-with-g-logv-when-entering-play-mode-with-active-flowcanvas-script
directhex added a commit that referenced this issue Apr 25, 2019
* Revert "[Tailcall] [arm] [jit] Fix moving tailcall parameters. (#12701)"

This reverts commit 257efc6.

* When moving parameters for tailcall, and having pushed ip,
and adjusting the offset to account for that, split the adjustment
between sp and frame pointer, as frame pointer may or may not be sp.
This fixes #11489.
monojenkins added a commit to monojenkins/mono that referenced this issue Apr 25, 2019
…ing the offset to account for that, split the adjustment between sp and frame pointer, as frame pointer may or may not be sp. This fixes mono#11489.
monojenkins added a commit to monojenkins/mono that referenced this issue Apr 25, 2019
…ing the offset to account for that, split the adjustment between sp and frame pointer, as frame pointer may or may not be sp. This fixes mono#11489.
directhex added a commit that referenced this issue Apr 26, 2019
* When moving parameters for tailcall, and having pushed ip, and adjusting the offset to account for that, split the adjustment between sp and frame pointer, as frame pointer may or may not be sp. This fixes #11489.

* Revert "[Tailcall] [arm] [jit] Fix moving tailcall parameters. (#12701)"

This reverts commit 257efc6.
directhex added a commit that referenced this issue Apr 26, 2019
* When moving parameters for tailcall, and having pushed ip, and adjusting the offset to account for that, split the adjustment between sp and frame pointer, as frame pointer may or may not be sp. This fixes #11489.

* Revert "[Tailcall] [arm] [jit] Fix moving tailcall parameters. (#12701)"

This reverts commit 257efc6.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.