Skip to content

Regression in error message for dlopen of a non executable dll #15117

@tkelman

Description

@tkelman

This is running in a cygwin shell, so using cygwin's chmod which uses Windows ACL's in some way to determine permissions. On 0.4 we get a useful "Access is denied." error when trying to load a non-executable dll via an absolute path, but not with a relative path. On master (pretty sure #13796 is responsible here) the error when using absolute paths is the rather confusing "The operation completed successfully."

$ cd /cygdrive/e/code/Julia-0.4.3-win64
Tony@LAPTOP-O230JCFF /cygdrive/e/code/Julia-0.4.3-win64
$ bin/julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.4.3 (2016-01-12 21:37 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
|__/                   |  x86_64-w64-mingw32
shell> ls -al bin/libopenspecfun.dll
-rwxrwx---+ 1 Tony None 392819 Jan 12 14:25 bin/libopenspecfun.dll
julia> Libdl.dlclose(Libdl.dlopen("bin/libopenspecfun.dll"))
shell> chmod -x bin/libopenspecfun.dll
shell> ls -al bin/libopenspecfun.dll
-rw-rw----+ 1 Tony None 392819 Jan 12 14:25 bin/libopenspecfun.dll
julia> Libdl.dlclose(Libdl.dlopen("bin/libopenspecfun.dll"))
ERROR: could not load library "bin/libopenspecfun.dll"
The specified module could not be found.
 in dlopen at libdl.jl:36 (repeats 2 times)
julia> Libdl.dlclose(Libdl.dlopen(joinpath(JULIA_HOME, "libopenspecfun.dll")))
ERROR: could not load library "E:\code\Julia-0.4.3-win64\bin\libopenspecfun.dll"
Access is denied.
 in dlopen at libdl.jl:36 (repeats 2 times)
shell> chmod +x bin/libopenspecfun.dll
julia> Libdl.dlclose(Libdl.dlopen(joinpath(JULIA_HOME, "libopenspecfun.dll")))
julia> Libdl.dlclose(Libdl.dlopen("bin/libopenspecfun.dll"))
julia> exit()

Tony@LAPTOP-O230JCFF /cygdrive/e/code/Julia-0.4.3-win64
$ cd ~/julia/usr
Tony@LAPTOP-O230JCFF ~/julia/usr
$ bin/julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.5.0-dev+2672 (2016-02-15 05:07 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit e160742* (2 days old master)
|__/                   |  x86_64-w64-mingw32
shell> ls -al bin/libopenspecfun.dll
-rw-r--r-- 1 Tony None 392819 Feb 15 00:18 bin/libopenspecfun.dll
julia> Libdl.dlclose(Libdl.dlopen(joinpath(JULIA_HOME, "libopenspecfun.dll")))
ERROR: could not load library "C:\cygwin64\home\Tony\julia\usr\bin\libopenspecfun.dll"
The operation completed successfully.
 [inlined code] from .\c.jl:91
 in dlopen(::UTF8String, ::UInt32) at .\libdl.jl:66 (repeats 2 times)
 in eval(::Module, ::Any) at .\boot.jl:267
julia> Libdl.dlclose(Libdl.dlopen("bin/libopenspecfun.dll"))
ERROR: could not load library "bin/libopenspecfun.dll"
The specified module could not be found.
 [inlined code] from .\c.jl:91
 in dlopen(::ASCIIString, ::UInt32) at .\libdl.jl:66 (repeats 2 times)
 in eval(::Module, ::Any) at .\boot.jl:267
shell> chmod +x bin/libopenspecfun.dll
shell> ls -al bin/libopenspecfun.dll
-rwxr-xr-x 1 Tony None 392819 Feb 15 00:18 bin/libopenspecfun.dll
julia> Libdl.dlclose(Libdl.dlopen(joinpath(JULIA_HOME, "libopenspecfun.dll")))
false
julia> Libdl.dlclose(Libdl.dlopen("bin/libopenspecfun.dll"))
false

Metadata

Metadata

Assignees

No one assigned

    Labels

    error handlingHandling of exceptions by Julia or the userregressionRegression in behavior compared to a previous versionsystem:windowsAffects only Windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions