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

add package crashes with Exception violation when I try to add any package #41642

Open
kapilash opened this issue Jul 19, 2021 · 11 comments
Open
Assignees
Labels
backport 1.6 Change should be backported to release-1.6 regression Regression in behavior compared to a previous version system:windows Affects only Windows

Comments

@kapilash
Copy link

I am facing the following exception when am trying to add any package with Julia.
Steps to reproduce

  • from windows command prompt, go to julia REPL
  • ]
  • add JSON

I get this with 1.6.2 , 1.5.4 as well as 1.7.0 beta .
I am on windows 10.

This occurs for any package.
Can some one help please?

D:\>julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.6.2 (2021-07-14)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(@v1.6) pkg> add JSON
    Updating registry at `XXXXX\packages\registries\General`
    Updating git-repo `https://github.com/JuliaRegistries/General.git`
   Resolving package versions...

Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x27898d4 -- fs__chmod at /workspace/srcdir/libuv\src/win\fs.c:2361
in expression starting at none:0
fs__chmod at /workspace/srcdir/libuv\src/win\fs.c:2361
uv__fs_work at /workspace/srcdir/libuv\src/win\fs.c:3207
uv_fs_chmod at /workspace/srcdir/libuv\src/win\fs.c:3759
jl_fs_chmod at /cygdrive/c/buildbot/worker/package_win64/build/src\jl_uv.c:382
#chmod#31 at .\file.jl:1089
chmod at .\file.jl:1089 [inlined]
#26 at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Tar\src\extract.jl:81
#read_tarball#47 at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Tar\src\extract.jl:347
jfptr_YY.read_tarballYY.47_52802.clone_1 at D:\Julia\julia-1.6.2\lib\julia\sys.dll (unknown line)
read_tarball##kw at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Tar\src\extract.jl:319
unknown function (ip: 000000006110645c)
#extract_tarball#25 at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Tar\src\extract.jl:51
extract_tarball##kw at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Tar\src\extract.jl:51
unknown function (ip: 000000006110637c)
#83 at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Tar\src\Tar.jl:215
arg_write at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\ArgTools\src\ArgTools.jl:112
#82 at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Tar\src\Tar.jl:214 [inlined]
arg_mkdir at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\ArgTools\src\ArgTools.jl:163
#81 at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Tar\src\Tar.jl:210 [inlined]
#open#647 at .\process.jl:393
jfptr_YY.openYY.647_20644.clone_1 at D:\Julia\julia-1.6.2\lib\julia\sys.dll (unknown line)
open at .\process.jl:391
unknown function (ip: 0000000061104d74)
arg_read at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\ArgTools\src\ArgTools.jl:60 [inlined]
#extract#80 at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Tar\src\Tar.jl:209
unknown function (ip: 0000000061104c29)
extract##kw at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Tar\src\Tar.jl:204 [inlined]
#extract#87 at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Tar\src\Tar.jl:231 [inlined]
extract##kw at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Tar\src\Tar.jl:231
unknown function (ip: 0000000061104925)
#unpack#18 at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\PlatformEngines.jl:374
unpack##kw at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\PlatformEngines.jl:374 [inlined]
#install_archive#47 at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:592
install_archive##kw at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:575
jfptr_install_archiveYY.YY.kw_54404.clone_1 at D:\Julia\julia-1.6.2\lib\julia\sys.dll (unknown line)
macro expansion at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:786 [inlined]
#63 at .\task.jl:411
jfptr_YY.63_54251.clone_1 at D:\Julia\julia-1.6.2\lib\julia\sys.dll (unknown line)
jl_apply at /cygdrive/c/buildbot/worker/package_win64/build/src\julia.h:1703 [inlined]
start_task at /cygdrive/c/buildbot/worker/package_win64/build/src\task.c:839
Allocations: 1962196 (Pool: 1961710; Big: 486); GC: 3

ERROR:
@vtjnash
Copy link
Sponsor Member

vtjnash commented Jul 19, 2021

Seems this was introduced in JuliaLang/libuv@794bfdf, as NULL is documented as a valid result for the variable on that line, but that is not handled.

@vtjnash vtjnash added the regression Regression in behavior compared to a previous version label Jul 19, 2021
@vtjnash vtjnash modified the milestone: 1.7 Jul 19, 2021
@vtjnash vtjnash added backport 1.6 Change should be backported to release-1.6 backport 1.7 system:windows Affects only Windows labels Jul 19, 2021
@kapilash
Copy link
Author

Thanks @vtjnash
FWIW, I managed to revert the offending function to the corresponding implementation in the upstream repo and managed to proceed. I now have an installer with the above change on 1.6.2 that seemingly works.

