sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: go
Issue: cmd/link: panic: runtime error: slice bounds out of range
Labels: help wanted,NeedsInvestigation

### What version of Go are you using (`go version`)?
1.9.4

### Does this issue reproduce with the latest release?
Yes

### What operating system and processor architecture are you using (`go env`)?
Ubuntu 17.10 linux_amd64

### What did you do?
I'm compiling my project with bazel by just running `bazel build node/agent/unsullied`.

The code is too complicated. I'm working to make a minimum example.

### What did you expect to see?
bazel build succeed.

### What did you see instead?
At the last step, GoLink crashed.

```
ERROR: /src/node/agent/unsullied/BUILD.bazel:42:1: GoLink node/agent/unsullied/linux_amd64_stripped/unsullied failed (Exit 1)
github.com/vishvananda/netlink.NewHandleAt: call to external function
github.com/vishvananda/netlink.(*Handle).LinkList: call to external function
panic: runtime error: slice bounds out of range

goroutine 1 [running]:
cmd/link/internal/ld.decodetypePtrdata(0x6f8060, 0xc42219a3d8, 0xc42082bbd0)
	/usr/local/go/src/cmd/link/internal/ld/decodesym.go:83 +0x9c
cmd/link/internal/ld.(*GCProg).AddSym(0xc426f628f0, 0xc422195c40)
	/usr/local/go/src/cmd/link/internal/ld/data.go:1260 +0x76
cmd/link/internal/ld.(*Link).dodata(0xc4204cc000)
	/usr/local/go/src/cmd/link/internal/ld/data.go:1573 +0x1932
cmd/link/internal/ld.Main()
	/usr/local/go/src/cmd/link/internal/ld/main.go:219 +0x9fd
main.main()
	/usr/local/go/src/cmd/link/main.go:58 +0xac
2018/02/08 18:05:07 error running linker: exit status 1
Target //node/agent/unsullied:unsullied failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 116.070s, Critical Path: 1.31s
FAILED: Build did NOT complete successfully
```
Repository: vscode
Issue: Allow to open multiple workspaces in the same window
Labels: feature-request,workbench-multiroot

Workspace feature is great because we can grouping projects in a top context (microservices projects in a big API workspace). But, only one workspace can be open. This feature can be powerful if multiple workspaces can be open at the same time (in the same window).

