Seg fault when using julia (pakcage installation, profiling)

Hello,

I’m new to Julia so I don’t know if seg faults are a classic thing but anyway, I have one and I don’t know why.

I installed Julia using Juliaup

I’m on linux, so I just ran the command

curl -fsSL https://install.julialang.org | sh

While trying to understand somethings, I wanted to run the following code, which is a simple profiling code :

using Profile

function myfunc()
    A = rand(200, 200, 400)
    max_val = maximum(A)
    return max_val
end

println("function def ok") 

# First run to compile first 
myfunc()

println("first run ok") 

Profile.clear()

println("Profile clear ok") 

@profile for i in 1:5
    myfunc()
end

println("profiling ok") 

Profile.print()

When I tried to execute the code, by doing “julia code.jl” I got a seg fault.

Here’s the exact output :

function def ok
first run ok
Profile clear ok
Segmentation fault (core dumped)

As you can see, the execution reached the point where the profiling starts.

So I wanted to try another method for profiling and found a package called BenchmarkTools. When installing the package I also got a seg fault :

julia> import Pkg; Pkg.add("BenchmarkTools")
  Installing known registries into `~/.julia`
Segmentation fault (core dumped)

Even simple commands such as “pkg> st --manifest” give a seg fault :

(@v1.12) pkg> st --manifest
  Installing known registries into `~/.julia`
Segmentation fault (core dumped)

I’m using Julia version 1.12.1 (2025-10-17), installed using Juliaup
I’m on Ubuntu 24.04.2 LTS

Please tell me if you need more info, and thanks in advance for any help.

Your code can be run without any error on my linux machine. And I also installed julia via juliaup (the recommended way of installing).

Segfaults are not usual for me when writing daily code.

There is nothing normal about this.

It seems to me like a common factor for your segmentation faults are attempts to write files, possibly to /tmp. Can you successfully perform

julia> write("/tmp/test.txt", "test")

and

julia> write(expanduser("~/.julia/test.txt"), "test")

?

Hi,

Thanks for the replay.

When I executed the commands that you gave me, I got ‘4’ for each, which means the commands that you gave me worked 'since write function returns the number of bytes that have been written :

julia> write("/tmp/test.txt", "test")
4

julia> write(expanduser("~/.julia/test.txt"), "test")
4

Like you said, there’s nothing normal about this.

A colleague of mine suggested that it might be related to the C libraries that I have in my machine and the possibility that they are not compatible with what julia uses but everything else that I use that uses the C libs works fine so I don’t know.

Yes, that disproves my hypothesis. I also rather doubt that C libs should have anything to do with it. Ubuntu 24.04 is a very common platform to run Julia on.

You could try to run Julia in a debugger or with strace and see if that provides any hints.

Perhaps that is a hardware issue, either with your RAM or with your HD drive?

I’m not sure how to debug that, though. Are you overclocking your PC?

Can you run versioninfo(true) in Julia and send the result