Skip to content

Segfault upon stack overflow in child thread. #7490

@vicuna

Description

@vicuna

Original bug ID: 7490
Reporter: wintersteiger
Assigned to: @mshinwell
Status: assigned (set by @mshinwell on 2017-02-24T14:39:24Z)
Resolution: open
Priority: normal
Severity: crash
Platform: amd64
OS: Ubuntu
OS Version: 16.04
Version: 4.04.0
Category: threads
Monitored by: @gasche

Bug description

This works as expected:

let rec thread_fun _ =
try
thread_fun ()
with
Stack_overflow -> Printf.printf "caught exn\n"

let _ = thread_fun () ; ()

But when thread_fun is called like so:

let _ =
Thread.join (Thread.create thread_fun ()) ;
()

then it segfaults.

Steps to reproduce

Compile with ocamlopt -thread unix.cmxa threads.cmxa stackoverflow.ml -o stackoverflow
Run ./stackoverflow

Additional information

Problem originally encountered in FStar, see here: FStarLang/FStar#870

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions