sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: go
Issue: proposal: cmd/vet: check for missing Err calls for bufio.Scanner and sql.Rows
Labels: Proposal,Proposal-FinalCommentPeriod,Analysis

Please answer these questions before submitting your issue. Thanks!

### What version of Go are you using (`go version`)?

```
go version go1.7.3 linux/amd64
```


### What operating system and processor architecture are you using (`go env`)?

```
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/matt"
GORACE=""
GOROOT="/home/matt/.gvm/gos/go1.7.3"
GOTOOLDIR="/home/matt/.gvm/gos/go1.7.3/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build698545690=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
```

### 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.

https://play.golang.org/p/zvrWRVgw4M

Used a `bufio.Scanner` without checking `bufio.Scanner.Err()` for error.  The same mistake occurs frequently with `sql.Rows.Err()`.

### What did you expect to see?

`go vet` should warn that `s.Err()` was not called, and that it should be checked to determine if an error occurred while scanning.

This frequently occurs in our internal codebase at work.  Arguably, `go vet` could check if any type has a method `Err() error` and report if the error is not checked or returned, instead of just checking the special cases with `bufio.Scanner` and `sql.Rows`.  There may also be more types that use this pattern in the standard library.

### What did you see instead?

No warnings from `go vet`.
Repository: youtube-dl
Issue: "--hls-use-mpegts --no-part" should create files with ".ts" extension
Labels: request

OS: Windows Vista SP2 x86, latest OS updates from Microsoft.
Using the latest standalone "youtube-dl.exe" downloaded from Github.

`youtube-dl --version => 2016.11.02`

Also using FFmpeg.exe 3.0 (x86) downloaded from the Zeranoe repo.

