Closed XVilka closed 5 years ago
We will get more as we continue the translation to new
In fact the count of failing tests increased from 55 to 159. Judging by the failing tests radare2 is hardly usable on Windows... log.txt
We need to reach 0 and make appveyor become red when any test fail. I don't really have the time to do this, but anyone working on Windows could help on that.
Some of the failed tests cases are related to /dev/null
usage (not available on windows, nul
has to be used instead) and environment variables like this one test:
%ENV=World
!echo $ENV
-World
+$ENV
through subcommand, env var have to be accessed by echo %ENV%
.
P.S. I don't see there a way to turn on/off some test cases depending on OS, so such test cases which differs in platform-related things can be handled properly by a test writer.
Those cases must be rewritten to not use /dev/null nor nul. Not disabled.
@a1ext you can see that most of the failing tests are those using !rasm2
or !rahash2
calls. So by reusing internal r2 commands you can fix the tests.
Lets fix them one-by-one.
Next one is the following:
[00:08:53] [XX] db\tools\rahash2 rahash2 -s hello\x31 992
[00:08:53] $ r2 -escr.utf8=0 -escr.color=0 -escr.interactive=0 -N -Q -i C:\Users\appveyor\AppData\Local\Temp\1\tmp-2356OLtWbSqcQN45.tmp -
[00:08:53] !rahash2 -qa md5 -s hello\\x31
[00:08:53]
[00:08:53] -203ad5ffa1d7c650ad681fdff3965cd2
[00:08:53] +827dd13a4b222a80edbc195239fd7c5c
[00:08:53]
[00:08:53] EXPECT=<<RUN
[00:08:53] 827dd13a4b222a80edbc195239fd7c5c
It caused by double-backslash \\
because on windows it \
is valid shell character so it hasn't be escaped. So, I dunno how to fix this
Even in quotes? We can also feed an hexpair string
On 21 Mar 2019, at 09:26, a1ext notifications@github.com wrote:
Lets fix them one-by-one.
Next one is the following:
[00:08:53] [XX] db\tools\rahash2 rahash2 -s hello\x31 992 [00:08:53] $ r2 -escr.utf8=0 -escr.color=0 -escr.interactive=0 -N -Q -i C:\Users\appveyor\AppData\Local\Temp\1\tmp-2356OLtWbSqcQN45.tmp - [00:08:53] !rahash2 -qa md5 -s hello\x31 [00:08:53] [00:08:53] -203ad5ffa1d7c650ad681fdff3965cd2 [00:08:53] +827dd13a4b222a80edbc195239fd7c5c [00:08:53] [00:08:53] EXPECT=<<RUN [00:08:53] 827dd13a4b222a80edbc195239fd7c5c It caused by double-backslash \ because on windows it \ is valid shell character so it hasn't be escaped. So, I dunno how to fix this
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
yeah,
Also something strange happens in demangling:
[XX] db\formats\mangling\mangling Abbreviation Of Repetead Names (Name with Template Arguments) demangler test 1285
$ r2 -escr.utf8=0 -escr.color=0 -escr.interactive=0 -N -Q -i C:\Users\appveyor\AppData\Local\Temp\1\tmp-4216W63kLQr4i94O.tmp -
"!rabin2 -D msvc ?xyz@?\$abc@V?\$def@H@@PAX@@YAXXZ"
-void __cdecl abc<class def<int>, void *>::xyz(void)
+?xyz@?\$abc@V?\$def@H@@PAX@@YAXXZ
EXPECT=<<EOF
?xyz@?\$abc@V?\$def@H@@PAX@@YAXXZ
[XX] db\formats\mangling\mangling Abbreviation Of Name with template demangler test 1372
$ r2 -escr.utf8=0 -escr.color=0 -escr.interactive=0 -N -Q -i C:\Users\appveyor\AppData\Local\Temp\1\tmp-4216XTjIkyr6272K.tmp -
"!rabin2 -D msvc ??\$MyTemplateFunction@VClass1@@@Class1@@QAEXPAV0@@Z"
-public: void __thiscall Class1::MyTemplateFunction<class Class1>(class Class1 *)
+??\$MyTemplateFunction@VClass1@@@Class1@@QAEXPAV0@@Z
EXPECT=<<EOF
??\$MyTemplateFunction@VClass1@@@Class1@@QAEXPAV0@@Z
[**] db\formats\mangling\mangling OK 1465 BR 86 XX 20 FX 15
[XX] db\formats\mangling\rust rust static type with hash 1224
$ r2 -escr.utf8=0 -escr.color=0 -escr.interactive=0 -N -Q -i C:\Users\appveyor\AppData\Local\Temp\1\tmp-4216wWX65sYmJpDp.tmp -
"!rabin2 -D rust _ZN96_\$LT\$core..fmt..Write..write_fmt..Adapter\$LT\$\$u27\$a\$C\$\$u20\$T\$GT\$\$u20\$as\$u20\$core..fmt..Write\$GT\$9write_str17he4f4768a2f446facE"
-<core::fmt::Write::write_fmt::Adapter<'a, T> as core::fmt::Write>::write_str::he4f4768a2f446fac
+_ZN96_\$LT\$core..fmt..Write..write_fmt..Adapter\$LT\$\$u27\$a\$C\$\$u20\$T\$GT\$\$u20\$as\$u20\$core..fmt..Write\$GT\$9write_str17he4f4768a2f446facE
EXPECT=<<EOF
_ZN96_\$LT\$core..fmt..Write..write_fmt..Adapter\$LT\$\$u27\$a\$C\$\$u20\$T\$GT\$\$u20\$as\$u20\$core..fmt..Write\$GT\$9write_str17he4f4768a2f446facE
[XX] db\formats\mangling\rust rust static type 1275
$ r2 -escr.utf8=0 -escr.color=0 -escr.interactive=0 -N -Q -i C:\Users\appveyor\AppData\Local\Temp\1\tmp-4216tWaLTOTFkhnb.tmp -
"!rabin2 -D rust _ZN71_\$LT\$Test\$u20\$\$u2b\$\$u20\$\$u27\$static\$u20\$as\$u20\$foo..Bar\$LT\$Test\$GT\$\$GT\$3barE"
-<Test + 'static as foo::Bar<Test>>::bar
+_ZN71_\$LT\$Test\$u20\$\$u2b\$\$u20\$\$u27\$static\$u20\$as\$u20\$foo..Bar\$LT\$Test\$GT\$\$GT\$3barE
EXPECT=<<EOF
This one is probably due to some format string difference between GCC and MSVC:
[XX] db\cmd\cmd_help "? -1" 408
$ r2 -escr.utf8=0 -escr.color=0 -escr.interactive=0 -N -Q -i C:\Users\appveyor\AppData\Local\Temp\1\tmp-42164UGuM31k6iLu.tmp --
? -1
int64 -1
hex 0xffffffffffffffff
octal 01777777777777777777777
-unit 16.0E
+unit 16E
segment fffff000:0fff
string "\xff
And I remember @radare recently met these on another platform:
[**] db\cmd\cmd_help OK 2803 BR 142 XX 25 FX 19
[XX] db\cmd\cmd_i izzz* (file x86_64) 557
$ r2 -escr.utf8=0 -escr.color=0 -escr.interactive=0 -N -Q -i C:\Users\appveyor\AppData\Local\Temp\1\tmp-4216KERD4Q8IuEkK.tmp ../bins/elf/analysis/hello-linux-x86_64
izzz*~:0
izzz*~:1
f str.8 10 @ 0x00400034
-Cs 10 @ 0x00400034
+Cs 2314987372554 @ 0x00400034
EXPECT=<<EOF
f str.8 10 @ 0x00400034
Cs 2314987372554 @ 0x00400034
[XX] db\cmd\cmd_i utf8 (possibly malformed) filenames with non-printable chars 483
$ r2 -escr.utf8=0 -escr.color=0 -escr.interactive=0 -N -Q -i C:\Users\appveyor\AppData\Local\Temp\1\tmp-4216NITLz91cdKtM.tmp -
cd `e dir.tmp`
e io.cache=true
"(show_fname fname, wz $0, wtf `prz`, o `prz`, i~file, ij, rm `prz`)"
.(show_fname A\x1b¢\302\200€𝄞\363\240\201\201\\.bin)
.(show_fname B\x1b¢\302\200€𝄞\363\240\201\201\\.bin)
# INVALID FILENAME .(show_fname B\x1b¢\302\200\200€𝄞\363\240\201\201\\.bin)
-file A�€𝄞\.bin
-{"core":{"type":"","file":"A\u001b¢\u0080€𝄞\udb40\udc41\\.bin","fd":4,"size":256,"humansz":"256","iorw":true,"mode":"r-x","obsz":0,"block":256,"format":"any"}}
-file B�€𝄞\.bin
-{"core":{"type":"","file":"B\u001b¢\u0080€𝄞\udb40\udc41\\.bin","fd":5,"size":256,"humansz":"256","iorw":true,"mode":"r-x","obsz":0,"block":256,"format":"any"}}
+file malloc://512
+{"core":{"type":"","file":"malloc://512","fd":3,"size":512,"humansz":"512","iorw":true,"mode":"rwx","obsz":0,"block":256,"format":"any"}}
+file malloc://512
+{"core":{"type":"","file":"malloc://512","fd":3,"size":512,"humansz":"512","iorw":true,"mode":"rwx","obsz":0,"block":256,"format":"any"}}
EXPECT=<<EOF
file malloc://512
{"core":{"type":"","file":"malloc://512","fd":3,"size":512,"humansz":"512","iorw":true,"mode":"rwx","obsz":0,"block":256,"format":"any"}}
file malloc://512
{"core":{"type":"","file":"malloc://512","fd":3,"size":512,"humansz":"512","iorw":true,"mode":"rwx","obsz":0,"block":256,"format":"any"}}
[XX] db\cmd\cmd_i iS= 546
$ r2 -escr.utf8=0 -escr.color=0 -escr.interactive=0 -N -Q -i C:\Users\appveyor\AppData\Local\Temp\1\tmp-4216GYS48qWjbG4j.tmp ../bins/mach0/fatmach0-3true
iS=
-00* 0x100000ef8 |##--------| 0x100000f3f 71 r-x 0.__TEXT.__text
-01 0x100000f40 |--#-------| 0x100000f46 6 r-x 1.__TEXT.__symbol_stub1
-02 0x100000f46 |--#-------| 0x100000f60 26 r-x 2.__TEXT.__stub_helper
-03 0x100000f60 |--####----| 0x100000fb4 84 r-x 3.__TEXT.__unwind_info
-04 0x100000fb8 |-----###--| 0x100001000 72 r-x 4.__TEXT.__eh_frame
-05 0x100001000 |-------#--| 0x100001010 16 rw- 5.__DATA.__nl_symbol_ptr
-06 0x100001010 |-------#--| 0x100001018 8 rw- 6.__DATA.__la_symbol_ptr
-07 0x100001020 |--------##| 0x100001048 40 rw- 7.__DATA.__program_vars
-08 0x100001048 |---------#| 0x100001068 32 rw- 8.__DATA.__data
-=> 0x100000ef8 |----------| 0x100000ef7
EXPECT=''
This one is due to platform environment variables differences: '%' vs '$' and making quotes a part of the variable:
[XX] db\cmd\cmd_system %ENV=33 !echo "$ENV" 1021
$ r2 -escr.utf8=0 -escr.color=0 -escr.interactive=0 -N -Q -i C:\Users\appveyor\AppData\Local\Temp\1\tmp-4216cx7o1ZK2rfXz.tmp -
%ENV=World
!echo $ENV
-World
+$ENV
EXPECT=<<EOF
$ENV
[XX] db\cmd\cmd_system !echo "test" 1007
$ r2 -escr.utf8=0 -escr.color=0 -escr.interactive=0 -N -Q -i C:\Users\appveyor\AppData\Local\Temp\1\tmp-4216aDuIzVAjSGDd.tmp -
!echo "test"
"!echo test"
+"test"
test
-test
EXPECT=<<EOF
"test"
test
This test looks very non-portable:
[XX] db\cmd\feat_redirect "pb>x;!wc -c x" 352
$ r2 -escr.utf8=0 -escr.color=0 -escr.interactive=0 -N -Q -i C:\Users\appveyor\AppData\Local\Temp\1\tmp-4216UsSgYZTIej4j.tmp malloc://1024
p8 10 > dump
!wc -c dump|sed 's/^[ \t]*//;s/[ \t]*$//'
p8 12800 > dump
!wc -c dump|sed 's/^[ \t]*//;s/[ \t]*$//'
!rm -f dump
-21
-25601
+21 dump
+25601 dump
This discussion should be moved to r2r and issues open accordingly for every mentioned problems
@a1ext note, that some !commands
can be replaced with builtin alternatives:
!cat
with cat
!rm
with rm
!ls
with `ls'!wc
with ~?
!wc -c
with ~?.
This discussion should be moved to r2r and issues open accordingly for every mentioned problems
Why? Mostly problems fixes are in r2 side
@a1ext note, that some
!commands
can be replaced with builtin alternatives:
!cat
withcat
!rm
withrm
!ls
with `ls'!wc
with~?
!wc -c
with~?.
What about sed
?
Portability and performance
On 22 Mar 2019, at 09:09, a1ext notifications@github.com wrote:
This discussion should be moved to r2r and issues open accordingly for every mentioned problems
Why? Mostly problems fixes are in r2 side
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
Use ~ for sed but better not to have tests depending on it
On 22 Mar 2019, at 09:09, a1ext notifications@github.com wrote:
@a1ext note, that some !commands can be replaced with builtin alternatives:
!cat with cat !rm with rm !ls with `ls' !wc with ~? !wc -c with ~?. What about sed?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
Because some are related to tests writing and not r2
ok, could you transfer the issue to r2r?
I cannot automatically because radare2 and radare2-regressions are not in radare2org #13263 . I will check later to do that manually.
@a1ext is there any progress on this?
@a1ext is there any progress on this?
Actually I have no time to work on any open-source at the moment, very busy. You can involve somebody else for the issue.
@GustavoLCR you might want to take a look at those by the way.
How many XX now?
@radare 41, before the master was broken.
status now?
24 XX
Ok, I think that's it. Now waiting for @radare to release both r2r-js and r2pipe-js and see if everything is green.
Both releases done
On 23 Jun 2019, at 03:31, GustavoLCR notifications@github.com wrote:
Ok, I think that's it. Now waiting for @radare to release both r2r-js and r2pipe-js and see if everything is green.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
@GustavoLCR still 2 XX (see https://ci.appveyor.com/project/radare/radare2-shvdd/build/job/ea3a7x0f1tb9kj4x):
[XX] db\formats\mangling\mangling Abbreviation Of Repetead Names (Name with Template Arguments) demangler test 1510
$ r2 -escr.utf8=0 -escr.color=0 -escr.interactive=0 -N -Q -i C:\Users\appveyor\AppData\Local\Temp\1\tmp-4040b5VtciOCu83F -
"!rabin2 -D msvc ?xyz@?\$abc@V?\$def@H@@PAX@@YAXXZ"
-void __cdecl abc<class def<int>, void *>::xyz(void)
+?xyz@?\$abc@V?\$def@H@@PAX@@YAXXZ
EXPECT=<<EOF
?xyz@?\$abc@V?\$def@H@@PAX@@YAXXZ
[XX] db\formats\mangling\mangling Abbreviation Of Name with template demangler test 1466
$ r2 -escr.utf8=0 -escr.color=0 -escr.interactive=0 -N -Q -i C:\Users\appveyor\AppData\Local\Temp\1\tmp-4040HShhxRCI7n56 -
"!rabin2 -D msvc ??\$MyTemplateFunction@VClass1@@@Class1@@QAEXPAV0@@Z"
-public: void __thiscall Class1::MyTemplateFunction<class Class1>(class Class1 *)
+??\$MyTemplateFunction@VClass1@@@Class1@@QAEXPAV0@@Z
EXPECT=<<EOF
??\$MyTemplateFunction@VClass1@@@Class1@@QAEXPAV0@@Z
Amazing job @GustavoLCR!
Amazing job @GustavoLCR!
Thanks!