jhh671
February 8, 2022, 7:24pm
1
19190, "jhh67", "parSafe heap can deadlock", "2022-02-04T23:03:40Z"
opened 11:03PM - 04 Feb 22 UTC
type: Bug
<!--
If you are filing an issue that is not a bug report, please feel free to e… rase
this template and describe the issue as clearly as possible.
-->
### Summary of Problem
<!--
What behavior did you observe when encountering this issue?
What behavior did you expect to observe?
Is this a blocking issue with no known work-arounds?
-->
A heap created with `parSafe=true` can deadlock under some sequences of operations, e.g. `push` followed by `pop` or `top`. `push` followed by `push` appears to work. I didn't try any other combinations. It wasn't obvious from looking at the code where the problem lies.
### Steps to Reproduce
**Source Code:**
```chapel
use Heap;
var h = new heap(int, parSafe=true);
h.push(1);
writeln(h.pop());
```
**Compile command:**
`chpl --no-devel foo.chpl`
**Execution command:**
<!-- e.g. `./foo -nl 4`
If an input file is required, include it as well. -->
`./foo`
**Associated Future Test(s):**
<!-- Are there any tests in Chapel's test system that demonstrate this issue?
e.g. [`test/path/to/foo.chpl`](
https://github.com/chapel-lang/chapel/blob/main/test/path/to/foo.chpl
) #1234 -->
### Configuration Information
- Output of `chpl --version`:
```
chpl version 1.26.0 pre-release (27f3d59788)
Copyright 2020-2022 Hewlett Packard Enterprise Development LP
Copyright 2004-2019 Cray Inc.
(See LICENSE file for more details)
```
- Output of `$CHPL_HOME/util/printchplenv --anonymize`:
```
CHPL_TARGET_PLATFORM: darwin
CHPL_TARGET_COMPILER: clang
CHPL_TARGET_ARCH: x86_64
CHPL_TARGET_CPU: native
CHPL_LOCALE_MODEL: flat
CHPL_COMM: none *
CHPL_TASKS: qthreads
CHPL_LAUNCHER: none
CHPL_TIMERS: generic
CHPL_UNWIND: none
CHPL_MEM: jemalloc
CHPL_ATOMICS: cstdlib
CHPL_GMP: none *
CHPL_HWLOC: bundled
CHPL_RE2: bundled
CHPL_LLVM: none *
CHPL_AUX_FILESYS: none
```
- Back-end compiler and version, e.g. `gcc --version` or `clang --version`:
```
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
```
- (For Cray systems only) Output of `module list`:
Summary of Problem
A heap created with parSafe=true
can deadlock under some sequences of operations, e.g. push
followed by pop
or top
. push
followed by push
appears to work. I didn't try any other combinations. It wasn't obvious from looking at the code where the problem lies.
Steps to Reproduce
Source Code:
use Heap;
var h = new heap(int, parSafe=true);
h.push(1);
writeln(h.pop());
Compile command:
chpl --no-devel foo.chpl
Execution command:
./foo
Associated Future Test(s):
Configuration Information
Output of chpl --version
:
chpl version 1.26.0 pre-release (27f3d59788)
Copyright 2020-2022 Hewlett Packard Enterprise Development LP
Copyright 2004-2019 Cray Inc.
(See LICENSE file for more details)
Output of $CHPL_HOME/util/printchplenv --anonymize
:
CHPL_TARGET_PLATFORM: darwin
CHPL_TARGET_COMPILER: clang
CHPL_TARGET_ARCH: x86_64
CHPL_TARGET_CPU: native
CHPL_LOCALE_MODEL: flat
CHPL_COMM: none *
CHPL_TASKS: qthreads
CHPL_LAUNCHER: none
CHPL_TIMERS: generic
CHPL_UNWIND: none
CHPL_MEM: jemalloc
CHPL_ATOMICS: cstdlib
CHPL_GMP: none *
CHPL_HWLOC: bundled
CHPL_RE2: bundled
CHPL_LLVM: none *
CHPL_AUX_FILESYS: none
Back-end compiler and version, e.g. gcc --version
or clang --version
:
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
(For Cray systems only) Output of module list
: