jacereda / fsatrace

Filesystem access tracer
ISC License
78 stars 12 forks source link

fsatrace cannot run cabal: setModificationTime: invalid argument #16

Closed peti closed 7 years ago

peti commented 7 years ago

I'm seeing the following error in Linux/x86_64 using the latest git version of fsatrace:

$ fsatrace rwm /tmp/foo -- cabal unpack -v0 base-orphans-0.5.4
base-orphans-0.5.4/: setModificationTime: invalid argument (Bad file
descriptor)
fsatrace?�~�(1072): error: command failed with code 1
argv[0]=cabal
argv[1]=unpack
argv[2]=-v0
argv[3]=base-orphans-0.5.4

Is that a known problem? Am I doing something wrong?

jacereda commented 7 years ago

Looks like the problem is https://github.com/jacereda/fsatrace/blob/master/src/unix/fsatraceso.c#L451

It should instead call utimes() with an appropriate conversion from timespec to timeval. Unfortunately I won't be able to work on it until next week.

jacereda commented 7 years ago

I attempted the fix on a "Bash on Ubuntu" installation that unfortunately can't run any Haskell executables due to https://github.com/Microsoft/BashOnWindows/issues/307

Could you check if it works now?

peti commented 7 years ago

The new version produces a different error message here:

$ fsatrace rwm /tmp/foo -- cabal unpack -v0 base-orphans-0.5.4
base-orphans-0.5.4/: setModificationTime: invalid argument (Invalid argument)
fsatrace(8493): error: command failed with code 1
argv[0]=cabal
argv[1]=unpack
argv[2]=-v0
argv[3]=base-orphans-0.5.4
jacereda commented 7 years ago

Should be fine now.