The first channel of the Greek National TV broadcaster uses Youtube to host its live stream; 
[ERT1 LIVE](http://webtv.ert.gr/ert1/) => [https://www.youtube.com/watch?v=gnnO4TeJG-4](https://www.youtube.com/watch?v=gnnO4TeJG-4) 
The actual youtube URL changes frequently... 
`--hls-prefer-native` doesn't seem to be able to handle this stream, 
so ffmpeg MUST be used. When issuing: 

`youtube-dl -f 94 --no-part "https://www.youtube.com/watch?v=gnnO4TeJG-4"` 

the stream download is delegated to FFmpeg and (correctly) youtube-dl creates 
a file with the ".mp4" extension. When I `CTRL+C`, the end file is correctly 
identified by MediaInfo to be an MP4 file.
On the contrary, when I issue: 

`youtube-dl -f 94 --hls-use-mpegts --no-part "https://www.youtube.com/watch?v=gnnO4TeJG-4"`

youtube-dl (again) generates a file with file extension ".mp4", but 
the `--hls-use-mpegts` switch creates an MPEG-TS container which has 
(by default) a ".ts" file extension (... at least on Windows)! 
`CTRL+C`ing results in an end file which is, in essence, a ".ts" file, 
as reported by MediaInfo, but with an erroneous ".mp4" extension. 
I have to manually rename the file back to the correct ".ts" extension. 

 I am of the opinion this is a bugged behaviour on the part of the 
application and that youtube-dl should be smart enough to attribute 
the correct file extention (.ts) when `--hls-use-mpegts` is employed...

Many thanks to all the devs' team for their on-going efforts!
Repository: go
Issue: x/crypto/acme/autocert: lock usage around certState is bogus and error prone
Labels: NeedsInvestigation

The use of locks around certState is pretty confusing. The certState method returns the state value either locked or not, which means the call site has no idea about what it got. Then, there's a `locked` boolean field which is used to decide whether to lock it again or release the existing lock. That's both error prone and wrong from a concurrent memory access perspective.
Repository: opencv
Issue: opencv does not build on Mac OS X 10.10 with Xcode 7
Labels: bug,priority: low,category: build/install,platform: ios/osx

##### System information (version)
<!-- Example
- OpenCV => 3.1
- Operating System / Platform => Windows 64 Bit
- Compiler => Visual Studio 2015
-->

- OpenCV => master
- Operating System / Platform => Mac OS X 10.10
- Compiler => Xcode 7 (clang)

##### Detailed description

opencv fails to build, because the `CoreImage` framework can not be found. That is strange, because I can actually see it in the SDK at `/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/CoreImage.framework`.

However, as opencv links agains `QuartzCore.framework`, which already includes `CoreImage`, we do not actually need to link against `CoreImage`. Removing `CoreImage` leads to a successfull build.

##### Steps to reproduce

```
mkdir build
cd build

cmake -D CMAKE_BUILD_TYPE=RELEASE  -D CMAKE_INSTALL_PREFIX=/tmp/opencv  -D INSTALL_C_EXAMPLES=YES -D INSTALL_PYTHON_EXAMPLES=YES -D OPENCV_EXTRA_MODULES_PATH=`pwd`/../../opencv_contrib/modules -D BUILD_EXAMPLES=ON ..

make
```

will fail with

```
ld: framework not found CoreImage
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/libopencv_videoio.3.1.0.dylib] Error 1
```
Repository: go
Issue: build: all.bash fails to saturate 6 cores
Labels: help wanted,ToolSpeed,NeedsInvestigation

`go version devel +eed2bb7 Wed Nov 2 19:21:16 2016 +0000 linux/amd64`

### What did you do?

```
./clean.bash
time ./all.bash
```

### What did you expect to see?

I do my development on a virtualized 6-core Xeon running Ubuntu.  (`runtime.NumCPU()` returns `6`.)

Per @rsc's comments on #10571, I expected "Both the build half and the test half of all.bash should consume nearly all the CPUs for most of the time."

### What did you see instead?

all.bash seems to saturate at ~2 CPU cores for a significant fraction of the run.  It consumes less than twice as much `user` time than `real`.  Oddly, `sys` usage is even higher than `user`; I'm not sure what to make of that.

```
real    8m55.199s
user    14m13.511s
sys     8m51.402s
```

Here's a chart of [CPU saturation over time](https://github.com/golang/go/issues/17751#issuecomment-258011982) as measured by `mpstat`.  You can see that there are a couple bursts of parallelism with mostly poor saturation in between.  The machine doesn't appear to be hitting swap during the build.
Repository: rust
Issue: Consider using incremental linking with msvc
Labels: A-linkage,C-enhancement,I-compiletime,T-compiler,O-windows-msvc

Incremental linking will allow for significantly faster link times, at the cost of binary size.

1. Don't delete the output artifacts. The `.ilk` and `.exe` or `.dll` must remain from the previous run.
2. Don't pass `/OPT` to the linker or any other flag that is mutually exclusive with incremental linking.
3. Pass `/INCREMENTAL` to the linker.
4. The set of files passed to the linker **must** remain the same. If the codegen unit object files change names, then it will do a full link.

https://msdn.microsoft.com/en-us/library/4khtbfyf.aspx

Alternatively, provide LLD as a stable alternative to link.exe so users can benefit from faster links when they don't need any special features of link.exe.
Repository: opencv
Issue: Incorrect upper bound for the number of components in ConnectedComponents algorithms
Labels: bug,category: imgproc

<!--
If you have a question rather than reporting a bug please go to http://answers.opencv.org where you get much faster responses.
If you need further assistance please read [How To Contribute](https://github.com/opencv/opencv/wiki/How_to_contribute).

This is a template helping you to create an issue which can be processed as quickly as possible. This is the bug reporting section for the OpenCV library.
-->

##### System information (version)
<!-- Example
- OpenCV => 3.1
- Operating System / Platform => Windows 64 Bit
- Compiler => Visual Studio 2015
-->

- OpenCV => master
- Operating System / Platform => OSX 10.12.1
- Compiler => Apple LLVM version 8.0.0 (clang-800.0.42.1)

##### Detailed description

New implemented algorithm LablelingGrana has incorrect upper bound for the number of components. And now it's default algorithm for this common case of usage:

   ```.cpp
cv::connectedComponents(image, labels);
   ```

This cause an BAD_ACCESS issue.

##### Steps to reproduce

Here is an example code that may reproduce an issue.
Here number of components is ROWS * COLS / 3,
But in [implementation](https://github.com/sokian/opencv/blob/master/modules/imgproc/src/connectedcomponents.cpp#L351-L353) it's ROWS * COLS / 4.

   ```.cpp
#include <iostream>
#include <opencv2/imgproc.hpp>

const int ROWS = 1;
const int COLS = 500;
int sum = 0;

void testConnectedComponents() {
    cv::Mat img(cv::Size(COLS, ROWS), CV_8U);
    for (int i = 0; i < COLS * ROWS; i += 3) {
        img.data[i] = 1;
    }
    cv::Mat lab;
    sum += cv::connectedComponents(img, lab);
}

int main() {
    int t = 1000000;
    for (int i = 0; i < t; ++i) {
        testConnectedComponents();
    }
    std::cerr << "Sum: " << sum << std::endl;
    return 0;
}

   ```

##### Solution (Updated)
After @kinchungwong comment, issue changed. Upper bounds for both LabelingGrana and LabelingWu was incorrect.

Correct formulas for both cases are:
4-connectivity: `floor((rows * cols + 1) / 2) + 1`
8-connectivity: `floor((rows + 1) / 2) * floor((cols + 1) / 2) + 1`
Repository: go
Issue: x/net/http2: expose CloseIfIdle and ClientConnPoolIdleCloser
Labels: NeedsInvestigation

The http2 `Transport` exposes a `CloseIdleConnections` method that will call the method of the same name on the `ClientConnPool` if it implements the private `clientConnPoolIdleCloser` interface. The `ClientConnPool` implementation calls the private method `closeIfIdle` on each pooled `ClientConn`.

If one want to create a custom `ClientConnPool`, there is no way to make this custom pool support this feature without exposing `CloseIfIdle` method and `ClientConnPoolIdleCloser` interface.
Repository: go
Issue: x/net/http2: add a MarkComplete method to ClientConnPool
Labels: NeedsInvestigation,FeatureRequest

This method can be useful in the context of a custom connection pool, to implement lower max concurrent streams per connection than advertised by the server for example.
Repository: rust
Issue: Tracking issue for TrustedLen (`trusted_len`)
Labels: T-libs-api,B-unstable,C-tracking-issue,A-iterators,Libs-Tracked

Implemented in #37306

Open Questions:

- - [ ] Naming: something with Iterator in the name?
- - [ ] Naming: size vs len
- - [ ] Does TrustedLen pose any requirements on the ExactSizeIterator impl if one exists for the same type?
- - [ ] Does TrustedLen pose any requirements on the Clone impl if one exists for the same type?
- - [ ] Check all the specific impls, including complicated ones like Flatten on arrays or FlatMap that returns arrays.
Repository: rust
Issue: Inherent static methods on traits do not play well with associated types
Labels: A-trait-system,T-compiler,C-bug

It's a nice trick that you can provide static methods on bare traits, but sadly this doesn't quite work with associated types:

```rust
trait Assoc {
    type Ty;
}

impl<T> Assoc<Ty = T> {
    fn non_method() {}
}

fn main() {
    Assoc::non_method()
}
```

Error:

```
error[E0191]: the value of the associated type `Ty` (from the trait `Assoc`) must be specified
  --> <anon>:10:5
   |
10 |     Assoc::non_method()
   |     ^^^^^^^^^^^^^^^^^ missing associated type `Ty` value

error: no associated item named `non_method` found for type `Assoc` in the current scope
  --> <anon>:10:5
   |
10 |     Assoc::non_method()
   |     ^^^^^^^^^^^^^^^^^
```
Repository: go
Issue: runtime: nice -20 causes thread exhaustion on ARM
Labels: NeedsInvestigation

### What version of Go are you using (`go version`)?
go version go1.7.1 linux/arm

### What operating system and processor architecture are you using (`go env`)?
Linux/ARM (RPi 2/3)

### What did you do?
sudo nice -n -20 program

### What did you expect to see?
Program works correctly

### What did you see instead?
Number of threads increase randomly until program crashes with following error "runtime/cgo: pthread_create failed: Resource temporarily unavailable"

gdb reports large number of stalled threads  
  33   Thread 0x671ff460 (LWP 7863) "printer" 0x000a7aa8 in runtime.futex ()
  32   Thread 0x669ff460 (LWP 7864) "printer" 0x000a7aa8 in runtime.futex ()
  31   Thread 0x679ff460 (LWP 7821) "printer" 0x000a7aa8 in runtime.futex ()
  30   Thread 0x681ff460 (LWP 7820) "printer" 0x000a7aa8 in runtime.futex ()
  29   Thread 0x689ff460 (LWP 7811) "printer" 0x000a7aa8 in runtime.futex ()
  28   Thread 0x691ff460 (LWP 7810) "printer" 0x000a7aa8 in runtime.futex ()
  27   Thread 0x6a1ff460 (LWP 7806) "printer" 0x000a7aa8 in runtime.futex ()
  26   Thread 0x699ff460 (LWP 7807) "printer" 0x000a7aa8 in runtime.futex ()
  25   Thread 0x6a9ff460 (LWP 7804) "printer" 0x000a7aa8 in runtime.futex ()
  24   Thread 0x6b1ff460 (LWP 7802) "printer" 0x000a7aa8 in runtime.futex ()
  23   Thread 0x6b9ff460 (LWP 7801) "printer" 0x000a7aa8 in runtime.futex ()
  22   Thread 0x6c1ff460 (LWP 7775) "printer" 0x000a7aa8 in runtime.futex ()
  21   Thread 0x6c9ff460 (LWP 7774) "printer" 0x000a7aa8 in runtime.futex ()
  20   Thread 0x6d1ff460 (LWP 7771) "printer" 0x000a7aa8 in runtime.futex ()
  19   Thread 0x6d9ff460 (LWP 7770) "printer" 0x000a7aa8 in runtime.futex ()

Before crashes usually load where around 7~10. RPi's normal load should be less than 0.2.

I have find out time.Sleep() is the part of the issue specially inside tight loops. Longer delays cause issue appear much less frequently. It gets better or worst depend on structure of code. I could not reproduce it on amd64. 

Removing "nice" make the issue goes away completely. 
Unfortunately I could not prepare small program to reproduce the issue.
Repository: flutter
Issue: Date picker should have an unlimited range mode
Labels: c: new feature,framework,f: material design,f: date/time picker,c: proposal,P3,team-design,triaged-design
Repository: flutter
Issue: Date picker should validate the input arguments
Labels: framework,f: material design,f: date/time picker,c: proposal,P3,team-design,triaged-design

In particular if lastDate < firstDate, for example.

Right now we eventually crash when you click the year in the year picker, or something.
Repository: go
Issue: x/mobile: ndk-build finds wrong library path for dlopen
Labels: NeedsInvestigation,mobile

Hi,
Based on the Android NDK samples (https://github.com/googlesamples/android-ndk/tree/master) and mainly the hello-libs, I'm trying to call a prebuilt library.
In fact, it is pretty simple for a C-based library (using the examples), but when my .so is built using Go, the ndk-build linker seems to go crazy and uses an intermediate path to reference the .so library which causes the app crash.

### Go versions

go version go1.7.1 darwin/amd64

gomobile version +6ecf8ee Sun Oct 16 10:25:40 2016

### Go env

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/me/dev/go/"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/b_/y2nd3vgn4m1929dg56thjdn40000gn/T/go-build047047925=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"

### Steps
On the gomobile example directory, create an Android binding library : 
cd $GOPATH/src/golang.org/x/mobile/example/bind/hello
gomobile bind -target android

extract the so library from the resulting aar.
create a simple .h header to reference the symbol (Java_go_hello_Hello_Greetings)

add the result to the sample project (the same thing as gperf)

without even referencing the function on the main cpp, build the project (gradle build) --> build successful 

install the resulting apk

### What did you expect to see?
a working app

### What did you see instead?

java.lang.UnsatisfiedLinkError: dlopen failed: library "/Users/me/Desktop/vm-win/ndk-build-golang/hello-libs-2/app/src/main/cpp/../../../../distribution/libgo/lib/arm64-v8a/libgojni.so" not found

after decomposing the code and focusing only on the library build (basic ndk project) I still get the same thing : 
java.lang.UnsatisfiedLinkError: dlopen failed: library "/Users/me/dev/android-ndk/hello-libs/app/build/intermediates/ndkBuild/debug/obj/local/arm64-v8a/libgojni.so" not found

When I check the symbols on the intermediate library (libhello-libs.so) I see that the libgojni.so is referenced with a full path instead of just the filename (which is the case of a C-based library)

(both libraries are at the same level when I extract the apk)

Thanks,

### additional info

A C-based library is working but not the Go-based one. Maybe the latter is missing something ?

I've uploaded a buildable project to https://github.com/ab-smith/ndk-build-golang 

I can make it work by patching the libhello-libs.so and fixing the path binary, but this is not a solution.
Repository: godot
Issue: Memory leak with circular reference in GDscript
Labels: enhancement,discussion,topic:core,topic:gdscript

Hi,

Godot reference counting mechanism doesn't support circular references. This is fine for simple construction (e.g. loading References) but given GDscript is build on this, you can write leaking program pretty easily:

```gdscript
func _ready():
	set_process(true)

class Leaker:
	var stuff = null
	var other = null
	func _init():
		# Dummy data to make the leak more visible
		self.stuff = []
		for x in range(1000):
			self.stuff.append(x)

	func connect(other):
		self.other = other

func _process(delta):
	var a = Leaker.new()
	var first = a
	for i in range(100):
		var b = Leaker.new()
		a.connect(b)
		a = b
	a.connect(first)  # Comment this line to remove the leak !
```

This is not a trouble for me (beside a circular dependency checker is complex to code and slow to run) but I think it's something users should be aware of.
I couldn't see any information about this behavior in the documentation so I think there should be a warning about this in [GDscript more efficiently](http://docs.godotengine.org/en/stable/reference/gdscript_more_efficiently.html#pointers-referencing)
Repository: youtube-dl
Issue: Optional parse parameters
Labels: request

### Make sure you are using the *latest* version: run `youtube-dl --version` and ensure your version is *2016.11.04*. If it's not read [this FAQ entry](https://github.com/rg3/youtube-dl/blob/master/README.md#how-do-i-update-youtube-dl) and update. Issues with outdated version will be rejected.
- [x] I've **verified** and **I assure** that I'm running youtube-dl **2016.11.04**

### Before submitting an *issue* make sure you have:
- [x] At least skimmed through [README](https://github.com/rg3/youtube-dl/blob/master/README.md) and **most notably** [FAQ](https://github.com/rg3/youtube-dl#faq) and [BUGS](https://github.com/rg3/youtube-dl#bugs) sections
- [x] [Searched](https://github.com/rg3/youtube-dl/search?type=Issues) the bugtracker for similar issues including closed ones

### What is the purpose of your *issue*?
- [ ] Bug report (encountered problems with youtube-dl)
- [ ] Site support request (request for adding support for a new site)
- [x] Feature request (request for a new functionality)
- [ ] Question
- [ ] Other

---

### What i want to achieve:

For example, if i want to download all Songs from this youtube channel: [EMH Music](https://www.youtube.com/user/EMHmusicPromo/videos)

There are songs that have the following titles:
1. [Joachim Pastor - Laos ](https://www.youtube.com/watch?v=uA0PL49i5Zo)
2. [Erland - Liquid (Chiaro Remix)](https://www.youtube.com/watch?v=hRN66d7mDBI)
3. [[Electro House] Blaynoise - Devil's Dance](https://www.youtube.com/watch?v=FpTRMz_WhpM)
4. [[Dark Electro] Owl Vision - Oblique (Mathematic Remix) ](https://www.youtube.com/watch?v=Wq5Wbg0FtX8)

As you can see there ist different metadata in the title, like the artist, track, genre, alt_title.

I would like to read all of this metadata in a single run.

### How it works (doesn't work) at the moment:

If i define a parse string like
`--metadata-from-title "[%(genre)s] %(artist)s - %(title)s (%(alt_title)s)"`
the parsing only works on the Song 4 and fails on 1, 2 and 3.

### Possible solutions:

**Add a optional flag**

There could be a character in the parse string that flags some part as optional.
For example: `"?[%(genre)s] ?%(artist)s - %(title)s? (%(alt_title)s)?"`
This string would still get the artist and title if the genre or alt_title is missing.

**Allow multiple parse strings:**

There could me multiple parse strings. If the first fails, the second one is parsed and so on. If it doesn't fail it doesn't parse the other strings.
For example: 
`--metadata-from-title "[%(genre)s] %(artist)s - %(title)s (%(alt_title)s)"`
`--metadata-from-title "%(artist)s - %(title)s (%(alt_title)s)"`
`--metadata-from-title "[%(genre)s] %(artist)s - %(title)s"`
`--metadata-from-title "%(artist)s - %(title)s"`
Repository: rust
Issue: Using pattern match directly on LockResult causes deadlock
Labels: A-lifetimes,A-destructors,T-lang,C-bug

Came across this as I was playing around with implementing memoisation via double-checked-locking with `sync::RWLock`:

The following, which puts the `.read()` result into a temporary binding works fine:
```rust
// ...
{
    let lock_result = self.cache.read(); // <-- temporary binding
    match lock_result {
        Ok(ref data) if data.len() > to => Some(data[to].clone()),
        _ => None,
    }
}
.unwrap_or_else(|| {
    // We need to write now, so get a write lock
    let mut data = self.cache.write().unwrap();
// ...
```

The following, which directly matches on the result of `.read()`, dies in a deadlock:
```rust
// ...
{
    match self.cache.read() { // <-- direct pattern matching
        Ok(ref data) if data.len() > to => Some(data[to].clone()),
        _ => None,
    }
}
.unwrap_or_else(|| {
    // We need to write now, so get a write lock
    let mut data = self.cache.write().unwrap();
// ...
```

I'm guessing the direct pattern match is compiled/desugared in a way that the `RwLockReadGuard` never goes out of scope and thus the read lock is never released, but I'm not sure if this is the expected behaviour. It certainly surprised me, especially since the entire "read" block is scoped by its own set of braces.

For extra context, here is the relevant part in [my scratchpad project](https://github.com/lloydmeta/fib-rust/blob/master/src/maths/fib.rs#L80-L107). I have a [concurrency test](https://github.com/lloydmeta/fib-rust/blob/master/tests/maths_tests/fib_tests.rs#L41-L62) for it that fails to finish if the pattern matching section is changed to match the latter case.