sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: go
Issue: cmd/compile: unexpected performance difference accessing slices with different caps
Labels: Performance,NeedsFix,compiler/runtime

Using tip (go version devel +b794ca64d2 Mon Sep 3 07:14:25 2018 +0000 linux/amd64)

While implementing some bounds check optimizations in `image/draw` [CL 136935](https://go-review.googlesource.com/c/go/+/136935) I came across an unexpected performance difference between accessing elements of a slice **s** created like this

    s := spix[i : i+4 : len(spix)]

and 

    s := spix[i : i+4 : i+4]

Both forms eliminate bound checks for accessing elements 0-3 of **s** but the second form has a significant performance improvement over the first (see CL for benchmarks). 

Building with `go build -gcflags="-d=ssa/check_bce/debug=1"` shows no difference in bounds checks between the two forms so presumably it has something to do with the resulting size of the slice.

Attached is a simple program and disassembly derived from the `image/draw` code that demonstrates the effect. You can see that the assembly generated for the second form is quite a bit shorter.

[bounds.go.txt](https://github.com/golang/go/files/2416170/bounds.go.txt)
[bounds.asm.txt](https://github.com/golang/go/files/2416169/bounds.asm.txt)
Repository: kubernetes
Issue: Allow adding more volumeClaimTemplates to an existing statefulSet
Labels: sig/storage,kind/feature

<!-- This form is for bug reports and feature requests ONLY!

If you're looking for help check [Stack Overflow](https://stackoverflow.com/questions/tagged/kubernetes) and the [troubleshooting guide](https://kubernetes.io/docs/tasks/debug-application-cluster/troubleshooting/).

If the matter is security related, please disclose it privately via https://kubernetes.io/security/.
-->

/kind feature
/sig storage

**What happened**:

Currently, you get this if you want to update an existing statefulSet with a new volumeClaimTemplate:

```
Error: UPGRADE FAILED: StatefulSet.apps "my-app" is invalid: spec: Forbidden: updates to statefulSet spec for fields other than 'replicas', 'template', and 'updateStrategy' are forbidden.
```


**What you expected to happen**:

Allow the creation of volumeClaimTemplates in a statefulSet.

**How to reproduce it (as minimally and precisely as possible)**:

For example:

```
    volumeClaimTemplates:
    - metadata:
        name: data
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 100Gi
 +   - metadata:
 +       name: data2
 +     spec:
 +       accessModes:
 +       - ReadWriteOnce
 +       resources:
 +         requests:
 +           storage: 100Gi
```

**Anything else we need to know?**:

Some background [here](https://stackoverflow.com/questions/52502074/add-additional-volumeclaimteplate-to-statefulset)

**Environment**:
- Kubernetes version (use `kubectl version`): all
- Cloud provider or hardware configuration: all
- OS (e.g. from /etc/os-release): all
- Kernel (e.g. `uname -a`): all
- Install tools:
- Others:
Repository: pytorch
Issue: cuda test hangs if GPUs in Exclusive Process mode
Labels: todo,module: cuda,triaged

Problem was seen on ppc64le, but should happen elsewhere as well (at
least on other linux platforms).

Problem is present since at least 0.4.1 (probably earlier) and still
exists.

Problem is seen with Anaconda's python 3.6; haven't tested with other
interpeters.

This is an issue in the test script, rather than with PyTorch itself.


Test `test_multinomial_invalid_probs_cuda` will hang if the system's
GPUs are in Exclusive Process mode, rather than in Default mode. See:
https://docs.nvidia.com/cuda/cuda-c-programming-guide/#compute-modes


The problem occurs when the `test_multinomial_invalid_probs_cuda` test
spawns child processes. Those fail to access the GPU because the main
process already has an active context. The child processes fail at the
top of `test_cuda.py` while trying to check for MAGMA support:

```
if TEST_CUDA:
    torch.ones(1).cuda()  # has_magma shows up after cuda is initialized
    TEST_MAGMA = torch.cuda.has_magma
```

That code raises a RuntimeException:

```
...
  File "/tmp/tmp.ymeGX7otav/test/test_cuda.py", line 34, in
    torch.ones(1).cuda() # has_magma shows up after cuda is initialized
RuntimeError: CUDA error: all CUDA-capable devices are busy or unavailable
```

That then repeats over and over forever.


Here's a test program that demonstrates the problem:

```
import multiprocessing as mp
import os

# True if you have GPUs in Exclusive mode; False to simulate
if True:
        import torch
        torch.ones(1).cuda()
else:
        if mp.current_process().name != 'MainProcess':
                raise RuntimeError('simulate Exclusive Mode exception')

def _spawn_method(method, ctype):
        ctx = mp.get_context(ctype)
        with ctx.Pool(1) as pool:
                return pool.map(method, [1, 2, 3])

def f(arg):
        return 'foo'

if __name__ == '__main__':
        print('From fork: {}'.format(_spawn_method(f, 'fork')))
        print('From spawn: {}'.format(_spawn_method(f, 'spawn')))
```

Note the problem does not occur when `fork` is used as the
multiprocessing context method, only when `spawn` is used.

I'm not exactly sure what causes the multiprocessing code to get stuck
here, but I suspect it's similar to the issue described at:

http://jessenoller.com/2009/01/08/multiprocessingpool-and-keyboardinterrupt/


I'm also not sure of the best fix. Some possibilities are:

- Switch the context method to `fork`? But is that available on Windows?

- Add a `try`/`except` in the code that's testing for MAGMA? But what do
  do there at both prevents the hang and doesn't disturb the rest of
  `test_cuda` if some other unrelated failure occurs?

- Detect Exclusive Process mode and skip this test in that case? Compute
  mode is included in the CUDA Device Properties, but that field isn't
  captured / exposed by PyTorch now. Would require work in
  `torch/csrc/cuda/Module.cpp`.

- Document a restriction, recommendation, or caution for Exclusive Mode.


cc @ngimel
Repository: opencv
Issue: Undefined reference to 'gluLookAt'  & 'gluPerspective'
Labels: bug,category: build/install,category: samples


##### System information (version)
- OpenCV =>3.4.0-rc
- Operating System / Platform => Fedora 28 x86_64
- Compiler => C++

##### Detailed description
Trying to compile from source but getting the following error.
 
`[` 86%] Linking CXX executable ../../bin/cpp-example-detect_mser
CMakeFiles/example_detect_mser.dir/detect_mser.cpp.o: In function `draw(void*)':
detect_mser.cpp:(.text._ZL4drawPv+0x5a): undefined reference to `gluLookAt'
CMakeFiles/example_detect_mser.dir/detect_mser.cpp.o: In function `main':
detect_mser.cpp:(.text.startup.main+0x2523): undefined reference to `gluPerspective'
collect2: error: ld returned 1 exit status
make[2]: *** [samples/cpp/CMakeFiles/example_detect_mser.dir/build.make:130: bin/cpp-example-detect_mser] Error 1
make[1]: *** [CMakeFiles/Makefile2:24582: samples/cpp/CMakeFiles/example_detect_mser.dir/all] Error 2
make: *** [Makefile:163: all] Error 2

##### Steps to reproduce
1.  Clone contrib 
$ git clone https://github.com/opencv/opencv_contrib.git
$ cd opencv_contrib
$ git checkout 3.4.0
$ cd ..

2. Clone opencv
$ git clone https://github.com/opencv/opencv.git
$ cd opencv
$ git checkout 3.4.0-rc

3. Compiling 
$ mkdir build
$ cd build
$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules ..
$ make -j6
Repository: pytorch
Issue: Stop using make_intrusive directly; provide some make_tensor
Labels: module: internals,triaged

Right now, if you are working with the lowest level of abstraction and you want to *create* a tensor, the current idiom is something like `Tensor(c10::make_intrusive<SparseTensorImpl>(some, args, ...))`. On further reflection, this is actually a bit strange, because the constructor you're using in this case is `Tensor(c10::intrusive_ptr<TensorImpl, UndefinedTensorImpl>)` and it's not obvious that `c10::intrusive_ptr<SparseTensorImpl>` is convertible to this. (It is, courtesy of #11260.)

But what we really should do is just come up with a new constructor which handles all of this intrusive pointer under the hood. Something like:

```
template <typename T, typename... Args>
Tensor make_tensor(Args... args) {
  return Tensor(c10::make_intrusive<T>(std::forward(args)));
}
```

Then the user visible interface doesn't require looking into these conversions.

cc @ezyang @bhosmer @smessmer @ljk53 @bdhirsh @ailzhang @gchanan 

This should be easy to do, if you want to attempt this task, CC me and I can review.
Repository: scrcpy
Issue: Detect incompatible Android versoin (API < 21)
Labels: enhancement,android4

Initial title: **Segmentation fault when trying scrcpy on Kindles**

```
/usr/local/share/scrcpy/scrcpy-server.jar: 1 file pushed. 1.8 MB/s (17874 bytes in 0.010s)
error: closed
2018-09-26 01:12:43.306 scrcpy[2646:20517898] ERROR: "adb reverse" returned with value 1
2018-09-26 01:12:43.306 scrcpy[2646:20517898] WARN: 'adb reverse' failed, fallback to 'adb forward'
Segmentation fault
```

Model: Kindle Fire HDX 8.9 (3rd generation)
Repository: vscode
Issue: [html] support less syntax in html file
Labels: feature-request,html

For my information, it seems like vscode doesn't support less and sass in html file, so can we make an extensions to support it?

some thing like this:
```
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    **<style lang="less">
        .a {
          width: 200px;
          background-color: #af1b3b;

          .box {
                flex-direction: column;
                justify-content: center;
                align-items: center;
            }
        }
    </style>**
</head>
<body>

</body>
</html>
```
Repository: pytorch
Issue: Caffe2 issues with using Glog without GFlags
Labels: caffe2

## Issue description

Trying to compile caffe2 with Glog that is not compiled with GFlags is causing compilation errors.

Is it required to build Glog with GFlags for Caffe2?

If I `apt install libgoogle-glog-dev`, then I do not get the compilation errors. However this will also pull in GFlags.

Also there does not appear to be a way to specify a custom install location for glog. I tried using `glog_DIR`, but it had no effect. I did manage to find GLOG_LIBRARY and GLOG_INCLUDE_DIR, which seems to work, but it is not available in the list of available options shown in ccmake.

## Code example

Cmake configuration command: 
```
cmake 
  -DBUILD_SHARED_LIBS=ON 
  -DCMAKE_BUILD_TYPE:STRING=Release 
  -DUSE_GFLAGS=OFF 
  -DUSE_GLOG=ON 
  -DUSE_LMDB=OFF 
  -DUSE_LEVELDB=OFF 
  -DUSE_NUMA=ON 
  -DUSE_OPENCV=OFF 
  -DBUILD_PYTHON=OFF 
  -DUSE_CUDA=ON 
  -DUSE_CUDNN=ON 
  -DUSE_MPI=OFF 
  -DUSE_NCCL=OFF 
  -DUSE_GLOO=OFF 
  -DUSE_IDEEP=OFF 
  -DUSE_MKLML=OFF 
  -DUSE_MKLDNN=OFF 
  -DGLOG_LIBRARY=/path/to/lib/libglog.so 
  -DGLOG_INCLUDE_DIR=/path/to/glog/include
```

Glog was installed from source from tag: v0.3.5 from https://github.com/google/glog/tree/v0.3.5

These are the errors I am getting when compiling:

```
caffe2/core/logging.cc:84:12: error: ‘FLAGS_minloglevel’ is already declared in this scope
 using fLI::FLAGS_minloglevel;

caffe2/core/logging.cc:85:12: error: ‘FLAGS_v’ is already declared in this scope
 using fLI::FLAGS_v;

caffe2/core/logging.cc:86:12: error: ‘FLAGS_logtostderr’ is already declared in this scope
 using fLB::FLAGS_logtostderr;
```


## System Info
- PyTorch or Caffe2: Caffe2
- How you installed PyTorch (conda, pip, source): source
- Build command you used (if compiling from source): `cmake 
  -DBUILD_SHARED_LIBS=ON 
  -DCMAKE_BUILD_TYPE=Release 
  -DUSE_GFLAGS=OFF 
  -DUSE_GLOG=ON 
  -DUSE_LMDB=OFF 
  -DUSE_LEVELDB=OFF 
  -DUSE_NUMA=ON 
  -DUSE_OPENCV=OFF 
  -DBUILD_PYTHON=OFF 
  -DUSE_CUDA=ON 
  -DUSE_CUDNN=ON 
  -DUSE_MPI=OFF 
  -DUSE_NCCL=OFF 
  -DUSE_GLOO=OFF 
  -DUSE_IDEEP=OFF 
  -DUSE_MKLML=OFF 
  -DUSE_MKLDNN=OFF 
  -DGLOG_LIBRARY=/path/to/lib/libglog.so 
  -DGLOG_INCLUDE_DIR=/path/to/glog/include`
- OS: Ubuntu 18.04
- PyTorch version: PYTORCH_COMMIT 784d34582828c1ebcb6bd2dfc0b5a4d135c422b9
- Python version: Python 3.6.5 :: Anaconda, Inc.
- CUDA/cuDNN version: 10.0/7.3.0
- GPU models and configuration: TITAN X (Pascal)
- GCC version (if compiling from source): 7.3.0
- CMake version: 3.12.2
- Versions of any other relevant libraries: Glog from source using v0.3.5

cmake flags when building Glog:
```
    -DCMAKE_INSTALL_PREFIX=${EXTERNAL_INSTALL_LOCATION}
    -DBUILD_SHARED_LIBS=ON
    -DCMAKE_BUILD_TYPE=Release
    -DWITH_GFLAGS=OFF
```
Repository: electron
Issue: better documentation for Debugger.sendCommand callback behavior
Labels: enhancement :sparkles:,documentation :notebook:,pr welcome

https://electronjs.org/docs/api/debugger

- #14810 - It seems perfectly natural to send certain init type messages like Page.enable before loading anything, but they either won't be sent or won't be processed until loading starts. If this delay can't be avoided it should be explained (that it will happen, whether the send or processing will be delayed)
- #14811 - a successful completion of sendCommand delivers an empty error plain object. This along with the shape of the error plain object on failure should be documented.
Repository: flutter
Issue: Simplify symbolication
Labels: c: new feature,team,tool,a: quality,a: debugging,P2,team-tool,triaged-tool

Our wiki [1] documents where to find symbol files and how to use them. It's a manual process. We should figure out how to automate this and make it easier for the user.

[1] https://github.com/flutter/engine/wiki/Symbolicating-production-crash-stacks
Repository: go
Issue: cmd/go: "go doc . foo" not working on Windows?
Labels: OS-Windows,NeedsInvestigation

The documentation notes that starting an identifier with a capital letter forces the current package, but if you're attempting to look up something that is unexported then this workaround doesn't apply, which can be annoying sometimes. I propose, therefore, that prefixing an identifier with a `.`, such as `go doc .testing`, should force `go doc` to only look up the identifier in the current package. Alternatively, when looking something up the current package, as specified by the use of a capital letter, and `-u` is given, then it should also match unexported identifiers despite the case mismatch.
Repository: pytorch
Issue: Error: Internal Compiler Error (codegen): "there was an error in verifying the lgenfe output!"
Labels: module: build,module: cuda,triaged,internals

If you attempt to put `at::optional` in a struct which is used from a cu file, you may get this error:

```    
Error: Internal Compiler Error (codegen): "there was an error in verifying the lgenfe output!"
```

A minimal reproduction is this program:

```
#include "optional.h"

struct O {
  O() {} // required!
  at::optional<int> x;
};

void blah() {
  O o;
}
```

compiled with `nvcc -c main.cu -std=c++11 --expt-relaxed-constexpr` (the `--expt-relaxed-constexpr` is mandatory).

There is a simple workaround for this problem: **explicitly initialize all optional fields in your constructor.** So for example, the following code will compile successfully:

```
#include "optional.h"

struct O {
  O() : x() {}
  at::optional<int> x;
};

void blah() {
  O o;
}
```
Repository: TypeScript
Issue: Allow tsconfig.json when input files are specified
Labels: Suggestion,In Discussion

I don't know why the `tsconfig.json` is ignored even when the `--project` or `-p` option is specified.
In my opinion, the right implementation should be:

+ If no  `--project` or `-p` option: Ignore tsconfig.json
+ Otherwise: Use the configuration file specified. All the options used in the command line should overwrite the ones of the configuration file. E.g. The include/exclude keys of the `tsconfig.json` will be ignored when input files are specified.
Repository: rust
Issue: linkcheck should check links in diagnostics messages
Labels: A-testsuite,C-enhancement,T-infra,T-release

The linkcheck tool does not check that links emitted by diagnostics messages are correct. E.g. we have at least one wrong link as per issue #54555. It would be useful to have linkcheck be able to check those links.
Repository: create-react-app
Issue: 2.0.0 Source map build performance 
Labels: issue: needs investigation

<!--
  PLEASE READ THE FIRST SECTION :-)
-->

### Is this a bug report?

No

<!--
  If you answered "Yes":
  
    Please note that your issue will be fixed much faster if you spend about
    half an hour preparing it, including the exact reproduction steps and a demo.
    
    If you're in a hurry or don't feel confident, it's fine to report bugs with
    less details, but this makes it less likely they'll get fixed soon.

    In either case, please fill as many fields below as you can.

  If you answered "No":

    If this is a question or a discussion, you may delete this template and write in a free form.
    Note that we don't provide help for webpack questions after ejecting.
    You can find webpack docs at https://webpack.js.org/.
-->


### Environment

<!--
  To help identify if a problem is specific to a platform, browser, or module version, information about your environment is required.
  This enables the maintainers quickly reproduce the issue and give feedback.

  Run the following command in your React app's folder in terminal.
  Note: The result is copied to your clipboard directly.

  `npx create-react-app --info`

  Paste the output of the command in the section below.
-->

Environment:
  OS:  macOS High Sierra 10.13.6
  Node:  8.12.0
  Yarn:  1.9.4
  npm:  6.4.1
  Watchman:  4.9.0
  Xcode:  Xcode 9.4.1 Build version 9F2000
  Android Studio:  3.0 AI-171.4443003

Packages: (wanted => installed)
  react: ^16.5.2 => 16.5.2
  react-dom: ^16.5.2 => 16.5.2
  react-scripts: ^2.0.0 => 2.0.0

### Steps to Reproduce

<!--
  How would you describe your issue to someone who doesn’t know you or your project?
  Try to write a sequence of steps that anybody can repeat to see the issue.
-->

1. `npx create-react-app test-app` # must use react-script@2.0.0
2. `yarn add britecharts-react`
3. Render any graph in App.js
4. `yarn build`


### Expected Behavior

yarn build runs in a reasonable time


### Actual Behavior

Build time jumps to 90 seconds, from 15 seconds

### Reproducible Demo

<!--
  If you can, please share a project that reproduces the issue.
  This is the single most effective way to get an issue fixed soon.

  There are two ways to do it:

    * Create a new app and try to reproduce the issue in it.
      This is useful if you roughly know where the problem is, or can’t share the real code.

    * Or, copy your app and remove things until you’re left with the minimal reproducible demo.
      This is useful for finding the root cause. You may then optionally create a new project.

  This is a good guide to creating bug demos: https://stackoverflow.com/help/mcve
  Once you’re done, push the project to GitHub and paste the link to it below:
-->

[Example Project](https://github.com/cliedeman/cra2-sourcemap-performance) 
```
react-scripts@2.0.0 14.03s. (without britecharts)
react-scripts@2.0.0 89.04s (with britecharts)

react-scripts@1.1.5: 28.73s. (with britecharts)
react-scripts@1.1.5 : 6.93s. (without britecharts)
```
Repository: go
Issue: x/tools/playground: vet step uses different integer sizes than build step
Labels: NeedsDecision

These two links both emit red errors:
https://play.golang.org/p/b1Bm8V8Eh4S
https://play.golang.org/p/0ZYaKc42JZe

One of them says that the array passed to the function is 16 bytes but the function requires 12, and the other one says that the array is 12 bytes but the function requires 16. The function definition is **exactly** the same in both cases, so they can't both be correct.

CC @dmitshur @griesemer @bradfitz
Repository: flutter
Issue: Add state persistence listener to PluginRegistry.Registrar
Labels: engine,c: proposal,P2,a: plugins,team-engine,triaged-engine

I'm not sure about the iOS side of things.

To solve #17950 and to provide convenient solutions to #6827, plugins must have a chance to persist some state before the Android host activity is destroyed. 

On Android, `onSaveInstanceState` on the activity is called before `onDestroy` and allows you to add values to a bundle. State restoration usually happens in the onCreate method of the activity.

I propose the addition of a new listener interface to the `PluginRegistry`:

```java
StatePersistenceListener {
    void onSaveInstanceState(Bundle outState);
    void onRestoreInstanceState(Bundle savedInstanceState);
}
```

Use cases:
-------------

* A router plugin that stores the current route even when the app is killed in background
* Fix for the image_picker so that it works on all Android devices
Repository: godot
Issue: High frame delay causes rendering issues with auto exposure enabled [GLES3]
Labels: bug,topic:rendering,confirmed

<!-- Please search existing issues for potential duplicates before filing yours:
https://github.com/godotengine/godot/issues?q=is%3Aissue
-->

**Godot version:**
3.1.alpha 5a03d50

**OS/device including version:**
Windows 10
GPU: NVIDIA GeForce GTX 1070 MQ, driver: 411.63
GPU: Interl UHD Graphics 630

**Issue description:**
When game starts, just as first scene renders, it appears for a brief second frozen, with distorted colors:
![Flash of color](https://thumbs.gfycat.com/TastyShortFlycatcher-size_restricted.gif)

**Steps to reproduce:**
Unable to reproduce in minimal project. Issue can be observed with [demo version of ΔV: Rings of Saturn 0.20.0, available on itch.io](https://koder.itch.io/dv-rings-of-saturn-demo) - observed with windows builds.

It might be related to loading resources and auto-exposure of `WorldEnvironment`. Going to work around it by providing blank/black initial scene.
Repository: go
Issue: wasm: scheduling of JavaScript callbacks is not fair
Labels: NeedsInvestigation,arch-wasm

### What version of Go are you using (`go version`)?

go version go1.11 linux/amd64

### Does this issue reproduce with the latest release?

yes

### Description

I ran the webassembly benchmark in https://djhworld.github.io/post/2018/09/21/i-ported-my-gameboy-color-emulator-to-webassembly/ and as also noted on that page, the benchmark does not properly process keyboard input on chrome. See https://bugs.chromium.org/p/v8/issues/detail?id=8227 for the v8 tracking bug.

Due to a performance issue in v8, the compiled go code runs slower in v8 than firefox. As a consequence, there is more pressure on the go scheduler. In particular, there is nearly always a go-routine ready to be executed with very few idle pauses. Looking at the scheduler implementation at

https://github.com/golang/go/blob/eae5fc88c13d6902a7fe9c595fb02155eb037cbe/src/runtime/proc.go#L2368

this leads to starvation of the go-routines that are waiting for a callback from java-script. In case of the gameboy emulator, this means that no more I/O events are being processed.