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

debug/pe: test failing for Windows-arm #27904

Closed
katiehockman opened this issue Sep 27, 2018 · 23 comments
Closed

debug/pe: test failing for Windows-arm #27904

katiehockman opened this issue Sep 27, 2018 · 23 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. OS-Windows
Milestone

Comments

@katiehockman
Copy link
Contributor

See build.golang.org windows-arm build failures.
Example build: https://build.golang.org/log/b861d37d4bb477daf73ed0b8b9de6dee5d44ef20

--- FAIL: TestDWARF (7.93s)
    file_test.go:399: main.main not found
--- FAIL: TestImportTableInUnknownSection (0.09s)
    file_test.go:544: unable to locate required file "atmfd.dll" in search path: exec: "atmfd.dll": executable file not found in %PATH%
FAIL
FAIL	debug/pe	12.391s
@katiehockman katiehockman added OS-Windows NeedsFix The path to resolution is known, but the work has not been done. Soon This needs to be done soon. (regressions, serious bugs, outages) labels Sep 27, 2018
@katiehockman katiehockman added this to the Go1.12 milestone Sep 27, 2018
@katiehockman katiehockman changed the title debug/pe: Test failing for Windows-arm debug/pe: test failing for Windows-arm Sep 27, 2018
@bradfitz
Copy link
Contributor

/cc @jordanrh1

@bradfitz bradfitz removed the Soon This needs to be done soon. (regressions, serious bugs, outages) label Sep 27, 2018
@bradfitz bradfitz assigned jordanrh1 and unassigned alexbrainman Sep 27, 2018
@alexbrainman
Copy link
Member

--- FAIL: TestDWARF (7.93s) file_test.go:399: main.main not found --- FAIL: TestImportTableInUnknownSection (0.09s) file_test.go:544: unable to locate required file "atmfd.dll" in search path: exec: "atmfd.dll": executable file not found in %PATH% FAIL FAIL debug/pe 12.391s

I am sure, the fix for this is part of #26148. Leaving for @jordanrh1

Alex

@jordanrh1
Copy link
Contributor

I'll take a look.

@katiehockman
Copy link
Contributor Author

@jordanrh1 just a friendly ping. Any updates on this?

@bradfitz
Copy link
Contributor

bradfitz commented Oct 4, 2018

Looks like we can just skip that test. I'll send a CL. I don't think windows/arm has that DLL.

@gopherbot
Copy link

Change https://golang.org/cl/139720 mentions this issue: debug/pe: skip a test on windows/arm

@jordanrh1
Copy link
Contributor

Correct, Windows IOT Core does not have atmfd.dll. Thank you for fixing.

@jordanrh1
Copy link
Contributor

TestDWARF is failing because of relocations. The test is expecting the runtime address of main.main to match the link-time address, but this does not hold up with relocatable binaries. You'll get a different address printed from a.exe each time you run it due to ASLR.

@alexbrainman What do you think about having a.exe subtract the module base address from the address of main.main, i.e. print the relative offset of main.main from module start?

@alexbrainman
Copy link
Member

@alexbrainman What do you think about having a.exe subtract the module base address from the address of main.main, i.e. print the relative offset of main.main from module start?

Sounds reasonable to me. Would like to send a change?

I am reopening this issues to track TestDWARF failure.

Alex

@alexbrainman alexbrainman reopened this Oct 5, 2018
@gopherbot
Copy link

Change https://golang.org/cl/140158 mentions this issue: debug/pe: fix TestDWARF to work with relocations

@tobiaskohlbau
Copy link

tobiaskohlbau commented Nov 19, 2018

I get the same error on Windows 10 x64, Version 1809, Build 17763.134. Does this test need additional packages installed?

--- FAIL: TestImportTableInUnknownSection (0.02s)
    file_test.go:613: unable to locate required file "atmfd.dll" in search path: exec: "atmfd.dll": executable file not found in %PATH%
FAIL
FAIL    debug/pe        5.053s

@jordanrh1
Copy link
Contributor

atmfd.dll is the Adobe Type Manager Font Driver. It may be present in an optional package.
@alexbrainman is there another DLL that would work?

@gopherbot
Copy link

Change https://golang.org/cl/151137 mentions this issue: debug/pe: use kernel32.dll in TestImportTableInUnknownSection

@alexbrainman
Copy link
Member

I get the same error on Windows 10 x64, Version 1809, Build 17763.134. Does this test need additional packages installed?

No, you should not need anything specific. I adjusted TestImportTableInUnknownSection in https://go-review.googlesource.com/c/go/+/151137 Can you, please, try it and let me know, if it fixes your problem? Thank you.

@alexbrainman is there another DLL that would work?

Now I realised that kernel32.dll should work too.

Alex

@tobiaskohlbau
Copy link

tobiaskohlbau commented Nov 24, 2018

Thanks for your fix. I can confirm that it works on my machine, too.

PS C:\go> git show
commit ed7176e50b44567370d487796c02903a70f1f222 (HEAD)
...

PS C:\go\src> .\all.bat
Building Go cmd/dist using C:\go1.11
Building Go toolchain1 using C:\go1.11.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
Building Go toolchain3 using go_bootstrap and Go toolchain2.
Building packages and commands for windows/amd64.


##### Testing packages.

...
ok      debug/dwarf     1.400s
ok      debug/elf       0.649s
ok      debug/gosym     2.650s
ok      debug/macho     0.860s
ok      debug/pe        4.871s
... 

ALL TESTS PASSED

---
Installed Go for windows/amd64 in C:\go
Installed commands in C:\go\bin

gopherbot pushed a commit that referenced this issue Nov 24, 2018
TestImportTableInUnknownSection was introduced in CL 110555 to
test PE executable with import table located in section other than
".idata". We used atmfd.dll for that purpose, but it seems
atmfd.dll is not present on some systems.

Use kernel32.dll instead. kernel32.dll import table is located in
".rdata" section, so it should do the job. And every Windows
system has kernel32.dll file.

Also make TestImportTableInUnknownSection run on windows-arm,
since windows-arm should also have kernel32.dll file.

Updates #27904

Change-Id: Ie005ee10e46ae0c06e83929d581e89f86c051eea
Reviewed-on: https://go-review.googlesource.com/c/151137
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@alexbrainman
Copy link
Member

I can confirm that it works on my machine, too.

SGTM. Thanks for checking. I just submitted 151137.

Alex

@gopherbot
Copy link

Change https://golang.org/cl/151477 mentions this issue: debug/pe: correct TestImportTableInUnknownSection error message

@alexbrainman
Copy link
Member

Now I realised that kernel32.dll should work too.

@jordanrh1 it looks like windows/arm builder still fails on TestImportTableInUnknownSection

https://build.golang.org/log/e37627b9aa1c02a85c1d9d6ba6123052184cdee0

--- FAIL: TestImportTableInUnknownSection (0.06s)
    file_test.go:610: unable to locate required file "atmfd.dll" in search path: exec: "kernel32.dll": executable file not found in %PATH%
FAIL
FAIL	debug/pe	12.768s

It appears that os/exec.LookPath could not find "kernel32.dll" in the %PATH%. I wonder why? kernel32.dll functions are used by Go in many places. Why it could not be found in the %PATH%? Perhaps os/exec.LookPath is broken? Can you investigate, please.

Thank you.

Alex

gopherbot pushed a commit that referenced this issue Nov 27, 2018
TestImportTableInUnknownSection uses kernel32.dll file, but the error
message mentions atmfd.dll. Adjust error message to match the test.

This change should have been part of CL 151137.

Updates #27904

Change-Id: Ifc31a12134b328472191122f8426ab6ed234fbd4
Reviewed-on: https://go-review.googlesource.com/c/151477
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
@jordanrh1
Copy link
Contributor

With the onecore refactoring effort, kernel32.dll was split into a multitude of other DLLs, two of which are kernelbase.dll and kernel32legacy.dll. kernel32.dll does not exist on onecore editions, except as a virtual entity for backwards compatibility. Some candidate DLLs that exist across all flavors of windows are combase.dll, cfgmgr32.dll, and ws2_32.dll.

@gopherbot
Copy link

Change https://golang.org/cl/151480 mentions this issue: debug/pe: use ws2_32.dll in TestImportTableInUnknownSection

@alexbrainman
Copy link
Member

Some candidate DLLs that exist across all flavors of windows are combase.dll, cfgmgr32.dll, and ws2_32.dll.

ws2_32.dll works for me. Please, try https://go-review.googlesource.com/c/go/+/151480

Thank you.

Alex

@jordanrh1
Copy link
Contributor

Verified that it works on ARM.

>pe.test.exe -test.v -test.run TestImportTableInUnknownSection
=== RUN   TestImportTableInUnknownSection
--- PASS: TestImportTableInUnknownSection (0.05s)
PASS

@alexbrainman
Copy link
Member

Verified that it works on ARM.

Thanks for checking. Just submitted CL 151480.

Alex

gopherbot pushed a commit that referenced this issue Nov 29, 2018
Apparently (see
#27904 (comment)
for details) kernel32.dll file is not present on windows/arm, so
use ws2_32.dll instead. ws2_32.dll imports table also lives in
'.rdata' section, so ws2_32.dll is as good as kernel32.dll for
testing issue #16103.

Updates #27904

Change-Id: Ibc72b24eea9a4d85abd371ffdcf00442e711b745
Reviewed-on: https://go-review.googlesource.com/c/151480
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
awgh pushed a commit to Binject/debug that referenced this issue Jan 15, 2019
Apparently (see
golang/go#27904 (comment)
for details) kernel32.dll file is not present on windows/arm, so
use ws2_32.dll instead. ws2_32.dll imports table also lives in
'.rdata' section, so ws2_32.dll is as good as kernel32.dll for
testing issue #16103.

Updates #27904

Change-Id: Ibc72b24eea9a4d85abd371ffdcf00442e711b745
Reviewed-on: https://go-review.googlesource.com/c/151480
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
@golang golang locked and limited conversation to collaborators Nov 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. OS-Windows
Projects
None yet
Development

No branches or pull requests

6 participants