Comments (17)
Note all these tests were with the latest release, not the latest code.
from fsatrace.
I've uploaded another binary distribution, this one should have better error checking.
The errors you're seeing are easy to fix, but the linker error is more serious. I don't know in which library is NtQueryInformationFile() located when using the sdk that used to go with vs2008. I think you'll at least need vs2012 (the included build.bat is for vs2015).
You can also try with mingw, but that requires 2 compilers (64-bit, 32-bit).
from fsatrace.
Trying the new binaries, both segfault after writing:
r|C:\Users\myusername\list.txt
So it seeems to be a segfault during shutdown. If I can build with VS2008 I can debug it properly. Otherwise I'll try and reproduce on my machine tonight.
from fsatrace.
When trying you might find helpful redirecting the output to stdout as:
fsatrace - -- cmd /c "..."
That should also rule out an error writing to the output file.
from fsatrace.
Using -
works perfectly, so it must be the output file.
from fsatrace.
Does it crash if the output file doesn't exist?
from fsatrace.
Yes. I get a crash if it exists, and if it doesn't exist.
from fsatrace.
Nothing printed to stderr before crashing?
from fsatrace.
Nope.
from fsatrace.
In fact, just fsatrace foo.txt -- echo 1
crashes, and then there is very little on the console, so I am certain there is no stderr message.
from fsatrace.
That echo
is probably cygwin's. Does it crash with this one?
fsatrace foo.txt -- cmd /c dir
If I try your version I get an error printed complaining about CreateProcessW() (it can't find echo since it's a cmd.exe builtin).
from fsatrace.
Yes, with cmd /c dir
it crashes too. On my home desktop (Win 10) it works fine. Perhaps you could produce a binary where every other line was print something to stderr, and we can figure out which line it fails at?
Hopping into the debugger, I see unhandled exception, access violation writing to location 0 - so it seems like it should be relatively easy to track down. I didn't get any time today, but if I can build it with VS2008 I'll be able to hop into the debugger properly and see it almost immediately.
from fsatrace.
Today (after a reboot), the same test has different behaviour, using the v0.2 binaries:
C:\Users\username>fsatrace - -- cmd /c dir
Fatal: fsatrace.c:39: CreateProcessW(0, cmd, 0, 0, 0, CREATE_SUSPENDED, 0, 0, &si, &pi), err: 57
Trying the new binaries with fsatrace foo.txt -- cmd /c dir
I get:
TlsFree(s_hooked)
UnmapViewOfFile(s_buf)
CloseHandle(s_mf)
GetExitCodeProcess(pi.hProcess, &rc)
CloseHandle(pi.hProcess)
0 != (of = CreateFileA(out, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_N
ORMAL, 0))
WriteFile(of, buf + 4, *(DWORD*)buf, 0, 0)
from fsatrace.
In the first case, are we sure that cmd is \windows\system32\cmd.exe? What does
where cmd
say?
In the second case, looks like I made a mistake when checking the validity of the opened file (it should check against INVALID_HANDLE_VALUE). In that case, it would be an error opening the file. Can you perform that same test from %HOME%\Desktop
?
from fsatrace.
cmd
is from System32, it's the normal Windows one.
I get the same results in %HOME%\Desktop
, and it appears that the file worked just fine, as it does create foo.txt - it even has lots of lines in it - 912 bytes consisting of lots of copies of:
r|C:\workspace\bin\fsatracehelper.exe
from fsatrace.
OK, got a windows box with vs2012 installed and I can reproduce it there. Looks like Windows7 requires the written
parameter to be non-null. I'll upload a new build.
from fsatrace.
Works now, thanks!
from fsatrace.
Related Issues (20)
- sh.exe test fails on Windows
- Doesn't trace execution on Windows HOT 4
- Make a release HOT 1
- Output file even on non-zero exit code HOT 1
- Tracing multiple subprocesses doesn't work on Windows HOT 8
- Can't trace Go code on Linux HOT 2
- Can't trace gcc on Mac HOT 2
- fsatrace isn't recording executable being run as a "read". HOT 6
- Clarify (or clean up) the Windows makefile HOT 1
- Can't spawn a 32bit process from a .bat file HOT 3
- Tracking reads from non-existing files HOT 6
- Corruption of PATH HOT 2
- failures on ubuntu 20.04 HOT 6
- Quantifying fsatrace's coverage HOT 2
- Consider ETW on Windows HOT 3
- Removing a symlink looks like removing its target HOT 8
- segfault in emiting op HOT 8
- Tracing mkdir syscalls
- Basic tracing does not appear to work on macOS Monterey Version 12.5.1 HOT 3
- Fails to compile on GitHub Mac runners (incompatible architecture) HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fsatrace.