sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: go
Issue: net: cross compiled Go has lengthy timeouts when resolving names if a DNS server is invalid
Labels: NeedsInvestigation

<!-- Please answer these questions before submitting your issue. Thanks! -->

### What version of Go are you using (`go version`)?

go version go1.11 darwin/amd64

### Does this issue reproduce with the latest release?

Yes

### What operating system and processor architecture are you using (`go env`)?

```
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/gfrau/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/gfrau/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.11/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.11/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/jh/z59wc4wx5cz823x6l5f81qn463wn7j/T/go-build408544351=/tmp/go-build -gno-record-gcc-switches -fno-common"
```

### What did you do?

We cross compiled an application on a mac, with GOOS=linux as the target. When run on target systems where there are two DNS resolvers listed in /etc/resolv.conf, but one of them is unreachable, the application takes quite a while to resolve dns (15s?). Changing the DNS resolution mechanism with GO_DEBUG doesn't appear to work, the error occurs with either the go or cgo DNS resolvers selected. As soon as we comment out the DNS server that is unreachable, the app works fine. It does not matter which one of the DNS servers is unreachable (first one listed, or second). The app is slow, and strace shows it connecting to both of them no matter what.

### What did you expect to see?

I was expecting Go to use the primary DNS server first, with a 2 second timeout before using the next in the resolver list, returning the response of the first successful server.

### What did you see instead?

Timeouts, and slow applications when the app was built on darwin/amd64 for a target of linux/amd64.

This problem goes away if we do a go build directly on linux/amd64 and do not cross-compile (both using CGO_ENABLED=0 and CGO_ENABLED=1). However, if the primary resolver listed is unreachable for this test case, the timeouts take over 10s for DNS resolution, rather than the expected 2s. If the secondary server is unreachable, it is never hit, as the primary resolved the name already, and no timeouts are noticed
Repository: godot
Issue: Dictionary keys are stored by reference
Labels: bug,discussion,topic:core,confirmed

<!-- Please search existing issues for potential duplicates before filing yours:
https://github.com/godotengine/godot/issues?q=is%3Aissue
-->

**Godot version:**
3.0.6 stable


**OS/device including version:**
Ubuntu Bionic 64bit


**Issue description:**

	var xx = {}
	
	var k1 = [[1,2], [3,4]]
	var k2 = [[1,2], [3,4]]
	var v1 = [1,2,3]
	xx[k1] = v1
	print(xx.has(k2))
	
	k1[0][0] = 999
	print(xx.has(k2))
	
	print(xx.has(k1))
	print(xx.keys())

The result:

    True
    False
    False
    [[[999, 2], [3, 4]]]

There are two issues here:

1. Changing `k1` changes the key in the dictionary which implies that the key stored in the dictionary is actually a reference to `k1`. This might be the design and not a bug, but if it is the design, I am not sure how does it work with the hash of the key which is used to quickly find the value in the internal data structure. Additionally this is counter intuitive and not [documented](https://docs.godotengine.org/en/3.0/classes/class_dictionary.html).
2. After changing `k1` there is no more way to retrieve the value. Both `k1` and `k2` considered not in the dictionary. This is most probably a bug.
Repository: TypeScript
Issue: Method decorators in class expressions are silently ignored.
Labels: Bug

<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨

Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common "Bugs" That Aren't Bugs section!

Please help us by doing the following steps before logging an issue:
  * Search: https://github.com/Microsoft/TypeScript/search?type=Issues
  * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ

Please fill in the *entire* template below.
-->

<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
**TypeScript Version:**  3.2

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:**

- decorators
- class expressions

**Code**

```ts
const decorator = () => null;

// This calls __decorate with decorator.
class Statement {
  @decorator()
  method() {

  }
}

// This doesn't! It also doesn't produce a compiler error of any kind.
(class Expression {
  @decorator()
  method() {

  }
})
```

**Expected behavior:**

__decorate should be called, or a compiler error should be produced.

**Actual behavior:**

The decorator is silently ignored, omitting it from the decoration compiled output.

**Playground Link:** <!-- A link to a TypeScript Playground "Share" link which demonstrates this behavior -->

https://www.typescriptlang.org/play/index.html#src=const%20decorator%20%3D%20()%20%3D%3E%20null%3B%0D%0A%0D%0Aclass%20Statement%20%7B%0D%0A%20%20%40decorator()%0D%0A%20%20method()%20%7B%0D%0A%0D%0A%20%20%7D%0D%0A%7D%0D%0A%0D%0A(class%20Expression%20%7B%0D%0A%20%20%40decorator()%0D%0A%20%20method()%20%7B%0D%0A%0D%0A%20%20%7D%0D%0A%7D)

**Related Issues:** <!-- Did you find other bugs that looked similar? -->

- Using decorators on arguments in class expressions produces a compiler error: https://github.com/Microsoft/TypeScript/issues/7342

- This one is about decorators on class expressions, not methods within a class expression: https://github.com/Microsoft/TypeScript/issues/15975 - but produces some kind of error at least.
Repository: opencv
Issue: lazy Mat::create() when data size match
Labels: category: core,RFC

The Mat::create() function will allocate new data if the new size() and type() do not match the previous ones.
Wouldn't it be a legible optimization to also keep the currently allocated data when the raw memory size matches `(this->rows*this->elemSize1()*this->step1() == CV_ELEM_SIZE(newType)*newWidth*newHeight) `?
Only rows, cols and flags would need to be updated.

Is there a reason why it's not the case ?
Repository: go
Issue: cmd/compile: compiler hangs without optimizations
Labels: ToolSpeed,NeedsInvestigation,compiler/runtime

<!-- Please answer these questions before submitting your issue. Thanks! -->

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.11.2 windows/amd64
</pre>

### Does this issue reproduce with the latest release?
Yes, reproduced using go 1.11, 1.11.2 and 1.10


### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
$ go env
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\csnitker\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\csnitker\go
set GOPROXY=
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=C:\Users\csnitker\go\src\go.registrar.int.godaddy.com\RegistrarServices\whois\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\csnitker\AppData\Local\Temp\go-build373743682=/tmp/go-build -gno-record-gcc-switches

</pre></details>

### What did you do?

<!--
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
-->

Run `go build -gcflags=all="-N -l" -x main.go` or `dlv debug main.go` on the following:

```golang
package main

import "github.com/zonedb/zonedb"

func main() {
    zone := zonedb.PublicZone("godaddy.com")
    if zone != nil {
        println(zone)
    }
}
```

### What did you expect to see?
A successful build.


### What did you see instead?
The compiler hangs and consumes large amounts of memory.

![image](https://user-images.githubusercontent.com/4894187/49670017-cffe8580-fa28-11e8-8308-a88e7d4dad1a.png)

The command from the process above shows:

```
C:\go1.11\pkg\tool\windows_amd64\compile.exe -o C:\Users\csnitker\AppData\Local\Temp\go-build516058638\b002\_pkg_.a -trimpath C:\Users\csnitker\AppData\Local\Temp\go-build516058638\b002 -N -l -p github.com/zonedb/zonedb -complete -buildid mw6Bk1kcUZg16C0mq6E3/mw6Bk1kcUZg16C0mq6E3 -goversion go1.11 -D "" -importcfg C:\Users\csnitker\AppData\Local\Temp\go-build516058638\b002\importcfg -pack -c=4 C:\Users\csnitker\go\pkg\mod\github.com\zonedb\zonedb@v0.0.0-20181207082023-cee273e3e759\zone.go C:\Users\csnitker\go\pkg\mod\github.com\zonedb\zonedb@v0.0.0-20181207082023-cee273e3e759\zones.go
```

It's also interesting that `go build -gcflags="-N -l" main.go` completes successfully and works using `dlv exec main.exe` but does not with the commands above. I'm not entirely sure if this is a go problem or an issue with the library (or delve) but figured I would start here since an optimized build completes without issue.
Repository: pytorch
Issue: Missing dilation from several pooling modules (AvgPool)
Labels: hackamonth,triaged,module: pooling,function request

## 🚀 Feature
<!-- A clear and concise description of the feature proposal -->

The dilation parameter is a common between all kernelized operations like convolution and pooling. Currently _MaxPoolNd, _ConvNd, _ConvTransposeNd, etc... do support this parameter, but it is noticeably missing from  _AvgPoolNd, _LPPoolNd, _MaxUnpoolNd, etc... 

## Motivation

For completeness of the API the dilation parameter should be implemented for these modules. 

AFAIK there are 4 parameters (5 for transpose operations) that should be general to all kernelized operations: 
* kernel_size
* stride
* padding
* dilation

And in the case of transpose kernelized operations (e.g. convT, MaxUnpool), there is also:
*  output_padding

## Pitch

I think there should be an effort to 
(1) add these parameters to all pooling and convolution operations
(2) standardize the module attributes to be uniform across all modules (e.g. kernel_size for Conv2d is a Tuple[int, int], but kernel_size for MaxPool2d is just a scalar int that is assumed to be uniform on all dimensions.) 

## Alternatives

The alternative is simply not to do this because dilation is most commonly used with the modules where it is already implemented, but torch is such a nice API that I think its worth doing for completeness sake. It is a lower priority though.  



cc @heitorschueroff
Repository: go
Issue: go/parser: fails when a valid function declaration follows an broken one
Labels: NeedsInvestigation

Repro case:
```go
package main

type e struct {
	error
}

func (*e) random() {}

func main() {
	var diags []error
	for _, err := range diags {
		handled := handle(err)
                handled.
	}
}

func handle(err error) *e {
	return &e{err}
}
```

The selector with no "`Sel`" field breaks parsing in the `main` function, causing the code below it to fail parsing. The `handle` function never gets registered as a function declaration. Moving the `handle` function above the `main` function causes this code to type-check as expected. This poses a problem for editor-integrated tools that need to work on broken code.
Repository: TypeScript
Issue: CFA with deep expressions doesn't work correctly
Labels: Bug,Domain: Control Flow

<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨

Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common "Bugs" That Aren't Bugs section!

Please help us by doing the following steps before logging an issue:
  * Search: https://github.com/Microsoft/TypeScript/search?type=Issues
  * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ

Please fill in the *entire* template below.
-->

<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
**TypeScript Version:**  3.1

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:**

**Code**

```ts
declare var foo: { bar?: { baz?: { x: 1 } } };

(foo.bar === undefined ? undefined : foo.bar.baz) === undefined ? undefined : foo.bar.baz.x;
```

**Expected behavior:**
No error

**Actual behavior:**
`foo.bar.baz.x`:  Object is possibly 'undefined' (`foo.bar.baz`)

**Playground Link:** <!-- A link to a TypeScript Playground "Share" link which demonstrates this behavior -->

**Related Issues:** <!-- Did you find other bugs that looked similar? -->
Repository: flutter
Issue: [WebVIew] Add  page loading failure callbacks.
Labels: c: new feature,p: webview,package,team-ecosystem,P2,triaged-ecosystem

*Splitting this from https://github.com/flutter/flutter/issues/24981*
Repository: go
Issue: go/parser: fails to parse an invalid switch statement
Labels: NeedsInvestigation,gopls/parsing

Repro case:
```go
package main

import "go/ast"

func main() {
	var node ast.Node
	var lit *ast.CompositeLit
	switch n := node.(type) {
	case *ast.CompositeLit:
		lit = n
                lit.
	case *ast.KeyValueExpr:
	}
}
```

In this case, `lit.
	case *ast.KeyValueExpr:` gets parsed into an *ast.BadStmt. This is a problem for tools that need to work on broken code.
Repository: flutter
Issue: FloatingActionButton should attach to AppBar
Labels: c: new feature,framework,f: material design,a: quality,c: proposal,P2,team-design,triaged-design

It should be possible to set the position of a `FloatingActionButton` relative to the `AppBar` not just the `BottomAppBar`. See https://material.io/design/components/buttons-floating-action-button.html#placement
Repository: TypeScript
Issue: Change Diagnostic.code to 'string | number'
Labels: Suggestion,Breaking Change,API,Experience Enhancement

I'm writing a LanguageService plugin for TypeScript that returns custom diagnostics. A `Diagnostic` needs to have a `code` property of type number.

I don't have a number. Instead I can provide a string that represents the name of the rule producing the diagnostic. In addition a random number I would choose looks quite ugly in the tooltip VSCode displays for the Diagnostic.

I know TypeScript only ever creates Diagnostics with numeric `code`, but it's too limiting for plugins.
I looked it up and the LanguageServer protocol specifies it as `code?: number | string`.

My current workaround is to use a type assertion. Until now nothing bad has happened.
Repository: godot
Issue: Getting "Loaded resource as image file" warning, but the code is legit because it runs in editor
Labels: discussion,topic:editor,topic:import

Godot 3.1 alpha2

In my terrain plugin, I deal with images often and also save and load them with `Image.load()` and `Image.save_png()` using the project resource paths. The reason I'm doing this is because I want them to be editable in the editor, and textures are `ImageTextures`, while they will be `StreamTextures` in the exported game (in which case I use `load` normally, unless the game itself also wants to edit them).
On a side note, it forces me to swap between `StreamTexture` and `ImageTexture` quite often, honestly I don't really get the difference between them as an API.

But the point is, it makes the editor throw these warnings often:
```
WARNING: load: Loaded resource as image file, this will not work on export: 'res://tests/terrain7/terrain7.hterrain_data/color.png'. Instead, import the image file as an Image resource and load it normally as a resource.
     At: core/image.cpp:1742
```

I don't know how I am supposed to avoid it. My plugin has to load images, forcing them to have an import option to load them as images is not fit to the task here.
Repository: storybook
Issue: Storysource unable to parse Flow type annotations
Labels: feature request,good first issue,addon: storysource

**Describe the bug**
Storysource is unable to parse Flow type annotations. When the type annotations are removed or by wrapping it around a flow comment the error will go away.

**Code snippets**
Error message from Console
```
./src/form/form.stories.js
Module build failed: SyntaxError: Unexpected token (43:5)
```

Flow example resulting in error
```
type ContactRawFormProps = {
  handleSubmit: Function,
};
const ContactRawForm = (props: ContactRawFormProps) 
```

**System:**
 - OS: Windows10
 - Browser: Chrome
 - Framework: React
 - Addons: 
```
    "@storybook/addon-backgrounds": "3.4.8",
    "@storybook/addon-knobs": "3.4.8",
    "@storybook/addon-notes": "3.4.8",
    "@storybook/addon-storysource": "3.4.8",
```
 - Version:
`    "babel-core": "6.26.3",`

**Additional context**
webpack.config.js
```
      {
        test: /\.stories\.js?$/,
        exclude: [
          path.resolve(__dirname, '../src/old-components'),
          path.resolve(__dirname, '../src/deprecated'),
        ],
        use: [
          {
            loader: require.resolve('@storybook/addon-storysource/loader'),
            options: {
              prettierConfig: {
                parser: 'babylon',
              },
              uglyCommentsRegex: [/^::/],
            },
          },
        ],
        enforce: 'pre',
      },
```
Repository: pytorch
Issue: Am I able to run caffe2 and gloo example: resnet50_trainer.py using pytorch v1.0rc1?
Labels: caffe2

Hello, I was able to run resnet50_trainer.py at the beginning of this year. I noticed that caffe2 merged into pytorch in this October. I am successful in installing pytorch v1.0rc1 and succeed in running pytorch/example/imagenet/main.py in both single node and distributed situation. 
However, I still wanted to run caffe2 and gloo using resnet50_trainer.py. I am frustrated here. I found that when I was building pytorch, caffe2 had also been built. Whereas, the file: build, has changed a lot. I haven't seen an example of successfully running resnet50_trainer.py since October. May I know if someone is able to run this example with pytorch v1.0rc1 and how you run it please?

BTW, I am also wondering how to run pytorch/example/imagenet/main.py using gloo backend. I used --dist-backend 'gloo' in my command, but I feel confused about this option. I used to need to setup redis when I ran with gloo backend. Do I need to setup redis server now and how can I do that to run pytorch/example/imagenet/main.py with gloo in distributed multi nodes situation. 

Another thing is that: since I wanted to make sure that I was using gloo running pytorch/example/imagenet/main.py, I added printf into pytorch/torch/lib/include/gloo/*allreduce* files. However, after I recomplied pytorch, I didn't see any of those printf. Does it mean that pytorch/example/imagenet/main.py is not able to run with gloo, although I added --dist-backend 'gloo' and main.py ran successfully.

Thanks a lot.
Repository: react
Issue: eslint-plugin-react-hooks should report errors inside unnamed functions
Labels: Type: Feature Request,Component: Hooks

I want to report a bug for the hooks plugin.

**What is the current behavior?**
There was no error report after running eslint, but the component failed when running in the browser.
From the chrome dev console it reported "Uncaught Error: Rendered fewer hooks than expected. This may be caused by an accidental early return statement." 

**If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React.
Here is a link to the github repo:
https://github.com/paboulos/react-hooks-eslint

**What is the expected behavior?**
Followed The Hooks API guide which says React hooks provides a linter plugin to enforce these rules automatically.Therefore it should have reported a usage violation when the eslint hooks plugin is specified. 
**Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?**
Using window 10 OS and Chrome browser.
1. First ran npx create-react-app Hooks
2. Installed react 16.7.0-alpha.2 and react-dom 16.7.0-alpha.2
3. Installed eslint dev dependencies:
 "babel-eslint": "9.0.0",
    "babel-loader": "8.0.4",
    "eslint": "5.9.0",
    "eslint-config-airbnb": "17.1.0",
    "eslint-loader": "2.1.1",
    "eslint-plugin-import": "2.14.0",
    "eslint-plugin-jsx-a11y": "6.1.2",
    "eslint-plugin-react": "7.11.1",
    "eslint-plugin-react-hooks": "0.0.0"
4. Created the .eslintrc.json following the instructions from the Hooks API Doc
Then ran package script lint as follows: "npm run lint"
no errors reported.
Then ran package script start as follows: "npm start"
The React component CountHooks calls useState incorrectly and reports error in the browser dev console.
Repository: vscode
Issue: Way to Re-enter Context of the Placeholder Tab Progression While Using Snippets
Labels: feature-request,snippets

When going through tab progression of a long snippet with many different placeholder values to enter, it can be possible to accidentally click a mouse or hit a wrong key that exits from the snippet context altogether. In ST3, if you hit ctr+z, you are taken back within the context of the snippet's tab progression to the place where it was when the last edit was made, and you can then finish the snippet. I think it would be nice if this were the same in VS Code. I don't know how common it is, but I have some very long and complex snippets, and I'm worried about sometimes needing to restart one half way through if I switch from ST3 to VS Code.
Repository: vscode
Issue: Support multiple lineComments in a language config to allow "Remove Line Comment" to work more reliably
Labels: feature-request,editor-comments

In some languages, there may be multiple single-line comment markers, like `//` and `///`. However the language configs can only provide a single lineComment setting which is used by the `Remove Line Comment` command. This makes it hard to uncomment. For example, take this C# code:

```cs
/// <summary>
/// The GetZero method.
/// </summary>
/// <example> 
/// This sample shows how to call the <see cref="GetZero"/> method.
/// <code>
/// class TestClass 
/// {
///     static int Main() 
///     {
///         return GetZero();
///     }
/// }
/// </code>
/// </example>
public static int GetZero()
{
	return 0;
}
```

If you copy/pasted the code from the `<example>` section and tried to remove the comment using `Remove Line Comment` you end up with this:

```cs
/ class TestClass 
/ {
/     static int Main() 
/     {
/         return GetZero();
/     }
/ }
```

We have a similar issue in Dart - we use both `//` and `///`. There are things like [DocFX](https://dotnet.github.io/docfx/spec/triple_slash_comments_spec.html) that encourage triple-slashes too.

Although `Add Line Comment` would only be able to use the first, it'd be nice if in the language declaration we could provide multiple `lineComments` so that removing could handle this case better (it can use the longest comment first when trying to remove the markers):

```js
{
"comments": {
	"lineComment": [ "//", "///" ],
	"blockComment": [ "/*", "*/" ]
},
}
```

Or:

```js
{
"comments": {
	"lineComment": "//",
	"additionalLineComments": [ "///" ],
	"blockComment": [ "/*", "*/" ]
},
}
```