JuliaData/CSV.jl

CSV.jl fails to precompile on Ubuntu server, v0.10.5 and up.

AntonOresten opened this issue · 2 comments

Description

I am encountering a precompilation error with CSV.jl on an Ubuntu server. This issue starts from version 0.10.5.

Environment

  • Julia Version: 1.9.4
  • CSV.jl Version: 0.10.5 and above
  • OS: Ubuntu 22.04

Expected behavior

Upon adding the latest version of CSV to an environment, it should precompile successfully

Actual behavior

Attempting to precompiling CSV version v0.10.5 and up results in a segmentation fault.
To avoid cluttering this issue, I pasted the logs of the failed precompilation to pastebin: https://pastebin.com/Wr8Aw3q1

Successful downgrade

It successfully precompiles when I downgrade from v0.10.11 to v0.10.4, fails when I upgrade from v0.10.4 to v0.10.5, and succeeds again when I downgrade from v0.10.5 to v0.10.4.

(@v1.9) pkg> add CSV@0.10.4
   Resolving package versions...
    Updating `~/.julia/environments/v1.9/Project.toml`
⌃ [336ed68f] ↓ CSV v0.10.11 ⇒ v0.10.4
    Updating `~/.julia/environments/v1.9/Manifest.toml`
⌃ [336ed68f] ↓ CSV v0.10.11 ⇒ v0.10.4
  [76eceee3] - WorkerUtilities v1.6.1
        Info Packages marked with ⌃ have new versions available and may be upgradable.

(@v1.9) pkg> add CSV@0.10.5
   Resolving package versions...
    Updating `~/.julia/environments/v1.9/Project.toml`
⌃ [336ed68f] ↑ CSV v0.10.4 ⇒ v0.10.5
    Updating `~/.julia/environments/v1.9/Manifest.toml`
⌃ [336ed68f] ↑ CSV v0.10.4 ⇒ v0.10.5
  [66db9d55] + SnoopPrecompile v1.0.3
        Info Packages marked with ⌃ have new versions available and may be upgradable.
Precompiling project...
  ✗ CSV
  0 dependencies successfully precompiled in 4 seconds. 25 already precompiled.
  1 dependency errored. To see a full report either run `import Pkg; Pkg.precompile()` or load the package

(@v1.9) pkg> add CSV@0.10.4
   Resolving package versions...
    Updating `~/.julia/environments/v1.9/Project.toml`
⌃ [336ed68f] ↓ CSV v0.10.5 ⇒ v0.10.4
    Updating `~/.julia/environments/v1.9/Manifest.toml`
⌃ [336ed68f] ↓ CSV v0.10.5 ⇒ v0.10.4
  [66db9d55] - SnoopPrecompile v1.0.3
        Info Packages marked with ⌃ have new versions available and may be upgradable.

Dependencies observation

We can see that there are some changes in dependencies between these versions, which may or may not be relevant to the issue. Notably, SnoopPrecompile is introduced in the versions where the problem occurs, which might affect the precompilation process.

Additional context

I'm using the MLDatasets package, which has this package as a dependency. It runs fine even with the older version.

Thank you for looking into this issue. I am happy to provide any additional information if needed.

I am having the same issue on Windows. Upgrading from version 0.14.4 to 0.14.5 or the latest version result in the precompilation error below.

Edit: The problem is also resolved by upgrading Julia to v1.10.0.

Exception: EXCEPTION_ACCESS_VIOLATION at 0x18ddf42 -- .text$_ZN4llvm19MachineRegisterInfo22addRegOperandToUseListEPNS_14MachineOperandE at C:\Program Files\julia\current\bin\libLLVM-14jl.dll (unknown line)
in expression starting at C:\Users\USERNAME\AppData\Local\Julia\packages\CSV\aoJqo\src\precompile.jl:3
.text$_ZN4llvm19MachineRegisterInfo22addRegOperandToUseListEPNS_14MachineOperandE at C:\Program Files\julia\current\bin\libLLVM-14jl.dll 
(unknown line)
.text$_ZN4llvm12MachineInstr10addOperandERNS_15MachineFunctionERKNS_14MachineOperandE at C:\Program Files\julia\current\bin\libLLVM-14jl.dll (unknown line)
_ZN4llvm7BuildMIERNS_17MachineBasicBlockERNS_12MachineInstrERKNS_8DebugLocERKNS_11MCInstrDescENS_8RegisterE at C:\Program Files\julia\current\bin\libLLVM-14jl.dll (unknown line)
.text$_ZNK4llvm17X86TargetLowering27EmitInstrWithCustomInserterERNS_12MachineInstrEPNS_17MachineBasicBlockE at C:\Program Files\julia\current\bin\libLLVM-14jl.dll (unknown line)
.text$_ZN12_GLOBAL__N_112FinalizeISel20runOnMachineFunctionERN4llvm15MachineFunctionE at C:\Program Files\julia\current\bin\libLLVM-14jl.dll (unknown line)
.text$_ZN4llvm19MachineFunctionPass13runOnFunctionERNS_8FunctionE at C:\Program Files\julia\current\bin\libLLVM-14jl.dll (unknown line)  
.text$_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE at C:\Program Files\julia\current\bin\libLLVM-14jl.dll (unknown line)
.text$_ZN4llvm13FPPassManager11runOnModuleERNS_6ModuleE at C:\Program Files\julia\current\bin\libLLVM-14jl.dll (unknown line)
.text$_ZN4llvm6legacy15PassManagerImpl3runERNS_6ModuleE at C:\Program Files\julia\current\bin\libLLVM-14jl.dll (unknown line)
.text$_ZN4llvm3orc14SimpleCompilerclERNS_6ModuleE at C:\Program Files\julia\current\bin\libLLVM-14jl.dll (unknown line)
operator() at C:/workdir/src\jitlayers.cpp:1206
.text$_ZN4llvm3orc14IRCompileLayer4emitESt10unique_ptrINS0_29MaterializationResponsibilityESt14default_deleteIS3_EENS0_16ThreadSafeModuleE at C:\Program Files\julia\current\bin\libLLVM-14jl.dll (unknown line)
.text$_ZN4llvm3orc16IRTransformLayer4emitESt10unique_ptrINS0_29MaterializationResponsibilityESt14default_deleteIS3_EENS0_16ThreadSafeModuleE at C:\Program Files\julia\current\bin\libLLVM-14jl.dll (unknown line)
emit at C:/workdir/src\jitlayers.cpp:631
.text$_ZN4llvm3orc31BasicIRLayerMaterializationUnit11materializeESt10unique_ptrINS0_29MaterializationResponsibilityESt14default_deleteIS3_EE at C:\Program Files\julia\current\bin\libLLVM-14jl.dll (unknown line)
.text$_ZN4llvm3orc19MaterializationTask3runEv at C:\Program Files\julia\current\bin\libLLVM-14jl.dll (unknown line)
_ZN4llvm6detail18UniqueFunctionBaseIvJSt10unique_ptrINS_3orc4TaskESt14default_deleteIS4_EEEE8CallImplIPFvS7_EEEvPvRS7_ at C:\Program Files\julia\current\bin\libLLVM-14jl.dll (unknown line)
.text$_ZN4llvm3orc16ExecutionSession22dispatchOutstandingMUsEv at C:\Program Files\julia\current\bin\libLLVM-14jl.dll (unknown line)     
.text$_ZN4llvm3orc16ExecutionSession17OL_completeLookupESt10unique_ptrINS0_21InProgressLookupStateESt14default_deleteIS3_EESt10shared_ptrINS0_23AsynchronousSymbolQueryEESt8functionIFvRKNS_8DenseMapIPNS0_8JITDylibENS_8DenseSetINS0_15SymbolStringPtrENS_12DenseMapInfoISF_vEEEENSG_ISD_vEENS_6detail12DenseMapPairISD_SI_EEEEEE at C:\Program Files\julia\current\bin\libLLVM-14jl.dll (unknown line)
_ZN4llvm3orc25InProgressFullLookupState8completeESt10unique_ptrINS0_21InProgressLookupStateESt14default_deleteIS3_EE at C:\Program Files\julia\current\bin\libLLVM-14jl.dll (unknown line)
.text$_ZN4llvm3orc16ExecutionSession19OL_applyQueryPhase1ESt10unique_ptrINS0_21InProgressLookupStateESt14default_deleteIS3_EENS_5ErrorE at C:\Program Files\julia\current\bin\libLLVM-14jl.dll (unknown line)
.text$_ZN4llvm3orc16ExecutionSession6lookupENS0_10LookupKindERKSt6vectorISt4pairIPNS0_8JITDylibENS0_19JITDylibLookupFlagsEESaIS8_EENS0_15SymbolLookupSetENS0_11SymbolStateENS_15unique_functionIFvNS_8ExpectedINS_8DenseMapINS0_15SymbolStringPtrENS_18JITEvaluatedSymbolENS_12DenseMapInfoISI_vEENS_6detail12DenseMapPairISI_SJ_EEEEEEEEESt8functionIFvRKNSH_IS6_NS_8DenseSetISI_SL_EENSK_IS6_vEENSN_IS6_SV_EEEEEE at C:\Program Files\julia\current\bin\libLLVM-14jl.dll (unknown line)
.text$_ZN4llvm3orc16ExecutionSession6lookupERKSt6vectorISt4pairIPNS0_8JITDylibENS0_19JITDylibLookupFlagsEESaIS7_EERKNS0_15SymbolLookupSetENS0_10LookupKindENS0_11SymbolStateESt8functionIFvRKNS_8DenseMapIS5_NS_8DenseSetINS0_15SymbolStringPtrENS_12DenseMapInfoISK_vEEEENSL_IS5_vEENS_6detail12DenseMapPairIS5_SN_EEEEEE at C:\Program Files\julia\current\bin\libLLVM-14jl.dll (unknown line)
.text$_ZN4llvm3orc16ExecutionSession6lookupERKSt6vectorISt4pairIPNS0_8JITDylibENS0_19JITDylibLookupFlagsEESaIS7_EENS0_15SymbolStringPtrENS0_11SymbolStateE at C:\Program Files\julia\current\bin\libLLVM-14jl.dll (unknown line)
.text$_ZN4llvm3orc16ExecutionSession6lookupENS_8ArrayRefIPNS0_8JITDylibEEENS0_15SymbolStringPtrENS0_11SymbolStateE at C:\Program Files\julia\current\bin\libLLVM-14jl.dll (unknown line)
.text$_ZN4llvm3orc16ExecutionSession6lookupENS_8ArrayRefIPNS0_8JITDylibEEENS_9StringRefENS0_11SymbolStateE at C:\Program Files\julia\current\bin\libLLVM-14jl.dll (unknown line)
addModule at C:/workdir/src\jitlayers.cpp:1420
jl_add_to_ee at C:/workdir/src\jitlayers.cpp:1815
jl_add_to_ee at C:/workdir/src\jitlayers.cpp:1794
jl_add_to_ee at C:/workdir/src\jitlayers.cpp:1794
jl_add_to_ee at C:/workdir/src\jitlayers.cpp:1794
jl_add_to_ee at C:/workdir/src\jitlayers.cpp:1794
_jl_compile_codeinst at C:/workdir/src\jitlayers.cpp:241
jl_generate_fptr_impl at C:/workdir/src\jitlayers.cpp:460
jl_compile_method_internal at C:/workdir/src\gf.c:2348
jl_compile_method_internal at C:/workdir/src\gf.c:2241 [inlined]
_jl_invoke at C:/workdir/src\gf.c:2750 [inlined]
ijl_apply_generic at C:/workdir/src\gf.c:2940
File at C:\Users\USERNAME\AppData\Local\Julia\packages\CSV\aoJqo\src\file.jl:290
File at C:\Users\USERNAME\AppData\Local\Julia\packages\CSV\aoJqo\src\file.jl:227 [inlined]
#File#32 at C:\Users\USERNAME\AppData\Local\Julia\packages\CSV\aoJqo\src\file.jl:223 [inlined]
File at C:\Users\USERNAME\AppData\Local\Julia\packages\CSV\aoJqo\src\file.jl:162
unknown function (ip: 000001896d547b35)
macro expansion at C:\Users\USERNAME\AppData\Local\Julia\packages\CSV\aoJqo\src\precompile.jl:10 [inlined]
macro expansion at C:\Users\USERNAME\AppData\Local\Julia\packages\PrecompileTools\kmH5L\src\workloads.jl:78 [inlined]
macro expansion at C:\Users\USERNAME\AppData\Local\Julia\packages\CSV\aoJqo\src\precompile.jl:7 [inlined]
top-level scope at C:\Users\USERNAME\AppData\Local\Julia\packages\PrecompileTools\kmH5L\src\workloads.jl:140
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:903
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:856
ijl_toplevel_eval at C:/workdir/src\toplevel.c:921 [inlined]
ijl_toplevel_eval_in at C:/workdir/src\toplevel.c:971
eval at .\boot.jl:370 [inlined]
include_string at .\loading.jl:1903
_include at .\loading.jl:1963
include at .\Base.jl:457
jfptr_include_38014.clone_1 at C:\Program Files\julia\current\lib\julia\sys.dll (unknown line)
jl_apply at C:/workdir/src\julia.h:1880 [inlined]
jl_f__call_latest at C:/workdir/src\builtins.c:774
include at C:\Users\USERNAME\AppData\Local\Julia\packages\CSV\aoJqo\src\CSV.jl:24
unknown function (ip: 000001896d4f0346)
jl_apply at C:/workdir/src\julia.h:1880 [inlined]
do_call at C:/workdir/src\interpreter.c:126
eval_value at C:/workdir/src\interpreter.c:226
eval_stmt_value at C:/workdir/src\interpreter.c:177 [inlined]
eval_body at C:/workdir/src\interpreter.c:624
jl_interpret_toplevel_thunk at C:/workdir/src\interpreter.c:762
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:912
jl_eval_module_expr at C:/workdir/src\toplevel.c:203 [inlined]
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:715
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:856
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:856
ijl_toplevel_eval at C:/workdir/src\toplevel.c:921 [inlined]
ijl_toplevel_eval_in at C:/workdir/src\toplevel.c:971
eval at .\boot.jl:370 [inlined]
include_string at .\loading.jl:1903
_include at .\loading.jl:1963
include at .\Base.jl:457 [inlined]
include_package_for_output at .\loading.jl:2049
jfptr_include_package_for_output_33121.clone_1 at C:\Program Files\julia\current\lib\julia\sys.dll (unknown line)
jl_apply at C:/workdir/src\julia.h:1880 [inlined]
do_call at C:/workdir/src\interpreter.c:126
eval_value at C:/workdir/src\interpreter.c:226
eval_stmt_value at C:/workdir/src\interpreter.c:177 [inlined]
eval_body at C:/workdir/src\interpreter.c:624
jl_interpret_toplevel_thunk at C:/workdir/src\interpreter.c:762
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:912
jl_toplevel_eval_flex at C:/workdir/src\toplevel.c:856
ijl_toplevel_eval at C:/workdir/src\toplevel.c:921 [inlined]
ijl_toplevel_eval_in at C:/workdir/src\toplevel.c:971
eval at .\boot.jl:370 [inlined]
include_string at .\loading.jl:1903
include_string at .\loading.jl:1913 [inlined]
exec_options at .\client.jl:305
_start at .\client.jl:522
jfptr__start_42472.clone_1 at C:\Program Files\julia\current\lib\julia\sys.dll (unknown line)
jl_apply at C:/workdir/src\julia.h:1880 [inlined]
true_main at C:/workdir/src\jlapi.c:573
jl_repl_entrypoint at C:/workdir/src\jlapi.c:717
mainCRTStartup at C:/workdir/cli\loader_exe.c:59
unknown function (ip: 00007fff31b17343)
RtlUserThreadStart at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
Allocations: 13395634 (Pool: 13378442; Big: 17192); GC: 19
ERROR: Failed to precompile CSV [336ed68f-0bac-5ca0-87d4-7b16caf5d00b] to "C:\\Users\\USERNAME\\AppData\\Local\\Julia\\compiled\\v1.9\\CSV\\jl_4BB7.tmp".
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
    @ Base .\loading.jl:2294
  [3] compilecache
    @ .\loading.jl:2167 [inlined]
  [4] _require(pkg::Base.PkgId, env::String)
    @ Base .\loading.jl:1805
  [5] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:1660
  [6] macro expansion
    @ .\loading.jl:1648 [inlined]
  [7] macro expansion
    @ .\lock.jl:267 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1611
  [9] eval
    @ .\boot.jl:370 [inlined]
 [10] eval
    @ .\Base.jl:68 [inlined]
 [11] repleval(m::Module, code::Expr, #unused#::String)
    @ VSCodeServer c:\Users\USERNAME\.vscode\extensions\julialang.language-julia-1.65.2\scripts\packages\VSCodeServer\src\repl.jl:229
 [12] (::VSCodeServer.var"#110#112"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
    @ VSCodeServer c:\Users\USERNAME\.vscode\extensions\julialang.language-julia-1.65.2\scripts\packages\VSCodeServer\src\repl.jl:192
 [13] with_logstate(f::Function, logstate::Any)
    @ Base.CoreLogging .\logging.jl:514
 [14] with_logger
    @ .\logging.jl:626 [inlined]
 [15] (::VSCodeServer.var"#109#111"{Module, Expr, REPL.LineEditREPL, REPL.LineEdit.Prompt})()
    @ VSCodeServer c:\Users\USERNAME\.vscode\extensions\julialang.language-julia-1.65.2\scripts\packages\VSCodeServer\src\repl.jl:193
 [16] #invokelatest#2
    @ .\essentials.jl:819 [inlined]
 [17] invokelatest(::Any)
    @ Base .\essentials.jl:816
 [18] macro expansion
    @ c:\Users\USERNAME\.vscode\extensions\julialang.language-julia-1.65.2\scripts\packages\VSCodeServer\src\eval.jl:34 [inlined]
 [19] (::VSCodeServer.var"#62#63")()
    @ VSCodeServer .\task.jl:514

I'm closing since this works on the latest stable release. Please reopen if necessary.