Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scala scripts hanging indefinitely on Mac OS. #10744

Open
friedbrice opened this issue Feb 21, 2018 · 4 comments

Comments

Projects
None yet
3 participants
@friedbrice
Copy link

commented Feb 21, 2018

Basic Scala scripts are hanging indefinitely without executing when invoked on Mac OS.

Here is a minimal example:

#!/bin/sh
exec scala "$0" "$@"
!#

println("hello, world")

Executing this script at the command line does not produce any output and does not exit.

Here are the outputs of scala -version, java -version, and sw_vers:

$ scala -version
Scala code runner version 2.12.4 -- Copyright 2002-2017, LAMP/EPFL and Lightbend, Inc.
$ java -version
java version "1.8.0_152"
Java(TM) SE Runtime Environment (build 1.8.0_152-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)
$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.13.3
BuildVersion:	17D47

@friedbrice friedbrice changed the title Scala scripts hanging indefinitely. Scala scripts hanging indefinitely on Mac OS. Feb 21, 2018

@SethTisue

This comment has been minimized.

Copy link
Member

commented Feb 21, 2018

does running fsc -shutdown first fix it?

and/or, does adding -nocompdaemon after exec scala fix it?

when it hangs, what does a thread dump show?

@friedbrice

This comment has been minimized.

Copy link
Author

commented Feb 21, 2018

fsc -shutdown hangs indefinitely.

Adding -nocompdaemon after exec scala results in a working shell script.

Thanks much!

@alvinj

This comment has been minimized.

Copy link

commented Apr 16, 2019

It looks like this is an old bug, but I just started having the same problem after upgrading to MacOS 10.14.4: old Scala shell scripts that used to work no longer work. But adding -nocompdaemon after exec scala fixes the problem. Thanks!

@SethTisue

This comment has been minimized.

Copy link
Member

commented Apr 16, 2019

-nocompdaemon will be the default starting with Scala 2.13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.