https://bugs.winehq.org/show_bug.cgi?id=38470
Bug ID: 38470 Summary: __chkstk not implemented on ARM Product: Wine Version: 1.7.41 Hardware: arm OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: kernel32 Assignee: wine-bugs@winehq.org Reporter: mmediouni@gmx.fr Distribution: ---
Notepad++ crashes even before displaying the GUI due to this
https://bugs.winehq.org/show_bug.cgi?id=38470
Michael Müller michael@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |michael@fds-team.de
--- Comment #1 from Michael Müller michael@fds-team.de --- Where did you download Notepad++? The version from http://forum.xda-developers.com/showthread.php?t=2556112 works for me.
https://bugs.winehq.org/show_bug.cgi?id=38470
--- Comment #2 from MY123 mmediouni@gmx.fr --- (In reply to Michael Müller from comment #1)
Where did you download Notepad++? The version from http://forum.xda-developers.com/showthread.php?t=2556112 works for me.
I used the 6.5.1a from XDA.(but it also fails on a version I built)
https://bugs.winehq.org/show_bug.cgi?id=38470
--- Comment #3 from MY123 mmediouni@gmx.fr --- (In reply to MY123 from comment #2)
(In reply to Michael Müller from comment #1)
Where did you download Notepad++? The version from http://forum.xda-developers.com/showthread.php?t=2556112 works for me.
I used the 6.5.1a from XDA.(but it also fails on a version I built)
Are you sure that you used Wine wine-1.7.41-34-g0c27e5c? (latest at the time of writing)
https://bugs.winehq.org/show_bug.cgi?id=38470
--- Comment #4 from MY123 mmediouni@gmx.fr --- http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140428/215190....
https://bugs.winehq.org/show_bug.cgi?id=38470
André H. nerv@dawncrow.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW URL| |https://drive.google.com/fi | |le/d/0B5MUiJROUOqPQm5tcFpRN | |3IyQXM/edit CC| |nerv@dawncrow.de Ever confirmed|0 |1
--- Comment #5 from André H. nerv@dawncrow.de --- confirming, working on it
https://bugs.winehq.org/show_bug.cgi?id=38470
André H. nerv@dawncrow.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |a18f84c0b122a324cc050cf23a0 | |b3d0622c7de92 Status|NEW |RESOLVED Resolution|--- |FIXED
--- Comment #6 from André H. nerv@dawncrow.de --- Fixed by the stub from a18f84c0b122a324cc050cf23a0b3d0622c7de92
https://bugs.winehq.org/show_bug.cgi?id=38470
MY123 mmediouni@gmx.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED |---
--- Comment #7 from MY123 mmediouni@gmx.fr --- (In reply to André H. from comment #6)
Fixed by the stub from a18f84c0b122a324cc050cf23a0b3d0622c7de92
Not fixed at all. (I tried that stub idea before you) cubie@Cubian:~/wine-git/build2$ ./wine ../../Downloads/Note*6.4.5/notepad++.exe fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0) wine: Unhandled page fault on read access to 0x30435454 at address 0x30435454 (thread 0037), starting debugger... [backtrace removed] cubie@Cubian:~/wine-git/build2$ ./wine --version wine-1.7.44-42-gb75cd7e
https://bugs.winehq.org/show_bug.cgi?id=38470
--- Comment #8 from André H. nerv@dawncrow.de --- (In reply to MY123 from comment #7)
(In reply to André H. from comment #6)
Fixed by the stub from a18f84c0b122a324cc050cf23a0b3d0622c7de92
Not fixed at all. (I tried that stub idea before you) cubie@Cubian:~/wine-git/build2$ ./wine ../../Downloads/Note*6.4.5/notepad++.exe fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0) wine: Unhandled page fault on read access to 0x30435454 at address 0x30435454 (thread 0037), starting debugger... [backtrace removed] cubie@Cubian:~/wine-git/build2$ ./wine --version wine-1.7.44-42-gb75cd7e
Can you tell if that's really related to __chkstk? This bug is only about that function, not about Notepad++ not running...
https://bugs.winehq.org/show_bug.cgi?id=38470
--- Comment #9 from MY123 mmediouni@gmx.fr --- (In reply to André H. from comment #8)
(In reply to MY123 from comment #7)
(In reply to André H. from comment #6)
Fixed by the stub from a18f84c0b122a324cc050cf23a0b3d0622c7de92
Not fixed at all. (I tried that stub idea before you) cubie@Cubian:~/wine-git/build2$ ./wine ../../Downloads/Note*6.4.5/notepad++.exe fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0) wine: Unhandled page fault on read access to 0x30435454 at address 0x30435454 (thread 0037), starting debugger... [backtrace removed] cubie@Cubian:~/wine-git/build2$ ./wine --version wine-1.7.44-42-gb75cd7e
Can you tell if that's really related to __chkstk? This bug is only about that function, not about Notepad++ not running...
It crashes very soon after the call to that function... [maybe it's the r4 not setted up properly] I will try to write an MSVC testcase soon.
https://bugs.winehq.org/show_bug.cgi?id=38470
--- Comment #10 from André H. nerv@dawncrow.de --- (In reply to MY123 from comment #9)
(In reply to André H. from comment #8)
(In reply to MY123 from comment #7)
(In reply to André H. from comment #6)
Fixed by the stub from a18f84c0b122a324cc050cf23a0b3d0622c7de92
Not fixed at all. (I tried that stub idea before you) cubie@Cubian:~/wine-git/build2$ ./wine ../../Downloads/Note*6.4.5/notepad++.exe fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0) wine: Unhandled page fault on read access to 0x30435454 at address 0x30435454 (thread 0037), starting debugger... [backtrace removed] cubie@Cubian:~/wine-git/build2$ ./wine --version wine-1.7.44-42-gb75cd7e
Can you tell if that's really related to __chkstk? This bug is only about that function, not about Notepad++ not running...
It crashes very soon after the call to that function... [maybe it's the r4 not setted up properly] I will try to write an MSVC testcase soon.
that'd be awesome and a very good foundation for an implementation, thx!
https://bugs.winehq.org/show_bug.cgi?id=38470
--- Comment #11 from MY123 mmediouni@gmx.fr --- (In reply to André H. from comment #10)
(In reply to MY123 from comment #9)
(In reply to André H. from comment #8)
(In reply to MY123 from comment #7)
(In reply to André H. from comment #6)
Fixed by the stub from a18f84c0b122a324cc050cf23a0b3d0622c7de92
Not fixed at all. (I tried that stub idea before you) cubie@Cubian:~/wine-git/build2$ ./wine ../../Downloads/Note*6.4.5/notepad++.exe fixme:actctx:parse_depend_manifests Could not find dependent assembly L"Microsoft.Windows.Common-Controls" (6.0.0.0) wine: Unhandled page fault on read access to 0x30435454 at address 0x30435454 (thread 0037), starting debugger... [backtrace removed] cubie@Cubian:~/wine-git/build2$ ./wine --version wine-1.7.44-42-gb75cd7e
Can you tell if that's really related to __chkstk? This bug is only about that function, not about Notepad++ not running...
It crashes very soon after the call to that function... [maybe it's the r4 not setted up properly] I will try to write an MSVC testcase soon.
that'd be awesome and a very good foundation for an implementation, thx!
Bug fixed with the help of the MSVC testcase.
diff --git a/dlls/ntdll/signal_arm.c b/dlls/ntdll/signal_arm.c index 0c51c49..83715ae 100644 --- a/dlls/ntdll/signal_arm.c +++ b/dlls/ntdll/signal_arm.c @@ -252,7 +252,7 @@ static inline void restore_fpu( CONTEXT *context, const ucontext_t *sigcontext ) * * Should check if we can decrement SP by the value provided in r4, but we shouldn't need that. */ -__ASM_GLOBAL_FUNC( __chkstk, "bx lr" ) +__ASM_GLOBAL_FUNC( __chkstk, "mov r12, #4\n mul r4,r4,r12\n bx lr" )
Notepad and my MSVC testcase are working fine now
https://bugs.winehq.org/show_bug.cgi?id=38470
--- Comment #12 from André H. nerv@dawncrow.de --- (In reply to MY123 from comment #11)
- Should check if we can decrement SP by the value provided in r4, but we
shouldn't need that. */ -__ASM_GLOBAL_FUNC( __chkstk, "bx lr" ) +__ASM_GLOBAL_FUNC( __chkstk, "mov r12, #4\n mul r4,r4,r12\n bx lr" )
Use IP instead of r12, it's less cryptically. Also add newlines in the source as seen elsewhere in that file (that also should avoid some whitespaces). Use spaces after commas. Maybe also adjust the comment.
Then you should be ready to send it to wine-patches.
Thx!
https://bugs.winehq.org/show_bug.cgi?id=38470
--- Comment #13 from MY123 mmediouni@gmx.fr --- (In reply to André H. from comment #12)
(In reply to MY123 from comment #11)
- Should check if we can decrement SP by the value provided in r4, but we
shouldn't need that. */ -__ASM_GLOBAL_FUNC( __chkstk, "bx lr" ) +__ASM_GLOBAL_FUNC( __chkstk, "mov r12, #4\n mul r4,r4,r12\n bx lr" )
Use IP instead of r12, it's less cryptically. Also add newlines in the source as seen elsewhere in that file (that also should avoid some whitespaces). Use spaces after commas. Maybe also adjust the comment.
Then you should be ready to send it to wine-patches.
Thx!
patch sent
https://bugs.winehq.org/show_bug.cgi?id=38470
MY123 mmediouni@gmx.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Resolution|--- |FIXED
--- Comment #14 from MY123 mmediouni@gmx.fr --- (In reply to MY123 from comment #13)
(In reply to André H. from comment #12)
(In reply to MY123 from comment #11)
- Should check if we can decrement SP by the value provided in r4, but we
shouldn't need that. */ -__ASM_GLOBAL_FUNC( __chkstk, "bx lr" ) +__ASM_GLOBAL_FUNC( __chkstk, "mov r12, #4\n mul r4,r4,r12\n bx lr" )
Use IP instead of r12, it's less cryptically. Also add newlines in the source as seen elsewhere in that file (that also should avoid some whitespaces). Use spaces after commas. Maybe also adjust the comment.
Then you should be ready to send it to wine-patches.
Thx!
patch sent
Fixed by 2b095beac : ntdll: Multiply r4 with the word size in ARM for __chkstk.
There is a separate issue with LLVM -mcode-model=large because that also uses r12 for __chkstk calls, but that bug is not triggered by MSVC or the normal LLVM code model.
https://bugs.winehq.org/show_bug.cgi?id=38470
André H. nerv@dawncrow.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1|a18f84c0b122a324cc050cf23a0 |2b095beace7b457586bd33b3b1c |b3d0622c7de92 |81df116215193
https://bugs.winehq.org/show_bug.cgi?id=38470
--- Comment #15 from André H. nerv@dawncrow.de --- (In reply to MY123 from comment #14)
There is a separate issue with LLVM -mcode-model=large because that also uses r12 for __chkstk calls, but that bug is not triggered by MSVC or the normal LLVM code model.
No, no problem. AJ optimized your code, and it doesn't use r12/ip anymore: https://source.winehq.org/git/wine.git/commitdiff/2b095beace7b457586bd33b3b1...
With you original version there wouldn't have been an issue either, you modified r12 in the function, llvm modifies r12 to call the function and can't expect it to be unchanged afterwards as it's a scratch register
https://bugs.winehq.org/show_bug.cgi?id=38470
--- Comment #16 from MY123 mmediouni@gmx.fr --- (In reply to André H. from comment #15)
(In reply to MY123 from comment #14)
There is a separate issue with LLVM -mcode-model=large because that also uses r12 for __chkstk calls, but that bug is not triggered by MSVC or the normal LLVM code model.
No, no problem. AJ optimized your code, and it doesn't use r12/ip anymore: https://source.winehq.org/git/wine.git/commitdiff/ 2b095beace7b457586bd33b3b1c81df116215193
With you original version there wouldn't have been an issue either, you modified r12 in the function, llvm modifies r12 to call the function and can't expect it to be unchanged afterwards as it's a scratch register
There is an issue with my patch because LLVM -mcode-model=large emits that:
movw r4, #constant movw r12, :lower16:__chkstk movt r12, :upper16:__chkstk blx r12 sub.w sp, sp, r4
AJ fixed it with the use of lsl :-)
https://bugs.winehq.org/show_bug.cgi?id=38470
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #17 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 1.7.46.