Skip to content

Commit

Permalink
CA-399172: fix potential crash in Uri.of_string
Browse files Browse the repository at this point in the history
Using Lazy from a multithreaded program should raise Lazy.Undefined.
However due to bugs in the OCaml runtime this was actually crashing.

Update to angstrom 0.16.1 which no longer uses Lazy and avoids this crash.

This was initially discovered:
* mirage/ocaml-uri#178

Fixed in Angstrom:
* inhabitedtype/angstrom#229

Runtime bug reported with potential fix from maintainers:
* ocaml/ocaml#13430
* ocaml/ocaml#13434

There are various other usages of Lazy, but I couldn't get those to crash yet,
so lets fix the known crash for now, and audit/fix the rest next.

Signed-off-by: Edwin Török <edwin.torok@cloud.com>
  • Loading branch information
edwintorok committed Sep 13, 2024
1 parent 3708e3d commit a6396b6
Showing 1 changed file with 20 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
opam-version: "2.0"
name: "angstrom"
version: "0.16.0"
synopsis: "Parser combinators built for speed and memory-efficiency"
description: """\
Angstrom is a parser-combinator library that makes it easy to write efficient,
expressive, and reusable parsers suitable for high-performance applications. It
exposes monadic and applicative interfaces for composition, and supports
incremental input through buffered and unbuffered interfaces. Both interfaces
give the user total control over the blocking behavior of their application,
with the unbuffered interface enabling zero-copy IO. Parsers are backtracking by
default and support unbounded lookahead."""
maintainer: "Spiros Eliopoulos <spiros@inhabitedtype.com>"
authors: "Spiros Eliopoulos <spiros@inhabitedtype.com>"
license: "BSD-3-Clause"
authors: [ "Spiros Eliopoulos <spiros@inhabitedtype.com>" ]
license: "BSD-3-clause"
homepage: "https://github.com/inhabitedtype/angstrom"
bug-reports: "https://github.com/inhabitedtype/angstrom/issues"
dev-repo: "git+https://github.com/inhabitedtype/angstrom.git"
build: [
["dune" "subst"] {dev}
["dune" "build" "-p" name "-j" jobs]
["dune" "runtest" "-p" name "-j" jobs] {with-test}
]
depends: [
"ocaml" {>= "4.04.0"}
"dune" {>= "1.8"}
Expand All @@ -23,16 +18,19 @@ depends: [
"ppx_let" {with-test & >= "v0.14.0"}
"ocaml-syntax-shims" {build}
]
build: [
["dune" "subst"] {dev}
["dune" "build" "-p" name "-j" jobs]
["dune" "runtest" "-p" name "-j" jobs] {with-test}
]
dev-repo: "git+https://github.com/inhabitedtype/angstrom.git"
synopsis: "Parser combinators built for speed and memory-efficiency"
description: """
Angstrom is a parser-combinator library that makes it easy to write efficient,
expressive, and reusable parsers suitable for high-performance applications. It
exposes monadic and applicative interfaces for composition, and supports
incremental input through buffered and unbuffered interfaces. Both interfaces
give the user total control over the blocking behavior of their application,
with the unbuffered interface enabling zero-copy IO. Parsers are backtracking by
default and support unbounded lookahead."""
url {
src: "https://github.com/inhabitedtype/angstrom/archive/0.16.0.tar.gz"
src: "https://github.com/inhabitedtype/angstrom/archive/0.16.1.tar.gz"
checksum: [
"sha256=47810bd31306d57c0ac83eb3f95b1cb6f8bdda99457aa6e6bcd02f6ddb8410f0"
"md5=58ebc718a920c31ec3eb38f4aa1bea51"
"md5=a9e096b4b2b8e4e3bb17d472bbccaad0"
"sha256=143536fb4d049574c539b9990840615e078ed3dd94e1d24888293f68349a100b"
]
}

0 comments on commit a6396b6

Please sign in to comment.