@ILS07
Copy link

ILS07 commented Nov 29, 2021

I'm getting this error with the same steps running 1.6.3 or 1.6.4 portable on Windows 11. My PATH variable reflects my "install" location. If it will help, here's my output (first time posting, let me know if I broke any spoken or unspoken rules)...

   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.6.4 (2021-11-19)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(@v1.6) pkg> add HTTP
  Installing known registries into `D:\Julia`
     Cloning registry from "https://github.com/JuliaRegistries/General.git"
       Added registry `General` to `D:\Julia\registries\General`
   Resolving package versions...

Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x288a34b -- fs__chmod at /workspace/srcdir/libuv\src/win\fs.c:2360
in expression starting at none:0
fs__chmod at /workspace/srcdir/libuv\src/win\fs.c:2360
uv__fs_work at /workspace/srcdir/libuv\src/win\fs.c:3206
uv_fs_chmod at /workspace/srcdir/libuv\src/win\fs.c:3758
jl_fs_chmod at /cygdrive/c/buildbot/worker/package_win64/build/src\jl_uv.c:382
#chmod#31 at .\file.jl:1089
chmod at .\file.jl:1089 [inlined]
set_readonly at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\utils.jl:14
macro expansion at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:789 [inlined]
#63 at .\task.jl:411
jfptr_YY.63_22601.clone_1 at D:\Julia\lib\julia\sys.dll (unknown line)
jl_apply at /cygdrive/c/buildbot/worker/package_win64/build/src\julia.h:1703 [inlined]
start_task at /cygdrive/c/buildbot/worker/package_win64/build/src\task.c:834
Allocations: 9109347 (Pool: 9108898; Big: 449); GC: 8

ERROR: ERROR: ERROR: The pipe is being closed.The pipe is being closed.
The pipe is being closed.
[process exited with code 1]

@ajsagit
Copy link

ajsagit commented Feb 2, 2023

I'm getting this error with the same steps running 1.6.3 or 1.6.4 portable on Windows 11. My PATH variable reflects my "install" location. If it will help, here's my output (first time posting, let me know if I broke any spoken or unspoken rules)...

   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.6.4 (2021-11-19)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(@v1.6) pkg> add HTTP
  Installing known registries into `D:\Julia`
     Cloning registry from "https://github.com/JuliaRegistries/General.git"
       Added registry `General` to `D:\Julia\registries\General`
   Resolving package versions...

Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x288a34b -- fs__chmod at /workspace/srcdir/libuv\src/win\fs.c:2360
in expression starting at none:0
fs__chmod at /workspace/srcdir/libuv\src/win\fs.c:2360
uv__fs_work at /workspace/srcdir/libuv\src/win\fs.c:3206
uv_fs_chmod at /workspace/srcdir/libuv\src/win\fs.c:3758
jl_fs_chmod at /cygdrive/c/buildbot/worker/package_win64/build/src\jl_uv.c:382
#chmod#31 at .\file.jl:1089
chmod at .\file.jl:1089 [inlined]
set_readonly at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\utils.jl:14
macro expansion at C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:789 [inlined]
#63 at .\task.jl:411
jfptr_YY.63_22601.clone_1 at D:\Julia\lib\julia\sys.dll (unknown line)
jl_apply at /cygdrive/c/buildbot/worker/package_win64/build/src\julia.h:1703 [inlined]
start_task at /cygdrive/c/buildbot/worker/package_win64/build/src\task.c:834
Allocations: 9109347 (Pool: 9108898; Big: 449); GC: 8

ERROR: ERROR: ERROR: The pipe is being closed.The pipe is being closed.
The pipe is being closed.
[process exited with code 1]

win11 and win10, PCs and laptops.
All Julia can not add any pkgs. Any solutions please 'cause I can not use Julia for such a long time.
New OS, New installations of Julia.
But it seems no others meet this problem or users are too less? No way I have checked some online information by date.
Totally dont know what happened and what need to be done for solving this err.
Thank you very much!

@stevengj
Copy link
Member

stevengj commented Feb 6, 2023

Note that someone reported what looks like the same issue recently with Julia 1.8.5. Is there any prospect of a fix? Looks like this is waiting on JuliaLang/libuv#16

Is there a workaround in the meantime? Some way to prevent GetNamedSecurityInfoW from returning NULL by changing the permissions or something?

(On discourse, the OP worked around the problem from changing the tmp directory from a RAM disk back to the ordinary drive. Maybe the problem arises simply if you have a tmp directory on a volume that does not have enough space?)

@ajsagit
Copy link

ajsagit commented Feb 8, 2023

Thank you sooooooooo much for your reply!!
I use ramdisk on my pc with 2Gb space. I have give it a try to cancel the ramdisk and rechange the path of tmp and temp folder to a C:\ path, then reboot, the err still there.
Is it kinda possible the network linked to Github with problem? I have ping to Github.com, sometimes returns null but after retry, no problem for pinging.
Then I try to install pkgs locally by disconnecting the internet, the err still there, add Pkg no problem, but add CSV, add CUDA, etc. the same err. I also try to install the latest Pipe, still no help, maybe no biz with this at all.
Thanks a million!

@ajsagit
Copy link

ajsagit commented Feb 8, 2023

Note that someone reported what looks like the same issue recently with Julia 1.8.5. Is there any prospect of a fix? Looks like this is waiting on JuliaLang/libuv#16

Is there a workaround in the meantime? Some way to prevent GetNamedSecurityInfoW from returning NULL by changing the permissions or something?

(On discourse, the OP worked around the problem from changing the tmp directory from a RAM disk back to the ordinary drive. Maybe the problem arises simply if you have a tmp directory on a volume that does not have enough space?)

And I just asked ChatGPT, It seems ramdisk do lock some part of memory, I will give it a check, if it can be solved I will feedback.

An err with “EXCEPTION_ACCESS_VIOLATION at” and “fs__chmod at /workspace/srcdir/libuv\src/win\fs.c”, the possible reasons and the solutions please?

The "EXCEPTION_ACCESS_VIOLATION at" error is often caused by a memory access violation in the code. This can happen when the code is trying to access memory that it does not have permission to access. The "fs__chmod at /workspace/srcdir/libuv\src/win\fs.c" part of the error message indicates that the error is related to the fs__chmod function in the libuv library on Windows.

Possible reasons for this error include:

  1. Attempting to modify a read-only file: If you are trying to modify a read-only file, you will get this error. To fix this, change the file's permissions to allow write access.

  2. Incorrect file path: If you are passing an incorrect file path to the fs__chmod function, you will get this error. Ensure that the file path is correct.

  3. Memory corruption: If the memory being used by the fs__chmod function is corrupted, you will get this error. This can be caused by a variety of reasons such as buffer overflows, stack overflows, or heap corruption.
    Solutions:

  4. Check file permissions: Make sure that you have permission to modify the file you are trying to change.

  5. Verify the file path: Check the file path that you are passing to the fs__chmod function and ensure that it is correct.

  6. Debug the code: Debug the code to find the root cause of the memory corruption. This can be done using tools such as Valgrind, gdb, or a memory profiler.

  7. Update the library: If the error is related to the libuv library, try updating the library to the latest version.

  8. Report the bug: If the issue persists, report the bug to the developers of the library or the software you are using.

But the problem is I have done nothing on my PCs, before all work fine, but suddenly cannot work and I never update any software.

@ajsagit
Copy link

ajsagit commented Feb 12, 2023

Note that someone reported what looks like the same issue recently with Julia 1.8.5. Is there any prospect of a fix? Looks like this is waiting on JuliaLang/libuv#16

Is there a workaround in the meantime? Some way to prevent GetNamedSecurityInfoW from returning NULL by changing the permissions or something?

(On discourse, the OP worked around the problem from changing the tmp directory from a RAM disk back to the ordinary drive. Maybe the problem arises simply if you have a tmp directory on a volume that does not have enough space?)

Report:
It is a bug indeed. And Ramdisk is not a problem.
4 TEMP paths on Win OS, TEMP and TMP, for current user and system.
Reset all temp paths and if only the TMP path for user is located to C:, no err at all and All Pkgs installing very fast.
But D:\ E:\ etc can not work.
No need to reboot.
mklink /j C:\tmp Ramdisk path:\tmp can not work maybe because it's not a directory.
TMP folder must actually exist in C:.

Cheers!

@brenhinkeller
Copy link
Sponsor Contributor

I'm assuming this is fixed now?

@MilesCranmer
Copy link
Sponsor Member

Ping. This is a top google result... should be closed or fixed ASAP.

@Tortar
Copy link
Contributor

Tortar commented Sep 13, 2024

I have the same problem when trying to add any package on a Windows portable version of Julia 1.10 when I set the depot path to be inside the usb disk:

C:\Users\bob>if not exist "D:\JuliaPortable\JuliaPkg1.10.5" mkdir D:\JuliaPortable\JuliaPkg1.10.5

C:\Users\bob>set JULIA_DEPOT_PATH=D:\JuliaPortable\JuliaPkg1.10.5

C:\Users\bob>D:\JuliaPortable\julia-1.10.5\bin\julia.exe
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.10.5 (2024-08-27)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

(@v1.10) pkg> add PrecompileTools

Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x7ff891cb66b2 -- fs__chmod at /workspace/srcdir/libuv\src/win\fs.c:2372
in expression starting at none:0
fs__chmod at /workspace/srcdir/libuv\src/win\fs.c:2372
uv__fs_work at /workspace/srcdir/libuv\src/win\fs.c:3218
uv_fs_chmod at /workspace/srcdir/libuv\src/win\fs.c:3774
jl_fs_chmod at C:/workdir/src\jl_uv.c:461
#chmod#34 at .\file.jl:1155
chmod at .\file.jl:1154 [inlined]
#rm#10 at .\file.jl:280
rm at .\file.jl:273 [inlined]
tryrmopenfile at C:\workdir\usr\share\julia\stdlib\v1.10\FileWatching\src\pidfile.jl:308
close at C:\workdir\usr\share\julia\stdlib\v1.10\FileWatching\src\pidfile.jl:338
#mkpidlock#7 at C:\workdir\usr\share\julia\stdlib\v1.10\FileWatching\src\pidfile.jl:95
mkpidlock at C:\workdir\usr\share\julia\stdlib\v1.10\FileWatching\src\pidfile.jl:90 [inlined]
#mkpidlock#6 at C:\workdir\usr\share\julia\stdlib\v1.10\FileWatching\src\pidfile.jl:88 [inlined]
mkpidlock at C:\workdir\usr\share\julia\stdlib\v1.10\FileWatching\src\pidfile.jl:88 [inlined]
write_env_usage at C:\workdir\usr\share\julia\stdlib\v1.10\Pkg\src\Types.jl:545
EnvCache at C:\workdir\usr\share\julia\stdlib\v1.10\Pkg\src\Types.jl:383
EnvCache at C:\workdir\usr\share\julia\stdlib\v1.10\Pkg\src\Types.jl:362 [inlined]
Context at C:\workdir\usr\share\julia\stdlib\v1.10\Pkg\src\Types.jl:412
#add#27 at C:\workdir\usr\share\julia\stdlib\v1.10\Pkg\src\API.jl:150
add at C:\workdir\usr\share\julia\stdlib\v1.10\Pkg\src\API.jl:148
jfptr_add_102626.1 at D:\JuliaPortable\julia-1.10.5\lib\julia\sys.dll (unknown line)
do_cmd! at C:\workdir\usr\share\julia\stdlib\v1.10\Pkg\src\REPLMode\REPLMode.jl:412
#do_cmd#21 at C:\workdir\usr\share\julia\stdlib\v1.10\Pkg\src\REPLMode\REPLMode.jl:390
do_cmd at C:\workdir\usr\share\julia\stdlib\v1.10\Pkg\src\REPLMode\REPLMode.jl:380 [inlined]
#24 at C:\workdir\usr\share\julia\stdlib\v1.10\Pkg\src\REPLMode\REPLMode.jl:557
jfptr_YY.24_104261.1 at D:\JuliaPortable\julia-1.10.5\lib\julia\sys.dll (unknown line)
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
jl_f__call_latest at C:/workdir/src\builtins.c:812
#invokelatest#2 at .\essentials.jl:892 [inlined]
invokelatest at .\essentials.jl:889 [inlined]
run_interface at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\LineEdit.jl:2656
jfptr_run_interface_94754.1 at D:\JuliaPortable\julia-1.10.5\lib\julia\sys.dll (unknown line)
run_frontend at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:1312
#62 at C:\workdir\usr\share\julia\stdlib\v1.10\REPL\src\REPL.jl:386
jfptr_YY.62_95901.1 at D:\JuliaPortable\julia-1.10.5\lib\julia\sys.dll (unknown line)
jl_apply at C:/workdir/src\julia.h:1982 [inlined]
start_task at C:/workdir/src\task.c:1238
Allocations: 1671861 (Pool: 1670529; Big: 1332); GC: 3
┌ Warning: failed to remove pidfile on close
│   path = "D:\\JuliaPortable\\JuliaPkg1.10.5\\logs\\manifest_usage.toml.pid"
│   removed = false
└ @ FileWatching.Pidfile D:\JuliaPortable\julia-1.10.5\share\julia\stdlib\v1.10\FileWatching\src\pidfile.jl:342

Is there any workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.6 Change should be backported to release-1.6 regression Regression in behavior compared to a previous version system:windows Affects only Windows
Projects
None yet
Development

No branches or pull requests

10 participants