Skip to content

Null bytes in repl_history on shared home directories #36707

@lhupe

Description

@lhupe

I’m currently using julia on a network of Linux computers with shared home directories (via NFS). I’ve noticed that when I use REPLs on two machines simultaneously (which I do more or less every day), the repl_history.jl file gets corrupted by null bytes.

This is apparently independent of what I do during the simulatenous REPL sessions; I can reproduce the problem by immediately closing the REPLs after opening them. As soon as there are two sessions running at the same time on different hosts, the history file gets corrupted.

Example

This is an example sequence of commands to illustrate the problem, but I have found the problem to be independent of the order of closing or opening the REPLs, as soon as two are running simultaneously, the problem will occur.

On the first machine, open a REPL and run

julia> println("I have now started one REPL")

Then, open a REPL on a second machine an run

julia> println("and another one on a different machine")

Go back to the first machine and execute

julia> println("I will now close the first REPL"); exit()

thus closing the first REPL.

Now close the second REPL with

julia> println("and now the second one"); exit()

The resulting REPL history file (as displayed by vim running on the second machine) will be

# time: 2020-07-17 10:05:00 CEST
# mode: julia
        println("and another one on a different machine")
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@# time: 2020-07-17 10:05:32 CEST
# mode: julia
        println("and now the second one"); exit()

(where the ^@ represent the null bytes)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions