Skip to content

Crash on non-ascii version in dune-project #12751

@cuihtlauac

Description

@cuihtlauac

Expected Behavior

Normal behaviour

Actual Behavior

Crash

Reproduction

mkdir foo
cd foo
echo "(lang dune è)" > dune-project
dune build

Output

Internal error, please report upstream including the contents of _build/log.
Description:
  ("Dune_lang.Atom.of_string got invalid atom", { atom = "\195\168" })
Raised at Stdune__Code_error.raise in file "stdune__Code_error.ml", line 11,
  characters 30-62
Called from Dune_sexp__Versioned_file.Make.Lang.parse in file
  "dune_sexp__Versioned_file.ml", line 65, characters 26-44
Called from Dune_sexp__Versioned_file.Make.parse_lang_exn in file
  "dune_sexp__Versioned_file.ml", line 92, characters 15-36
Called from Dune_sexp__Versioned_file.Make.parse_contents in file
  "dune_sexp__Versioned_file.ml" (inlined), line 104, characters 14-31
Called from Dune_lang__Dune_project.load_dune_project in file
  "dune_lang__Dune_project.ml", line 1031, characters 2-77
Called from Fiber__Scheduler.exec in file "fiber__Scheduler.ml", line 77,
  characters 8-11
-> required by ("<unnamed>", ())
-> required by ("dune_load", ())
-> required by ("Super_context.all", ())
-> required by ("toplevel", ())

I must not crash.  Uncertainty is the mind-killer. Exceptions are the
little-death that brings total obliteration.  I will fully express my cases. 
Execution will pass over me and through me.  And when it has gone past, I
will unwind the stack along its path.  Where the cases are handled there will
be nothing.  Only I will remain.

Specifications

  • Version of dune (output of dune --version): 3.20.2
  • Version of ocaml (output of ocamlc --version): 5.3.0
  • Operating system (distribution and version): Ubuntu 25.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggood first issueGood for contributing for the first time to the Dune codebase

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions