Giter Site home page Giter Site logo

Comments (17)

ndmitchell avatar ndmitchell commented on September 21, 2024

Note all these tests were with the latest release, not the latest code.

from fsatrace.

jacereda avatar jacereda commented on September 21, 2024

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.

ndmitchell avatar ndmitchell commented on September 21, 2024

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.

jacereda avatar jacereda commented on September 21, 2024

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.

ndmitchell avatar ndmitchell commented on September 21, 2024

Using - works perfectly, so it must be the output file.

from fsatrace.

jacereda avatar jacereda commented on September 21, 2024

Does it crash if the output file doesn't exist?

from fsatrace.

ndmitchell avatar ndmitchell commented on September 21, 2024

Yes. I get a crash if it exists, and if it doesn't exist.

from fsatrace.

jacereda avatar jacereda commented on September 21, 2024

Nothing printed to stderr before crashing?

from fsatrace.

ndmitchell avatar ndmitchell commented on September 21, 2024

Nope.

from fsatrace.

ndmitchell avatar ndmitchell commented on September 21, 2024

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.

jacereda avatar jacereda commented on September 21, 2024

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.

ndmitchell avatar ndmitchell commented on September 21, 2024

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.

ndmitchell avatar ndmitchell commented on September 21, 2024

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.

jacereda avatar jacereda commented on September 21, 2024

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.

ndmitchell avatar ndmitchell commented on September 21, 2024

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.

jacereda avatar jacereda commented on September 21, 2024

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.

ndmitchell avatar ndmitchell commented on September 21, 2024

Works now, thanks!

from fsatrace.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.