![test](https://user-images.githubusercontent.com/895661/35967214-7cc92ba0-0cc0-11e8-82b0-6bae8c11ffdb.jpg)

And another request : it will be great if :
- Right click on the workspace name should open menu with a "settings" item (which open xxxx.code-workspace).
- Workspace settings should contain a `name` attribute (to clearly identify the workspace in the left pane in VS Code)
Repository: vscode
Issue: [json] launch.json completion for "type" does not include expected values
Labels: bug,json

This completion only seems to include `node`, however if I type `dart` it works fine and if I type nonsense, it warns me that it's invalid. So it seems to know `dart` is a valid option, but I'm not sure why it's not in the completion list.

![launch2](https://user-images.githubusercontent.com/1078012/35969840-1b536c28-0cc0-11e8-9562-c3b526580e43.png)
Repository: TypeScript
Issue: Error: Type cannot be used to index type after two indexes
Labels: Bug

<!-- If you have a BUG:
  Please fill in the *entire* template below.
-->

<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
**TypeScript Version:** 2.7.1, 2.8.0-dev.20180208

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:**
Type cannot be used to index type

**Code**

```ts
interface IExample {
    foo: {
        bar: {
            baz: number;
        }
    }
}

type F = <
    name extends keyof IExample,
    val extends keyof IExample[name]
>() => IExample[name][val]['baz']; // ← Type '"baz"' cannot be used to index type 'IExample[name][val]'.
```

**Expected behavior:**
In version 2.7.0-dev.20171115 this code was checking without errors.

**Actual behavior:**
Now in throws error: Type '"baz"' cannot be used to index type 'IExample[name][val]'.

**Playground Link:** <!-- A link to a TypeScript Playground "Share" link which demonstrates this behavior -->
https://www.typescriptlang.org/play/index.html#src=interface%20IExample%20%7B%0D%0A%20%20%20%20foo%3A%20%7B%0D%0A%20%20%20%20%20%20%20%20bar%3A%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20baz%3A%20number%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%7D%0D%0A%7D%0D%0A%0D%0Atype%20F%20%3D%20%3C%0D%0A%20%20%20%20name%20extends%20keyof%20IExample%2C%0D%0A%20%20%20%20val%20extends%20keyof%20IExample%5Bname%5D%0D%0A%3E()%20%3D%3E%20IExample%5Bname%5D%5Bval%5D%5B'baz'%5D%3B
Repository: rust
Issue: Rustdoc: distinguish provided methods on trait impls
Labels: T-rustdoc,C-enhancement,A-trait-system

Currently, if a trait impl uses a provided method's default implementation, there is no easy way to tell directly from the rustdoc. For instance, see the `Write for Vec<u8>` [impl block](https://doc.rust-lang.org/std/vec/struct.Vec.html#impl-Write). The first three methods are implemented by `Vec<u8>`, while the other two use the default implementation. Of the ones implemented by `Vec<u8>`, `write_all` overrides a default implementation while the other two are required.

Ideally, we would have some small way to distinguish between provided, overridden, and required methods in the trait impl blocks. While it isn't useful for normal documentation practices, it is useful for educational purposes (e.g. if I want to see how a type implements a trait, I can know to ignore provided methods) as well as debugging, if I have different levels of trust for the trait author and implementor.
Repository: go
Issue: x/crypto/ssh: handshake failed: ssh: unsupported DSA key size 2048
Labels: NeedsInvestigation

We are seeing some odd behavior connecting to a customer SFTP site with a username and password.  This code is working for all other tested endpoints.

I see a section of code in the crypto/keys.go file in the function checkDSAParams that fails if the key length is not 1024, but since I am able to connect to that SFTP with ssh and other SFTP clients, I'm not sure why that restriction is being enforced in Go.

### What version of Go are you using (`go version`)?
go1.9.2 linux/amd64

### Does this issue reproduce with the latest release?
yes

### What operating system and processor architecture are you using (`go env`)?
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

### What did you do?
Attempting to establish a connection to a remote SFTP server.  
ssh.Dial("tcp", config.SftpServer+":"+string(config.SftpPort), sshConfig)

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

### What did you expect to see?
A successful SSH handshake and authentication.

### What did you see instead?
An error: ssh: handshake failed: ssh: unsupported DSA key size 2048
Repository: vscode
Issue: Incorrect indentation for single line if/for/while/etc, multiline chaining statements etc
Labels: bug,typescript,javascript,editor-autoindent,on-unit-test

I am experiencing some weird indentation issues. Not using any plugins to prettify or similar.

```
if (condition) {
    return; // <-- correct indentation
}
```
```
if(condition)
return; // <-- incorrect indentation
```
Some ppl claim this should be avoided. I don't agree. Using pair of { } for simple early exits messes up code. Putting the return on the end of the same line can be hard to read if the condition is long.
This is not exclusive to return. Applies to all single lines. 

same problems apply to for, while, etc.

```
var transformedValues =
originalValues <-- incorrect should be indented one level.
.where(condition) <-- incorrect, should be indented two levels.
.select(transform); <-- incorrect, should be indented two levels. 

function someFunction() {
    callToSomeOtherFunction(
         variableWithLongNameWhichRequiresASeparateLine,
         anotherVariableWithLongNameWhichRequiresASeparateLine);
    }  <-- incorrect should not be indented.
    function ... <-- incorrect the rest of the file is indented. 
```
Repository: kubernetes
Issue: Allow limiting adding/removing finalizers
Labels: area/security,area/apiserver,sig/api-machinery,kind/feature,sig/auth,priority/important-longterm,lifecycle/frozen

/kind feature
@kubernetes/sig-auth-feature-requests 
@kubernetes/sig-api-machinery-feature-requests 

**What happened**:

As a namespace-constrained user, I am able to manually add/remove finalizers added by system components:
* garbage collection finalizers
* pv/pvc protection finalizers
* service catalog deprovisioning finalizers
* etc...

**What you expected to happen**:

As a cluster admin, I expected to be able to control what finalizers can be added/removed by end users, so they can be relied on by system components and controllers for gating deletion
Repository: godot
Issue: Inaccurate physics with simple bodies (RigidBodies can temporarily penetrate other PhysicsBodies)
Labels: bug,confirmed,topic:physics

**Godot version:**
v3.0.stable.official


**OS/device including version:**
Windows 10 Pro 10.0.16299 Build 16299


**Issue description:**
Simple 3d physics are not resolved correctly. Slow moving rigidbodies can enter/penetrate staticbodies at slow speeds. This collision is slowly corrected over several frames by pushing out the rigidbody. Setting the physics fps to a high value like 240 fps minimizes the problem, but it's still noticeable.

[Sample Video](https://gfycat.com/FailingChillyChrysomelid)


**Steps to reproduce:**
Add a staticbody as a ground. Add an rigidbody with a sphere collider and drop it from medium heights (10-20 Units). 

**Minimal reproduction project:**
Left-Mouseclick accelerate rigidbody.
[Physics_Issue.zip](https://github.com/godotengine/godot/files/1708905/Physics_Issue.zip)
Repository: TypeScript
Issue: Empty type inferred by Object.entries
Labels: Bug,Domain: lib.d.ts

**TypeScript Version:**  2.7.1

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:** Object entries empty TS2365 

**Code**

```ts
let o: any = {x: 5};

let p = Object.entries(o).map(([k, v]) => v + 1);
```
Compile command: `tsc --lib es2017,es2017.object a.ts`

**Expected behavior:**
This should compile without any error, assuming `v: any`.
This was the case for Typescript 2.6.2 at least.

**Actual behavior:**
(3,43): error TS2365: Operator '+' cannot be applied to types '{}' and '1'.

Following codes compile without errors:

```ts
let o: object = {x: 5};

let p = Object.entries(o).map(([k, v]) => v + 1);
```

```ts
let o: any = {x: 5};

let p = Object.entries(o).map(([k, v]: [any, any]) => v + 1);
```
Repository: angular
Issue: Angular Elements should preserve/forward component methods
Labels: type: bug/fix,feature,area: elements,feature: under consideration

## I'm submitting a...
<!-- Check one of the following options with "x" -->

- [ ] Regression (a behavior that used to work and stopped working in a new release)
- [x] Bug report  <!-- Please search GitHub for a similar issue or PR before submitting -->
- [x] Feature request
- [ ] Documentation issue or request
- [ ] Support request 

Partially considered a bug due to developer expectations, partially a feature request because it might not be "fixable" in that sense.

## Current behavior

When creating Custom Elements from Angular Components using Angular Elements APIs, the resulting elements do not preserve the Angular component methods on the Custom elements.

For example giving a component like this:

```
@Component(...)
export class CarComponent {
  drive() {...}
}
```

does not make `drive()` available on the resulting custom element:

```
const car = document.querySeletor('car-thing');

car.drive(); // Errors out because `drive()` doesn't exist on <car-thing>
```

This is because an Angular component doesn't actually "become" the Custom Element but is rather preserved "inside" the Custom Element and readable via `componentRef`. To make the code above work we'd need to call

```
car.componentRef.instance.drive();
```

## Expected behavior

As Angular Elements are being promoted as Angular Components packaged as Custom Elements, I'd expect Angular Elements to have the same characteristics (Custom Elements come with their attributes, properties, methods and events). 

In other words, I'd expect this to work:

```
car.drive(); // Angular takes care of preserving or forward API methods
```

## Some useful notes and ideas on this

I've talked to @gkalpak about this already and one of his ideas was to maybe come up with a new decorator that tells Angular to preserve the decorated method on the resulting host element.

Another idea would be to declare in the registration process which methods should be preserved/forwarded. This could look like this:

```
registerAsCustomElements([{component: CarComponent, methods: ['drive']}], ...)
```

The reason there might be an additional API for this needed is because we can't just preserve/forward all of the components methods. Some methods may not be intended to be available on the resulting Angular Element (e.g. lifecycle hooks etc.)

## What is the motivation / use case for changing the behavior?

I think it'd be great if consumers of Angular Elements don't have to worry about Angular internals and can in fact use any Angular Element exactly the same way they'd use any other DOM element. Right now, to call component methods, consumers of Angular Elements have to know that those are populated on `componentRef.instance`, which doesn't seem to be very convenient nor what one would expect.
Repository: pytorch
Issue: BCELoss - weight parameter shape incorrect
Labels: module: nn,module: loss,triaged

The `weight` parameter of `BCELoss` seems to be incorrectly defined when using a multi-dimensional input and target. Related [forum thread](https://discuss.pytorch.org/t/binary-cross-entropy-weights/13299).

The documentation defines `weight` as:
> If given, has to be a Tensor of size “nbatch”.

However, this example throws an error:
```
x = Variable(torch.randn(4, 2, 2))
y = Variable(torch.Tensor(4, 2, 2).random_(2))
output = F.sigmoid(x)

# Create weight according to doc in BCELoss
weight = torch.randn(4)
criterion_weighted = nn.BCELoss(weight=weight)
loss_weighted = criterion_weighted(output, y) # Error!
```

A workaround is to `unsqueeze` the `weight` tensor to match the number of dimensions:
```
# Unsqueeze weight tensor
weight = torch.randn(4, 1, 1)
criterion_weighted = nn.BCELoss(weight=weight)
loss_weighted = criterion_weighted(output, y)
```

Internally, `_infer_size` is called and fails in the first code snippet.
The second code snippet applied a weighting for each batch element, which is fine.

Should we automatically unsqueeze the weight tensor, if input and target are multi-dimensional?

Also, how should we handle class weighting?
If we just pass 2 weights as the `weight` tensor, the code successfully runs, but does not apply class weighting, which might mislead some users:
```
# Create class weights
weight = torch.FloatTensor([0.1, 0.9]) 

# Internally, weight is expanded as
size = _infer_size(weight.size(), y.size())
weight_expanded = weight.expand(size) 
print(weight_expanded) # This is not, what we wanted as class weights!

criterion_weighted = nn.BCELoss(weight=weight)
loss_weighted = criterion_weighted(output, y)
criterion_nonreduced = nn.BCELoss(reduce=False)
loss_unreduced = criterion_nonreduced(output, y)
loss_weighted_manual = (Variable(weight_expanded) * loss_unreduced).mean()

if loss_weighted == loss_weighted_manual:
    print('Class weighting failed')
```

A workaround would be:
```
weight_ = weight[y.data.view(-1).long()].view_as(y)
criterion = nn.BCELoss(reduce=False)
loss = criterion(output, y)
loss_class_weighted = loss * Variable(weight_)
```

What is wanted behavior of the `weight` parameter in `BCELoss`: class or batch weighting?
Both cases have some issues at the moment in my opinion.
I would like to fix this issue, but I would like to hear some opinions on the right behavior.
Class weighting would be consistent with other loss functions like `NLLLoss`, but maybe batch weighting is a more common use case for `BCELoss`.

PyTorch version: `0.4.0a0+492e26f` (installed from source)
Repository: pytorch
Issue: TakeBackward taking a significant portion of backward time
Labels: module: performance,module: autograd,triaged

I'm trying to write some code that requires reindexing the hidden states of an LSTM at each step (because of particle filtering). Is there a more efficient way to do this? It's pretty slow right now, and I wonder if another approach (`scatter_`?) might be better.

If there's an internal issue with PyTorch, I'm happy to tackle it and make a PR; I just don't know where to look.

- OS: Ubuntu 16.04
- PyTorch version: `0.4.0a0+e3e3874`
- How you installed PyTorch (conda, pip, source): source
- Python version: 2.7.12
- CUDA/cuDNN version: 8.0
- GPU models and configuration: Tesla K80
- GCC version (if compiling from source): 5.4.0

```
import torch
import torch.nn as nn
from torch.autograd import Variable

INPUT_SIZE = 1024
HIDDEN_SIZE = 512


class IndexingIssues(nn.Module):
    def __init__(self):
        super(IndexingIssues, self).__init__()
        self.enc = nn.LSTMCell(INPUT_SIZE, HIDDEN_SIZE)

    def forward(self, input):
        seq_len, batch_sz, _ = input.size()
        h = Variable(input.data.new(batch_sz, HIDDEN_SIZE).zero_())
        c = Variable(input.data.new(batch_sz, HIDDEN_SIZE).zero_())
        for i in range(seq_len):
            h, c = self.enc(input[i], (h, c))
            idx = torch.arange(batch_sz).long().cuda().view(-1)  # just identity for now
            h = h[idx]
            c = c[idx]
        return h.sum()


def main():
    data = Variable(torch.randn(15, 80, INPUT_SIZE).cuda())
    model = IndexingIssues().cuda()
    optimizer = torch.optim.SGD(model.parameters(), lr=0.0001)
    with torch.autograd.profiler.profile() as prof:
        for i in range(5):
            optimizer.zero_grad()
            loss = model(data)
            loss.backward()
            optimizer.step()
    prof.export_chrome_trace("repro.prof")


if __name__ == '__main__':
    main()
```

Here's the chrome_trace it outputs [repro.txt](https://github.com/pytorch/pytorch/files/1711786/repro.txt)
(this isn't a text file, just needed to rename so Github would accept it)

cc @ezyang @SsnL @albanD @zou3519 @gqchen @VitalyFedyunin @ngimel
Repository: TypeScript
Issue: Missing fix suggestions when multiple come from the same JSX element
Labels: Bug,Domain: Quick Fixes

```typescript
const element = <span />;
// [ts] 'React' refers to a UMD global, but the current file is a module. Consider adding an import instead.
```

If the compiler settings have `jsx: "react"`, it seems like adding the import automatically could be a reasonable auto-fix?

```typescript
import * as React from "react";

const element = <span />;
```
Repository: rust
Issue: Feature: `Rc::clone_raw` (and for Arc)
Labels: T-libs-api,C-feature-request

When using `from_raw`/`into_raw` functions with `Rc`, you often want to obtain a new reference to a raw pointer, without taking ownership. At the moment you have to do this dance:

```rust
fn clone_raw<T>(ptr: *const T) -> Rc<T> {
    let result = unsafe { Rc::from_raw(ptr) };
    ::std::mem::forget(result.clone());
    result
}
```

This is quite error prone and makes little sense to anyone trying to read the code. It would be better if the standard library had `clone_raw` built in for `Rc` and `Arc`, and possibly for their weak variants.
Repository: vscode
Issue: [css] propose ids used in other selectors
Labels: feature-request,css-less-scss

### Issue Type
Bug

### Description

i have issues when i try to use suggestion for css files. for classes works well but when i'm  using for id i have no suggestions try it with a file with like 500 lines of code

### VS Code Info

VS Code version: Code 1.20.0 (c63189deaa8e620f650cc28792b8f5f3363f2c5b, 2018-02-07T17:09:39.780Z)
OS version: Windows_NT x64 10.0.16299

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz (4 x 2195)|
|Memory (System)|3.91GB (0.52GB free)|
|Process Argv|C:\Program Files\Microsoft VS Code\Code.exe|
|Screen Reader|no|
|VM|0%|

</details><details><summary>Extensions (5)</summary>

Extension|Author (truncated)|Version
---|---|---
rainbow-brackets|2gu|0.0.6
vscode-eslint|dba|1.4.5
vsc-material-theme|Equ|1.3.0
prettier-vscode|esb|1.1.3
LiveServer|rit|3.2.0


</details>
Reproduces without extensions
Repository: angular
Issue: [Feature Request] [Service Worker] Background Sync
Labels: feature,area: service-worker,feature: under consideration

<!--
PLEASE HELP US PROCESS GITHUB ISSUES FASTER BY PROVIDING THE FOLLOWING INFORMATION.

ISSUES MISSING IMPORTANT INFORMATION MAY BE CLOSED WITHOUT INVESTIGATION.
-->

## I'm submitting a...
<!-- Check one of the following options with "x" -->
<pre><code>
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  <!-- Please search GitHub for a similar issue or PR before submitting -->
[x ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
</code></pre>

## Current behavior
<!-- Describe how the issue manifests. -->
Right now, Service Worker package do not have sync feature. Since Angular follows a plugin mechanism to add service worker apis, I feel this is a major feature which is required.

[Background Sync](https://developers.google.com/web/updates/2015/12/background-sync)


## Expected behavior
<!-- Describe what the desired behavior would be. -->
Should be able to register a background sync easily using @angular/service-worker package. 

## Minimal reproduction of the problem with instructions
<!--
For bug reports please provide the *STEPS TO REPRODUCE* and if possible a *MINIMAL DEMO* of the problem via
https://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5).
-->
N/A
## What is the motivation / use case for changing the behavior?
<!-- Describe the motivation or the concrete use case. -->
This is required to make sure that user is able to do actions even on unstable internet connections.
Repository: go
Issue: x/build/maintner/maintnerd: allow serving logs locally
Labels: Builders

Currently, maintnerd only serves on /logs if it's logging to GCS.

It doesn't look like this is for any particular reason except that the logs index hasn't been implemented for local filesystem?

/cc @bradfitz