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

Fix path used for temp file creation #947

Merged
merged 1 commit into from
Feb 11, 2019

Conversation

mgsloan
Copy link
Contributor

@mgsloan mgsloan commented Feb 10, 2019

File.pathSeparatorChar is the separator for PATH and similar
variables. File.separatorChar is the correct separator for
directories.

Description

The temp file code was using : as the path separator instead of /, leading to paths like /tmp:criterion425512593.json.

How Has This Been Tested?

Running a criterion benchmark yielded

Exception in thread "main" java.nio.file.AccessDeniedException: /tmp:criterion425512593.json
        at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
        at java.base/sun.nio.fs.UnixFileSystemProvider.newFileChannel(UnixFileSystemProvider.java:178)
        at java.base/java.nio.channels.FileChannel.open(FileChannel.java:292)
        at eta.base.Utils.fileChannelOpen(Utils.java:600)
        at base.system.posix.Internals$c_open1.call(Internals.hs:344)
        at base.system.IO$$wa.call(IO.hs:500)
        at criterion.criterion.Internal$$wa6.call(Internal.hs:125)
        at criterion.criterion.Main$defaultMain3.call(Main.hs:173)
        at criterion.criterion.Main$defaultMain2.call(Main.hs:152)
        at main.Main$main1.call(Main.hs:20)
        at main.Main$main1.applyV(Main.hs)
        at eta.runtime.exception.Exception.catch_(Exception.java:129)
        at main.Main$main20.call(Main.hs)
        at main.Main$DZCmain.call(Main.hs:20)
        at main.Main$DZCmain.applyV(Main.hs:20)
        at eta.runtime.stg.Closures$EvalLazyIO.enter(Closures.java:152)
        at eta.runtime.stg.Capability.schedule(Capability.java:246)
        at eta.runtime.stg.Capability.scheduleClosure(Capability.java:202)
        at eta.runtime.Runtime.evalLazyIO(Runtime.java:392)
        at eta.runtime.Runtime.main(Runtime.java:385)
        at eta.main.main(Unknown Source)

After this fix, the criterion benchmark doesn't work (hangs), but at least it doesn't immediately throw this error.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation change
  • Test suite change

Checklist:

  • I have read the CONTRIBUTING document.

File.pathSeparatorChar is the separator for PATH and similar
variables. File.separatorChar is the correct separator for
directories.
@CLAassistant
Copy link

CLAassistant commented Feb 10, 2019

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@rahulmutt rahulmutt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix, @mgsloan! Looks good to me.

@rahulmutt rahulmutt merged commit 8c1e233 into typelead:master Feb 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants