id
int64
393k
2.82B
repo
stringclasses
68 values
title
stringlengths
1
936
body
stringlengths
0
256k
labels
stringlengths
2
508
priority
stringclasses
3 values
severity
stringclasses
3 values
236,862,100
go
x/perf/benchstat: Return status code 1 when benchmarks change significantly
Running benchstat on a CI server to detect anomalies relies on the user to parse the output from the command in order to pick up any deltas. To make this process simpler I propose benchstat would return a status code 1 when any of the benchmarks have significant change. In the event that backwards compatibility is required, a new flag could be added to activate this behaviour. Example: ```go // ... var ( flagDeltaTest = flag.String("delta-test", "utest", "significance `test` to apply to delta: utest, ttest, or none") flagAlpha = flag.Float64("alpha", 0.05, "consider change significant if p < `α`") flagGeomean = flag.Bool("geomean", false, "print the geometric mean of each file") flagHTML = flag.Bool("html", false, "print results as an HTML table") flagSplit. = flag.String("split", "pkg,goos,goarch", "split benchmarks by `labels`") flagFailOnChange = flag.Bool("failonchange", false, "returns exit code 1 when benchmarks have significant change") ) func main() { // ... for _,row := Range c.Rows { if row.Changed != 0 { fmt.Fprintln(os.Stderr, "One or more benchmarks have changed significantly") os.Exit(1) } } } ```
NeedsDecision
low
Major
236,948,884
rust
Error message when using non-derived constants from another crate in pattern matching is confusing
The error message is perfectly fine when inside the crate that has the type, because changing or adding a `derive(PartialEq, Eq)` is something you can control. ``` error: to use a constant of type `mime::Mime` in a pattern, `mime::Mime` must be annotated with `#[derive(PartialEq, Eq)]` --> src/main.rs:187:39 | 187 | Some(&ContentType(mime::TEXT_XML)) => (), | ^^^^^^^^^^^^^^ ``` However, when the type isn't in your crate, the message makes the user think the other crate simply "forgot" to implement `PartialEq`, and there is nothing for them to do. A suggestion would be to change the error message when the type is not a crate-local, and add a note of how to fix it. ``` error: a constant of type `mime::Mime` cannot be used in a pattern --> src/main.rs:187:39 | 187 | Some(&ContentType(mime::TEXT_XML)) => (), | ^^^^^^^^^^^^^^ | = note: try pattern guards insteand: `Some(&ContentType(ref a)) if a == &mime::TEXT_XML => (),` ```
C-enhancement,A-diagnostics,T-compiler,D-confusing,D-newcomer-roadblock,A-patterns
low
Critical
236,956,408
flutter
Make Table accessible
Tables are not very accessible. A simple example can be seen in the "recipe details" screen if the Pesto demo app: In the table of ingredients at the bottom you should be able to select an entire row when in accessibility node. Currently, you can only select one cell at a time, making accessibility navigation awkward.
framework,f: material design,a: accessibility,P2,team-design,triaged-design
low
Major
236,975,494
flutter
Stack overflows in tests under package:flutter/
## Steps to Reproduce Add a stack overflow bug to test/widgets/sliver_fill_viewport_test.dart I would hope running the test with a stack overflow would return a stack trace providing some indication of where the stack overflow occurred but does not. Instead the vm appears to hard crash. Output running test with -v: ``` Shell subprocess terminated by ^C (SIGINT, -2) after tests finished. Test: /Users/jacobr/git/flutter/2/flutter/packages/flutter/test/widgets/sliver_fill_viewport_test.dart Shell: /Users/jacobr/git/flutter/2/flutter/bin/cache/artifacts/engine/darwin-x64/flutter_tester package:stream_channel _GuaranteeSink.addError package:flutter_tools/src/test/flutter_platform.dart 216 _FlutterPlatform._startTest.<fn> ===== asynchronous gap =========================== dart:async _asyncThenWrapperHelper package:flutter_tools/src/test/flutter_platform.dart 206 _FlutterPlatform._startTest.<fn> package:flutter_tools/src/test/flutter_platform.dart 371 _FlutterPlatform._startTest ===== asynchronous gap =========================== dart:async _asyncThenWrapperHelper package:flutter_tools/src/test/flutter_platform.dart 143 _FlutterPlatform._startTest package:flutter_tools/src/test/flutter_platform.dart 136 _FlutterPlatform.loadChannel ``` ## Flutter Doctor ``` [✓] Flutter (on Mac OS X 10.12.5 16F73, locale en-US, channel unknown) • Flutter at /Users/jacobr/git/flutter/2/flutter • Framework revision d522c8bdc7 (4 days ago), 2017-06-15 08:02:25 -0700 • Engine revision 784e975672 • Tools Dart version 1.24.0-dev.6.7 [✓] Android toolchain - develop for Android devices (Android SDK 25.0.2) • Android SDK at /Users/jacobr/Library/Android/sdk • Platform android-25, build-tools 25.0.2 • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b06) [✓] iOS toolchain - develop for iOS devices (Xcode 8.3.2) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 8.3.2, Build version 8E2002 ```
c: crash,engine,platform-mac,dependency: dart,P2,team-engine,triaged-engine
low
Critical
237,000,695
youtube-dl
.netrc file: add support for passwords containing spaces
- [X] I've **verified** and **I assure** that I'm running youtube-dl **2017.06.18** ``` $ youtube-dl --version 2017.06.18 ``` - [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 --- ### Description of your *issue*, suggested solution and other information ``` $ cat .netrc machine facebook login "user_login" password "password with spaces" $ cat .config/youtube-dl/config --netrc $ youtube-dl https://www.facebook.com/XXXXXXX/videos/XXXXXXX/ WARNING: parsing .netrc: bad follower token '?????' (/home/user/.netrc, line 1) ``` Is should be possible to quote passwords containing spaces.
external-bugs
low
Critical
237,030,245
rust
Confusing lifetime error with closure
```rust struct Foo<'a> { foo: &'a str } fn main() { let foo = Foo { foo: "foo" }; let closure = |foo: Foo| foo; closure(foo); } ``` Intuitively I don't quite see why this shouldn't compile, but: ``` error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements --> <anon>:5:30 | 5 | let closure = |foo: Foo| foo; | ^^^ | note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the body at 5:19... --> <anon>:5:19 | 5 | let closure = |foo: Foo| foo; | ^^^^^^^^^^^^^^ note: ...so that expression is assignable (expected Foo<'_>, found Foo<'_>) --> <anon>:5:30 | 5 | let closure = |foo: Foo| foo; | ^^^ note: but, the lifetime must be valid for the call at 6:5... --> <anon>:6:5 | 6 | closure(foo); | ^^^^^^^^^^^^ note: ...so type `Foo<'_>` of expression is valid during the expression --> <anon>:6:5 | 6 | closure(foo); | ^^^^^^^^^^^^ ``` Especially bewildering is that `expected Foo<'_>, found Foo<'_>`. Those look the same to me!
C-enhancement,A-lifetimes,A-closures
low
Critical
237,084,377
rust
Rust will memmov |self| when passed by value to inline function
See the assembly for https://is.gd/0Owhgw . Note that you'll need to explicitly specify Release, because I can't link to Release code for some reason. Note this bit here: > movl $400, %edx > movq %rbx, %rsi > callq memcpy@PLT That looks like a very unnecessary and large copy. I ran into this working on rust-selectors for stylo. In the parser, we have a very large stack-allocated SmallVec, under the assumption that it is never moved. I added some inline functions that take the buffer as |self|, and parsing got several percent slower. I rewrote the code to pass things as &mut, and the overhead went away. Interestingly, doing: for x in some_small_vec.into_iter() { ... } Doesn't have any memcpy in the disassembly, despite the fact that into_iter() takes self. Presumably some iterator optimization going on. CC @SimonSapin @mbrubeck @Manishearth @Gankro @jonathandturner
A-LLVM,I-slow,C-enhancement,P-medium,T-compiler,C-optimization
medium
Major
237,248,340
TypeScript
Bad automatic formatting when filling in type argument as object literal
**TypeScript Version:** nightly (2.5.0-dev.20170619) **Code** Type: ```ts declare function f<T>(): void; f<{}>(); ``` **Expected behavior:** Get what you typed. **Actual behavior:** Get: ```ts declare function f<T>(): void; f < {}>(); ```
Bug,Help Wanted,Domain: Formatter
low
Minor
237,312,656
TypeScript
Boolean() cannot be used to perform a null check
**TypeScript Version:** 2.4.0 Apologies for today's issue raising binge. **Code** ```ts // Compiles const nullCheckOne = (value?: number) => { if (!!value) { return value.toFixed(0); } return ''; } const nullCheckTwo = (value?: number) => { if (Boolean(value)) { // Object is possibly 'undefined' return value.toFixed(0); } return ''; } ``` **Expected behavior:** Both examples compile. **Actual behavior:** The latter example fails w/ `Object is possibly 'undefined'`. **Explanation** To my knowledge `!!value` and `Boolean(value)` are equivalent. I'm wondering what is the reason behind not supporting the second case. One reason I can think of would be an imported, non-typescript module, globally overriding it to something like: `Boolean = (value) => !value`.
Suggestion,Awaiting More Feedback
high
Critical
237,318,127
TypeScript
suggestion: explicit "tuple" syntax
### Problem I'm writing this after encountering (what I think is) #3369. I'm a noob to TS, so I apologize for any misunderstandings on my part. The behavior the lack of type inference here: ```typescript interface Foo { bar: [number, number]; } interface McBean { baz: Foo; } // error: McMonkey does not implement McBean class McMonkey implements McBean { baz = { bar: [0, 1] }; } // vs // no error class McMonkey implements McBean { baz: Foo = { bar: [0, 1] }; } ``` Because array literals are (correctly) inferred to be arrays, TS is limited in its ability to infer "tuple". This means there's an added overhead to working with tuples, and discourages use. As I see it, the problem is that a tuple is defined using array literal notation. ### A Conservative Solution Adding a type query (?) such as `tuple` (.e.g `tuple`) would be better than nothing: ```typescript class McMonkey implements McBean { baz = { bar: <tuple [number,number]> [0, 1] }; } ``` ...but this is still clunky, because you'd have to use it just as much as you'd have to explicitly declare the type. ### A Radical Solution There's a precedent (Python) for a tuple syntax of `(x, y)`. Use it: ```typescript interface Foo { bar: (number, number); } interface McBean { baz: Foo; } class McMonkey implements McBean { baz = { bar: (0, 1) }; } ``` #### Obvious Problem The [comma operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comma_Operator) is a thing, so `const oops = 0, 1` is valid JavaScript. `0` is just a noop, and the value of `oops` will be `1`. Python does not have a comma operator (which is meaningful in itself). I've occasionally used the comma operator in a `for` loop, similar to the MDN article. Declaring `var`'s at the top of a function is/was common: ```js function () { var a, b, c; } ``` Parens are of course used in the syntax of loops and conditionals, as well as a means of grouping expressions. A nuance of Python's tuples are that they *must* contain at one or more commas, which *could* help: ```python foo = (0) # syntax error or just `0`; can't recall foo = (0,) # valid tuple ``` ...or it could actually make matters worse, because `(0, )` is an unterminated statement in JavaScript. That all being said, using the suggested Python-like syntax, it seems *difficult* but *possible* for the compiler to understand when the code means "tuple" vs. when it doesn't. * * * I'd be behind any other idea that'd achieve the same end. I don't know how far TS is willing to diverge from JS, and I imagine significant diversions such as the above are not taken lightly. (I apologize if something like this has been proposed before; I searched suggestions but didn't find what I was looking for)
Suggestion,In Discussion
medium
Critical
237,362,225
go
go/format: hasUnsortedImports should also test grouped imports (TODO)
Reminder to resolve TODO in go/format/format.go:hasUnsortedImports: This function always returns true if there are grouped imports, which causes a lot of extra work even if those imports are sorted.
NeedsInvestigation
low
Minor
237,378,819
flutter
PageStorageKeys might benefit from a way to identify their primary client
Internal: b/292548528 Customer Leafy ran into a confusing problem: ExpansionTiles were asserting in initState(): ``` Error: type 'double' is not a subtype of type 'bool' of 'value' ... #0 _ExpansionTileState._isExpanded= (package:flutter/src/material/expansion_tile.dart:81) #1 _ExpansionTileState.initState (package:flutter/src/material/expansion_tile.dart:95) #2 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3502) ... ``` The problem was that the ExpansionTile's were looking up their expanded/collapsed boolean with PageStorage, but only the enclosing PageView specified a PageStorageKey. PageView uses PageStorage to save its double scroll offset. In this case it would have been preferable for the expansion tiles to not save their state. Some possible ways to improve things: - ExpansionTiles don't save their state by default. The dartdoc for a default false keepExpansionState could cover the need for a PageStorageKey. - Scrollables include an inherited widget that only exists to stop the page storage key tree traversal. If a key wasn't found by the time this widget was reached, the traversal would short-circuit. The second approach seems like it would result in most apps quietly getting the behavior they'd expect. It would complicate explaining how PageStorageKeys work a little.
c: crash,framework,f: scrolling,c: proposal,customer: leafy (g3),P2,team-framework,triaged-framework
low
Critical
237,384,921
TypeScript
Include Default Parameter Values in Signature Help
<!-- BUGS: Please use this template. --> <!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript --> <!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md --> From https://github.com/Microsoft/vscode/issues/28925 **TypeScript Version:** 2.4.0 **Feature Request** `signatureHelp` current shows when a parameter is optional but does not include any information about that parameter's default value: ```ts function foo(x = 10) { } foo(|) ``` Result of TSServer `signatureHelp` on `foo` ``` [Trace - 5:42:22 PM] Response received: signatureHelp (378). Request took 20 ms. Success: true Result: { "items": [ { "isVariadic": false, "prefixDisplayParts": [ { "text": "foo", "kind": "functionName" }, { "text": "(", "kind": "punctuation" } ], "suffixDisplayParts": [ { "text": ")", "kind": "punctuation" }, { "text": ":", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "void", "kind": "keyword" } ], "separatorDisplayParts": [ { "text": ",", "kind": "punctuation" }, { "text": " ", "kind": "space" } ], "parameters": [ { "name": "x", "documentation": [], "displayParts": [ { "text": "x", "kind": "parameterName" }, { "text": "?", "kind": "punctuation" }, { "text": ":", "kind": "punctuation" }, { "text": " ", "kind": "space" }, { "text": "number", "kind": "keyword" } ], "isOptional": true } ], "documentation": [], "tags": [] } ], "applicableSpan": { "start": { "line": 3, "offset": 5 }, "end": { "line": 3, "offset": 5 } }, "selectedItemIndex": 0, "argumentIndex": 0, "argumentCount": 0 } ``` When the default value is a simple literal type, it would be helpful to display this default value in the signature help. This information could be included in the `displayParts` response
Suggestion,Awaiting More Feedback,VS Code Tracked,Domain: Signature Help,Domain: Quick Info
high
Critical
237,400,698
youtube-dl
"HTTP Error 401: Unauthorized" if passing in creds or useragent\cookies
## Please follow the guide below - You will be asked some questions and requested to provide some information, please read them **carefully** and answer honestly - Put an `x` into all the boxes [ ] relevant to your *issue* (like that [x]) - Use *Preview* tab to see how your issue will actually look like --- ### Make sure you are using the *latest* version: run `youtube-dl --version` and ensure your version is *2017.06.18*. 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 **2017.06.18** ### 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*? - [X ] Bug report (encountered problems with youtube-dl) - [ ] Site support request (request for adding support for a new site) - [ ] Feature request (request for a new functionality) - [X ] Question - [ ] Other --- ### The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your *issue* --- ### If the purpose of this *issue* is a *bug report*, *site support request* or you are not completely sure provide the full verbose output as follows: Add `-v` flag to **your command line** you run youtube-dl with, copy the **whole** output and insert it here. It should look similar to one below (replace it with **your** log inserted between triple ```): ``` $ youtube-dl -v <your command line> [debug] System config: [] [debug] User config: [] [debug] Command-line args: [u'-v', u'http://www.youtube.com/watch?v=BaW_jenozKcj'] [debug] Encodings: locale cp1251, fs mbcs, out cp866, pref cp1251 [debug] youtube-dl version 2017.06.18 [debug] Python version 2.7.11 - Windows-2003Server-5.2.3790-SP2 [debug] exe versions: ffmpeg N-75573-g1d0487f, ffprobe N-75573-g1d0487f, rtmpdump 2.4 [debug] Proxy map: {} ... <end of log> ``` --- ### If the purpose of this *issue* is a *site support request* please provide all kinds of example URLs support for which should be included (replace following example URLs by **yours**): - Single video: https://www.youtube.com/watch?v=BaW_jenozKc - Single video: https://youtu.be/BaW_jenozKc - Playlist: https://www.youtube.com/playlist?list=PL4lCao7KL_QFVb7Iudeipvc2BCavECqzc Note that **youtube-dl does not support sites dedicated to [copyright infringement](https://github.com/rg3/youtube-dl#can-you-add-support-for-this-anime-video-site-or-site-which-shows-current-movies-for-free)**. In order for site support request to be accepted all provided example URLs should not violate any copyrights. --- ### Description of your *issue*, suggested solution and other information Explanation of your *issue* in arbitrary form goes here. Please make sure the [description is worded well enough to be understood](https://github.com/rg3/youtube-dl#is-the-description-of-the-issue-itself-sufficient). Provide as much context and examples as possible. If work on your *issue* requires account credentials please provide them or explain how one can obtain them. Hello, I suppose the question portion of this is: is VRV supported\compatible? I did try and perform a .\youtube-dl.exe --list-extractors in which case VRV and VRV:SERIES did show up however I have not had much success. I am trying to download episodes\video files from VRV [https://vrv.co] For example: [https://vrv.co/series/GR751KNZY/Attack-on-Titan] I have tried just passing in the URL as the content should be viewable with just a regular user account, but also passed in my premium account creds and or a cookies.txt and user agent (I've tried individually as well as different combinations) `.\youtube-dl.exe : [debug] System config: [] At line:1 char:1 + .\youtube-dl.exe -v https://vrv.co/series/GR751KNZY/Attack-on-Titan ` + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: ([debug] System config: []:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError [debug] User config: [] [debug] Custom config: [] [debug] Command-line args: ['-v', 'https://vrv.co/series/GR751KNZY/Attack-on-Titan', '--user-agent', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36', '--cookies', '.\\vrvcookies.txt'] [debug] Encodings: locale cp1252, fs mbcs, out cp1252, pref cp1252 [debug] youtube-dl version 2017.06.18 [debug] Python version 3.4.4 - Windows-10-10.0.15063 [debug] exe versions: none [debug] Proxy map: {} [vrv:series] GR751KNZY: Downloading webpage [vrv:series] GR751KNZY: Downloading resource path JSON metadata ERROR: Unable to download JSON metadata: HTTP Error 401: Unauthorized (caused by HTTPError()); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and include its complete output. File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmp_9wocfhk\build\youtube_dl\extractor\common.py", line 502, in _request_webpage File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmp_9wocfhk\build\youtube_dl\YoutubeDL.py", line 2129, in urlopen File "C:\Python\Python34\lib\urllib\request.py", line 470, in open File "C:\Python\Python34\lib\urllib\request.py", line 580, in http_response File "C:\Python\Python34\lib\urllib\request.py", line 508, in error File "C:\Python\Python34\lib\urllib\request.py", line 442, in _call_chain File "C:\Python\Python34\lib\urllib\request.py", line 588, in http_error_default `
geo-restricted,account-needed
low
Critical
237,400,900
vscode
[folding] Allow to show amount of lines folded
Hi people! I would like to see vscode folding with info about lines folded like Netbeans. Looks like this: ![screenshot_20170620_215124](https://user-images.githubusercontent.com/3067335/27364923-e9a04724-5602-11e7-8c29-4eb09044544a.png) BTW: Thank you for this awesome code editor! :smile:
feature-request,editor-folding
low
Minor
237,428,516
TypeScript
Imported const enum is not inlined in generated code
**TypeScript Version:** 2.4.0 **Code** ```ts // a.ts export const enum Foo { Bar = 'bar' } // b.ts import { Foo } from './a' Foo.Bar // TypeError or ReferenceError, depending on how it's compiled ``` **Expected behavior:** `Foo.Bar` to be replaced with `'bar'` **Actual behavior:** The import is deleted and `Foo.Bar` is left as is
Bug
medium
Critical
237,453,341
pytorch
Factorized Output Layer
Does PyTorch provide a [factorized output layer](https://arxiv.org/pdf/1412.7091.pdf) in `nn` module? It computes the gradient much faster in sparse output space. This will benefit a lot in NLP experiments. I can propose such a layer if there isn't one.
todo,feature,triaged
low
Minor
237,479,192
go
x/net/html: readRawOrRCDATA() parsing issue when text ends with '<'
### What version of Go are you using (`go version`)? `go version go1.8.3` `golang.org/x/net/html: 057a25b06247e0c51ba15d8ae475feb2fcb72164` ### What operating system and processor architecture are you using (`go env`)? `linux/amd64` ### What did you do? Tried to parse HTML that contains a textarea that ends with `<`. Minimal example below: ```go package main import ( "fmt" "strings" "golang.org/x/net/html" ) func main() { example := `<textarea>ends with <</textarea>` z := html.NewTokenizer(strings.NewReader(example)) for { tt := z.Next() switch tt { case html.ErrorToken: return case html.TextToken: txt := z.Text() fmt.Printf("$%s$ ", txt) case html.StartTagToken: tn, _ := z.TagName() fmt.Printf("<%s> ", tn) case html.EndTagToken: tn, _ := z.TagName() fmt.Printf("</%s> ", tn) } } } ``` ### What did you expect to see? `<textarea> $ends with <$ </textarea>` ### What did you see instead? `<textarea> $ends with <</textarea>$` ### Possible solution This diff fixes the problem and passes all tests, but not sure it is correct in all cases and according to the HTML spec: ```diff diff --git a/html/token.go b/html/token.go index 893e272..41cb76f 100644 --- a/html/token.go +++ b/html/token.go @@ -347,6 +347,7 @@ loop: break loop } if c != '/' { + z.raw.end-- continue loop } if z.readRawEndTag() || z.err != nil { diff --git a/html/token_test.go b/html/token_test.go index 20221c3..f8e3fdf 100644 --- a/html/token_test.go +++ b/html/token_test.go @@ -254,6 +254,11 @@ var tokenTests = []tokenTest{ "<textarea>$&lt;div&gt;$</textarea>", }, { + "textarea ends with '<'", + "<textarea><</textarea>", + "<textarea>$&lt;$</textarea>", + }, + { "title with tag and entity", "<title><b>K&amp;R C</b></title>", "<title>$&lt;b&gt;K&amp;R C&lt;/b&gt;$</title>", ```
NeedsInvestigation
low
Critical
237,536,881
youtube-dl
[sohu] Support playlists on tv.sohu.com
## Please follow the guide below - You will be asked some questions and requested to provide some information, please read them **carefully** and answer honestly - Put an `x` into all the boxes [ ] relevant to your *issue* (like that [x]) - Use *Preview* tab to see how your issue will actually look like --- ### Make sure you are using the *latest* version: run `youtube-dl --version` and ensure your version is *2017.06.18*. 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 **2017.06.18** ### 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*? - [x] Bug report (encountered problems with youtube-dl) - [ ] Site support request (request for adding support for a new site) - [ ] Feature request (request for a new functionality) - [ ] Question - [ ] Other --- ### The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your *issue* --- ### If the purpose of this *issue* is a *bug report*, *site support request* or you are not completely sure provide the full verbose output as follows: Add `-v` flag to **your command line** you run youtube-dl with, copy the **whole** output and insert it here. It should look similar to one below (replace it with **your** log inserted between triple ```): ``` $ youtube-dl -v <your command line> [debug] System config: [] [debug] User config: [] [debug] Command-line args: [u'-v', u'http://www.youtube.com/watch?v=BaW_jenozKcj'] [debug] Encodings: locale cp1251, fs mbcs, out cp866, pref cp1251 [debug] youtube-dl version 2017.06.18 [debug] Python version 2.7.11 - Windows-2003Server-5.2.3790-SP2 [debug] exe versions: ffmpeg N-75573-g1d0487f, ffprobe N-75573-g1d0487f, rtmpdump 2.4 [debug] Proxy map: {} ... <end of log> ``` --- ### If the purpose of this *issue* is a *site support request* please provide all kinds of example URLs support for which should be included (replace following example URLs by **yours**): - Single video: https://www.youtube.com/watch?v=BaW_jenozKc - Single video: https://youtu.be/BaW_jenozKc - Playlist: https://www.youtube.com/playlist?list=PL4lCao7KL_QFVb7Iudeipvc2BCavECqzc Note that **youtube-dl does not support sites dedicated to [copyright infringement](https://github.com/rg3/youtube-dl#can-you-add-support-for-this-anime-video-site-or-site-which-shows-current-movies-for-free)**. In order for site support request to be accepted all provided example URLs should not violate any copyrights. --- ### Description of your *issue*, suggested solution and other information Explanation of your *issue* in arbitrary form goes here. Please make sure the [description is worded well enough to be understood](https://github.com/rg3/youtube-dl#is-the-description-of-the-issue-itself-sufficient). Provide as much context and examples as possible. If work on your *issue* requires account credentials please provide them or explain how one can obtain them. only able to detect & download the first segment of the video (note: need to use china ip in order to watch/download this video)... http://tv.sohu.com/20140820/n403626737.shtml
request,geo-restricted
low
Critical
237,547,430
go
x/image/tiff: package does not support image resolution
Please answer these questions before submitting your issue. Thanks! ### What version of Go are you using (`go version`)? `go1.8 darwin/amd64` ### What operating system and processor architecture are you using (`go env`)? `Darwin/amd64` ### What did you do? Take a tiff image and attempt to decode it with the golang.org/x/image/tiff package. ### What did you expect to see? I expected a method like this `DecodeResolution(r io.Reader) (Resolution, error)` where `Resolution` is structure like this ` type Resolution struct { X, Y int } ` P.S. Now I have a local patch to solve this problem, but I'd like to have it in the library.
NeedsInvestigation
low
Critical
237,547,778
rust
debuginfo: Subroutine types are not ABI-adjusted
Arguments of a type like `[u8; 4]` are actually passed as a single `u32` to a function. At the moment, the debuginfo code does not try to reflect this transformation in any way. This is not important for inspecting function arguments, since they are copied into a local alloca of the correct type, but it might be a problem for debuggers that want to call a function based on its type.
A-debuginfo,T-compiler,C-bug
low
Critical
237,557,833
opencv
Ptr<DescriptorExtractor> unsupported by Java wrappers generator
##### System information (version) - OpenCV => 3.2.0-813-g16368a2 - Operating System / Platform => Ubuntu 16.04, 64 bits - Compiler => cmake, g++ 5.4.0 ##### Detailed description The type Ptr&lt;DescriptorExtractor&gt; is unrecognized by the Java wrappers generator. In particular, the class BOWImgDescriptorExtractor can not be used in Java because its constructor has no wrapper. From the generated Java file: // C++: BOWImgDescriptorExtractor(Ptr_DescriptorExtractor dextractor, Ptr_DescriptorMatcher dmatcher) // // Unknown type 'Ptr_DescriptorExtractor' (I), skipping the function
feature,category: java bindings
low
Minor
237,629,147
kubernetes
Port-forward for UDP
Kubernetes currently supports port forwarding only for TCP ports. However, Pod/service might expose UDP port too.
area/kubectl,sig/node,kind/feature,sig/cli,priority/important-longterm,lifecycle/frozen,triage/accepted
high
Critical
237,630,119
go
go/ast: Free-floating comments are single-biggest issue when manipulating the AST
Reminder issue. The original design of the go/ast makes it very difficult to update the AST and retain correct comment placement for printing. The culprit is that the comments are "free-floating" and printed based on their positions relative to the AST nodes. (The go/ast package is one of the earliest Go packages in existence, and this is clearly a major design flaw.) Instead, a newer/updated ast should associate all comments (not just Doc and Comment comments) with nodes. That would make it much easier to manipulate a syntax tree and have comments correctly attached. The main complexity with that approach is the heuristic that decides which comments are attached to which nodes.
Refactoring
high
Critical
237,634,072
opencv
Need ability to control bitrate in VideoWriter with H264 codec
<!-- 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 => 3.2 - Operating System / Platform => osx ##### Detailed description There is no bitrate param in constructor of ```VideoWriter``` class in videoio module, however there is ```cv::VIDEOWRITER_PROP_QUALITY``` property in range ```[0...100]``` but it is used only for ```MotionJpegWriter```. Atm bitrate inside ```CvVideoWriter_FFMPEG``` is hardcoded https://github.com/opencv/opencv/blob/master/modules/videoio/src/cap_ffmpeg_impl.hpp#L1967 and later is actually reset to 0 for H264 https://github.com/opencv/opencv/blob/master/modules/videoio/src/cap_ffmpeg_impl.hpp#L1533 So the question is what is the best way to control quality of output video file - use ```VIDEOWRITER_PROP_QUALITY``` or pass bitrate directly in constructor? I need ability to control output video file size / quality. @alalek I can implement this, but need your suggestions what is the best way to do it. ##### Steps to reproduce <!-- to add code example fence it with triple backticks and optional file extension ```.cpp // C++ code example ``` or attach as .txt or .zip file -->
feature,category: videoio,RFC
medium
Critical
237,652,486
rust
Doc block ignored for `pub extern crate`
Looks like doc blocks for `pub extern crate` are ignored and don't show up anywhere in the generated documents. So, this code ``` /// Unicode Character Database. pub extern crate unic_ucd as ucd; /// Unicode Bidirectional Algorithm (USA\#9). pub extern crate unic_bidi as bidi; /// Unicode Normalization Forms (USA\#15). pub extern crate unic_normal as normal; /// Unicode IDNA Compatibility Processing (UTS\#46). pub extern crate unic_idna as idna; ``` Results in this output: <img width="429" alt="screen shot 2017-06-21 at 2 18 10 pm" src="https://user-images.githubusercontent.com/37169/27404767-7a3c30c0-568c-11e7-9c4c-99562a27947f.png"> I believe it's not intentional and just a missing feature because of the (kind of) new `pub extern crate` syntax. Is that correct?
T-rustdoc,E-mentor,C-bug
low
Minor
237,665,439
react
Feature request: Add a "module" entry in package.json to export ES2015 version of React
**Do you want to request a *feature* or report a *bug*?** Request a feature **What is the current behavior?** React ecosystem was promoting ES6 classes and modules since 2014 and many packages like react-router, redux and so on, have an "es" folder in the npm package with source code in ES2015 modules. Unless I am missing something, it is strange that React itself does not offer that option. **If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template: https://jsfiddle.net/84v837e9/).** Install react and try to import it in a browser with native modules enabled. **What is the expected behavior?** Have an "es" folder in the npm package with ES2015 modules source code, like most React ecosystem projects do. Allow to import react from ES2015 native modules to make developer workflow more simple. **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** All versions
Component: Build Infrastructure,Type: Feature Request
high
Critical
237,670,027
flutter
Document how to download an image in the dartdocs for Image.network
Today, to get an image from an image widget, you have to jump through a few steps: ```dart Image image = new Image.network('https://i.stack.imgur.com/lkd0a.png'); Completer<ui.Image> completer = new Completer<ui.Image>(); image.image .resolve(new ImageConfiguration()) .addListener((ImageInfo info, bool _) => completer.complete(info.image)); ``` It would be pretty nice if we had a convenience method like this: ```dart Image image = new Image.network('https://i.stack.imgur.com/lkd0a.png'); ui.Image actualImage = await image.uiImage; ``` (strawman names, of course)
framework,d: api docs,has reproducible steps,P2,found in release: 3.3,found in release: 3.5,team-framework,triaged-framework
low
Major
237,682,090
go
runtime: signal handling: sighandler crash due to race with signal.Ignore
In reviewing @ianlancetaylor's [CL 46003](https://golang.org/cl/46003) (addressing #14571), I noticed what I believe to be a rare race-condition that could result in unexpected termination of a Go program. I attempted to write a reproducer for the race in question, which would cause the program to erroneously exit if a `_SigKill` or `_SigThrow` signal arrives in between a call to `signal.Notify` and `signal.Ignore` for that signal. The symptom I was looking for is a termination with the same signal number (for `_SigKill`) or a goroutine dump (for `_SigThrow`). Unfortunately, I am unable to reproduce the race in question because the program instead crashes with a `SIGSEGV` in `runtime.sigfwd`. sigrace/sigrace.go: ```go package main import ( "os" "os/signal" "runtime" "syscall" ) func main() { signal.Ignore(syscall.SIGHUP) go func() { runtime.LockOSThread() pid := os.Getpid() tid := syscall.Gettid() for { syscall.Tgkill(pid, tid, syscall.SIGHUP) } }() c := make(chan os.Signal, 1) for { signal.Notify(c, syscall.SIGHUP) signal.Ignore(syscall.SIGHUP) } } ``` ``` $ go version go version devel +c4e0e81653 Wed Jun 21 15:54:38 2017 +0000 linux/amd64 $ go build sigrace && ./sigrace Segmentation fault (core dumped) ``` Investigation with GDB gives the following stack trace: ``` #0 0x0000000000000001 in ?? () #1 0x0000000000452a6d in runtime.sigfwd () at /home/bcmills/go/src/runtime/sys_linux_amd64.s:245 #2 0x000000c420053b18 in ?? () #3 0x000000000043b665 in runtime.sigfwdgo (sig=1, info=0xc420053d70, ctx=0xc420053c40, ~r3=false) at /home/bcmills/go/src/runtime/signal_unix.go:606 #4 0x000000000043a83b in runtime.sigtrampgo (sig=1, info=0xc420053d70, ctx=0xc420053c40) at /home/bcmills/go/src/runtime/signal_unix.go:272 #5 0x0000000000452ac3 in runtime.sigtramp () at /home/bcmills/go/src/runtime/sys_linux_amd64.s:265 #6 0x0000000000452bb0 in ?? () at /home/bcmills/go/src/runtime/sys_linux_amd64.s:349 #7 0x0000000000000000 in ?? () ``` The faulting instruction in `runtime.sigfwd` is the `CALL` instruction that invokes `fwdSig[sig]` (CC @aclements)
NeedsInvestigation,compiler/runtime
low
Critical
237,737,480
flutter
Flutter should respect proxy settings on Windows during Dart SDK download
I met errors when running flutter doctor. It's related with proxy settings. ## Flutter Doctor ``` Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\CNFEHU1>flutter doctor Checking Dart SDK version... Downloading Dart SDK 1.24.0-dev.6.7... Start-BitsTransfer : HTTP status 407: Proxy authentication is required. At C:\Users\CNFEHU1\Documents\GitHub\flutter\bin\internal\update_dart_sdk.ps1:4 4 char:19 + Start-BitsTransfer <<<< -Source $dartSdkUrl -Destination $dartSdkZip + CategoryInfo : InvalidOperation: (:) [Start-BitsTransfer], Exce ption + FullyQualifiedErrorId : StartBitsTransferCOMException,Microsoft.Backgrou ndIntelligentTransfer.Management.NewBitsTransferCommand Error: Unable to update Dart SDK. Retrying... ```
tool,platform-windows,P2,team-tool,triaged-tool
low
Critical
237,861,648
go
encoding/xml: unmarshal only processes first XML element
If you Marshal []int{1,2} you get `<int>1</int><int>2</int>`, but then if you Unmarshal it back into a new slice, you get just []int{1}. Unmarshal simply stops after the first top-most XML element, because it is implemented as NewDecoder(bytes.NewReader(data)).Decode(v). When v is not a slice, this makes sense. But if v is a slice there's an argument that maybe Unmarshal should repeat the Decode calls until it reaches the end of the data. That's maybe easier said than done, and also maybe not a compatible change, but we should at least consider it. The Decoder itself is right to process only a single element, since it is processing an arbitrary input stream that might block if one reads too far. But Unmarshal, holding a []byte, has perfect knowledge of the remainder of the stream and might be able to do better. Or perhaps Unmarshal should return an error. ``` package main import ( "encoding/xml" "fmt" "log" ) func main() { x1 := []int{1, 2} out, _ := xml.Marshal(x1) fmt.Println("XML:", string(out)) // <int>1</int><int>2</int> x2 := []int{3} if err := xml.Unmarshal(out, &x2); err != nil { log.Fatal(err) } fmt.Println(x2) // [3 1] not [3 1 2] } ``` In contrast, the equivalent input given to json.Unmarshal produces an error: ``` package main import ( "encoding/json" "fmt" "log" ) func main() { out := []byte("[1] [2]") x2 := []int{3} if err := json.Unmarshal(out, &x2); err != nil { log.Fatal(err) // invalid character '[' after top-level value } fmt.Println(x2) } ``` This is more justified in the case of JSON, since Marshaling []int{1,2} does not produce `[1] [2]`.
NeedsDecision,early-in-cycle
low
Critical
237,887,325
three.js
Soft particles
Hi guys, I was looking for soft particles for my project, but I did not find anything on that. Having spent a little time and energy, I still managed to make soft particles and decided to suggest introducing it into the library as a plug-in or something like that. All the code and how it works I wrote here. https://discourse.threejs.org/t/soft-particles-render/504/3?u=korner It would be cool if you could do so ``` material.soft = true; material.softDistance = 50; ``` But the problem as I understand that it will be necessary to constantly render the texture of the depth. It is possible to make a condition for rendering `renderer.softRender = true;` I think there is little change, you can add it to the library :)
Suggestion
low
Minor
237,923,563
go
proposal: time/v2: make Duration safer to use
`time.Duration` is currently very prone to accidental misuse, especially when interoperating with libraries and/or wire formats external to Go (c.f. http://golang.org/issue/20678). Some common errors include: * Unchecked conversions from floating-point seconds. * Unchecked overflow when multiplying `time.Duration` values. * Conversion from floating-point to `time.Duration` before scaling instead of after. * Accidentally scaling an already-scaled value during conversion. https://play.golang.org/p/BwwVO5DxTj illustrates some of these issues. The bugs are unsurprising once detected, but subtle to casual readers of the code — and all of the errors currently produce unexpected values _silently_. (Some but not all of them would be caught by #19624.) For Go 2, I believe we should revisit the `Duration` part of the `time` API. ---- A quick survey of other languages shows that Go's `Duration` type is unusually unsafe. Among modern languages, only [Swift](https://developer.apple.com/documentation/foundation/timeinterval) appears to be prone to the same bugs as Go. **Out-of-range conversion and overflow** Exceptions: * The Rust constructor [panics](https://doc.rust-lang.org/std/time/struct.Duration.html#panics) on out-of-range conversions and provides `checked` variants of arithmetic operations. * C# raises `OverflowException` or `ArgumentException` for out-of-range arguments (to [FromMilliseconds](https://msdn.microsoft.com/en-us/library/system.timespan.frommilliseconds(v=vs.110).aspx) and friends). * Java doesn't appear to have an explicit conversion operator, but raises `ArithmeticException` on overflow to its [arithmetic methods](https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html#plusNanos-long-). * Python's [`timedelta`](https://docs.python.org/2/library/datetime.html#timedelta-objects) raises `OverflowError`. * Standard ML raises the `Time` exception if the argument is out of range. Floating-point or arbitrary-precision representations: * [C++11](http://en.cppreference.com/w/cpp/chrono/duration) allows the use of floating-point representations; I would expect that overflow with integer representations is undefined. * The only [OCaml](https://ocaml.janestreet.com/ocaml-core/109.31.00/doc/core/Time.Span.html) time package I could find uses a floating-point representation. * The Haskell [constructor](https://hackage.haskell.org/package/time-units-1.0.0/docs/Data-Time-Units.html#t:TimeUnit) takes an arbitrary-precision `Integer` argument, but it [does not appear to check](https://stackoverflow.com/questions/24338673/why-does-flooring-infinity-not-throw-some-error) ranges on floating-point to integer conversions. **Double-scaling** * [Rust](https://doc.rust-lang.org/std/time/struct.Duration.html#method.mul), [Java](https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html#multipliedBy-long-), [Python](https://docs.python.org/2/library/datetime.html#timedelta-objects), [C++11](http://en.cppreference.com/w/cpp/chrono/duration/operator_arith4), and [OCaml](https://ocaml.janestreet.com/ocaml-core/109.31.00/doc/core/Time.Span.html) all have asymmetric scaling or multiplication operations: you can scale a duration by a float or an integer, but you cannot scale a duration by a duration. * The Haskell type system will reject attempts at double-conversion: converting an `Integer` to a `TimeInterval` is an explicit function call, not just a reinterpretation of the type. However, it won't stop you from erroneously multiplying a `TimeInterval` by a `TimeInterval`. * [C#](https://msdn.microsoft.com/en-us/library/system.timespan(v=vs.110).aspx) and [Standard ML](http://sml-family.org/Basis/time.html) do not support multiplying time intervals at all, requiring a round-trip conversion through a primitive number type in user code.
v2,Proposal
medium
Critical
237,924,377
flutter
Flutter doctor should tell you that updates to the Android SDK are available
Currently, it's hard for Flutter users to learn about updates to the Android SDK. This can get them into strange error situations: E.g. if they pull in a plugin that depends on the latest SDK, building your Flutter app will fail with the unhelpful error message: `Could not find com.google.firebase:firebase-auth:11.0.1`. This error can easily be resolved by updating the "Google Repository" component in the Android SDK to the latest version (except the error doesn't tell you to do this). People, who rarely start Android Studio, don't really have a way of learning about updates to the Android SDK. Maybe we can have a `flutter doctor` check that tells you: BTW, there is an update to the Android SDK available. You should probably download it. (maybe with a link to https://developer.android.com/studio/intro/update.html#sdk-manager) Bonus points: We could also implement a `flutter update-android` command that brings everything upto date. This could be implemented via the `sdkmanager` CLI from the Android SDK (see https://developer.android.com/studio/command-line/sdkmanager.html#update_all_installed_packages). Or just point to `sdkmanager --update` (if sdkmanager is in the path by default). /cc @tvolkert @collinjackson @mit-mit
platform-android,tool,P3,a: plugins,team-android,triaged-android
low
Critical
237,952,325
TypeScript
ThisType for Ember.computed and Ember.observer
**TypeScript Version:** 2.3.4 Thanks for your work on this great project :) **Context** _We are experimenting with TypeScript 2.x in Ember, and the new TypeScript 2.x features really enable us to type most of our Ember code. There is however one thing we came across that doesn't seem like something we can solve in our interfaces/declarations:_ It seems that there currently is no way to get the `this` context inside the Ember.computed and Ember.observer pattern. **`ThisType` not compatible with Ember.computed and Ember.observer?** We have set up some experimental interfaces for Ember.Object.extend() (inspired by Vue.js' type declarations, @ember/types and various other sources) https://github.com/draios/ember-typescript2/blob/master/app/types/ember/ember-types.d.ts#L78-L83 These types/interfaces are working so far; all methods and hooks have the proper `this` type, and class properties are accessible through getters and setters. However when it comes to computed properties, there seems to be no way to get the proper `this` context inside the function passed to Ember.computed() (see example below). **Code** ```ts export default Ember.Object.extend({ myProp: true, myMethod: function() { // myProp is accessible because of ThisType this.get('someProperty'); } computedProperty: Ember.computed('someProperty', function() { // myProp is not accessible, because `this` is set to type <any> let myVal = this.get('someProperty'); // ... both `this` and `myVal` are of type <any> // and no way to fix this from an external interface? }); }); ``` Is this Ember pattern supported somehow in TypeScript? Thanks! --- N.B. I tried something like the following, but it doesn't work (X becomes of type `{}`). ``` // the function passed to Ember.computed type ComputedPropertyFunc<T, X> = (this: X) => T // Ember.computed with one observed property and a function function computed<T, X>(observedProperty1: string, fn: ComputedPropertyFunc<T, X>): T & ThisType<X> ```
Suggestion,Needs Proposal
low
Major
237,960,303
rust
macro_rules! macros do not backtrack
I'm mainly filing this to be able to close other issues whose problems come down to this. I don't know if we want to fix this or will fix this, but at least there will be a single issue for it.
A-macros,C-feature-request
low
Major
237,965,934
go
proposal: net/http/httputil/v2: split into focused subpackages
This proposal builds on https://github.com/golang/go/issues/7907 (remove deprecated stuff) and https://github.com/golang/go/issues/19660 (refactor `ioutil` to provide a coherent abstraction). `httputil` currently contains: * `Dump{Request,RequestOut,Response}`: "It should only be used by servers to debug client requests." These would be clearer in a `net/http/debug` subpackage. * `NewChunked{Reader,Writer}`: "not needed by normal applications. The http package automatically decodes chunking when reading response bodies." Not obvious why it's exported, but it could easily go in a `net/http/chunked` subpackage. * `ReverseProxy`: Could easily go in a separate `net/http/proxy` subpackage. * `BufferPool`: has ~nothing to do with HTTP, and if it is still useful implies a garbage-collector issue that we should address instead. * `ClientConn`: "We should have deleted it before Go 1." * `ServerConn`: "We should have deleted it before Go 1." (@bradfitz)
v2,Proposal
low
Critical
237,978,617
rust
Peer credentials on Unix socket
https://github.com/tokio-rs/tokio-uds/pull/13 was recently merged, so I'd like to open an issue of adding same thing to stdlib. TL;DR It allows one to get effective UID and GID of the process which created the remote socket. I suggest to test it with Tokio now and when there is consensus, we can merge similar change. I need this function, so I'm going to test it anyway.
T-libs-api,C-tracking-issue
medium
Critical
237,995,375
kubernetes
Extract application-based upgrade tests to examples repo
These are the tests that verify real app connectivity during node upgrades. It's testing a confluence of features, but it's also testing that a particular arrangement of StatefulSet/ReplicaSet and PodDisruptionBudget is actually correct for the app in question. This was brought up during the review of #47200. These are e2e tests written our e2e/upgrade framework. So one question is do we start treating the e2e/upgrade framework more like an API that other repos can consume? (Maybe we're already doing this?) @maisem @kargakis @kubernetes/sig-testing-bugs
priority/important-soon,kind/cleanup,sig/apps,sig/testing,lifecycle/frozen
low
Critical
238,014,320
rust
*const T has quite a few methods that seem like they don't need to require T: Sized
Not sure which exactly, but we should evaluate and relax bounds where possible. See also https://github.com/rust-lang/rust/issues/24794, https://github.com/rust-lang/rust/issues/36952.
C-enhancement,T-libs-api
low
Major
238,033,584
bitcoin
listsinceblock incorrectly showing some conflicted transactions
Normally when a transaction is conflicted, listsinceblock will show it as having negative confirmations, representing how long ago it conflicted. However, looking at the results of my listsinceblock shows dozens of conflicted transactions with 0 confirmations (as well as transactions whos parents have long been forgotten by the network). An example: ``` { "account": "", "address": "1AM7qmzyzkZecxn5hTPUCbBbog3r3YbVyE", "category": "receive", "amount": 0.00684870, "label": "", "vout": 0, "confirmations": 0, "trusted": false, "txid": "f108f58235e35f3eb07d24d9d330f6098234137dd505bbd19ff249d809254f2d", "walletconflicts": [ ], "time": 1493696422, "timereceived": 1493696422, "bip125-replaceable": "unknown" } ``` Which would make you think it's a pending receive, so lets dive deeper: ``` bitcoin-cli gettransaction f108f58235e35f3eb07d24d9d330f6098234137dd505bbd19ff249d809254f2d { .... "hex": "0100000001975c0acaefcc4abc471c5d9fe8de6ee5d6e76e7f01a089466f0a73c5f23dc36c000000006b48304502210088baffcff66ade8770a802888c868071291be4f6c6b7427e9938dbf2c9df6ee6022028a9a1af3e7e0ef4cdf42b3b6cc3113787e4db29922c1b90e182b2f1665be83e012102efdaa4cbd4fb4edd41978403a4343786462fefa514f98cbe1894f7053a1216c2ffffffff0146730a00000000001976a9146687296e39b87666fcbff34738c984eca686451e88ac00000000" } ``` Decoding that, you'll see it's sourcing: ```{ "txid": "6cc33df2c5730a6f4689a0017f6ee7d6e56edee89f5d1c47bc4accefca0a5c97", "vout": 0 }``` Which is a transaction that has not confirmed, nor in my nodes mempool. Fortunately we can find it on [tradeblock](https://tradeblock.com/bitcoin/tx/6cc33df2c5730a6f4689a0017f6ee7d6e56edee89f5d1c47bc4accefca0a5c97 ), and see it's conflicted with dd0ab2618d4df044d369b56ce96f6f8d9dca6e04f4c180fa73e8ace20b3653e3 which has long confirmed. So this means that our original transaction is just sitting in listsinceblock is actually conflicted and impossible to ever confirm, yet not marked as such.
Wallet,RPC/REST/ZMQ
low
Major
238,038,730
rust
Add drain_filter for BinaryHeap
`std::collections::BinaryHeap` is missing a `drain_filter` method (rust-lang/rfcs#2140). <!-- TRIAGEBOT_START --> <!-- TRIAGEBOT_ASSIGN_START --> <!-- TRIAGEBOT_ASSIGN_DATA_START$${"user":null}$$TRIAGEBOT_ASSIGN_DATA_END --> <!-- TRIAGEBOT_ASSIGN_END --> <!-- TRIAGEBOT_END -->
A-collections,T-libs-api,E-help-wanted,C-feature-accepted
high
Critical
238,042,956
nvm
Can't run `npm run test/fast` locally
Since 7f3145bc98b9355d26ee5da730fb9c4df7201b18, there is a new unit test called `nvm_default_packages` that I can never pass, both on Ubuntu and Mac Error message: ``` ✗ nvm_default_packages touch: cannot touch '/default-packages': Permission denied ./nvm_default_packages: line 26: /default-packages: Permission denied Downloading and installing node v6.10.1... Downloading https://nodejs.org/dist/v6.10.1/node-v6.10.1-linux-x64.tar.xz... ######################################################################## 100.0% Computing checksum with sha256sum Checksums matched! nvm is not compatible with the npm config "prefix" option: currently set to "/usr/local" Run `npm config delete prefix` or `nvm use --delete-prefix v6.10.1` to unset it. expected 'nvm install v6.10.1' to exit with 0, got 11 ``` ``` ✗ nvm_default_packages touch: /default-packages: Permission denied ./nvm_default_packages: line 26: /default-packages: Permission denied Downloading and installing node v6.10.1... Downloading https://nodejs.org/dist/v6.10.1/node-v6.10.1-darwin-x64.tar.xz... ######################################################################## 100.0% Computing checksum with shasum -a 256 Checksums matched! npm WARN invalid config loglevel="notice" Now using node v6.10.1 (npm v3.10.10) Creating default alias: default -> v6.10.1 npm WARN invalid config loglevel="notice" npm WARN invalid config loglevel="notice" npm WARN invalid config loglevel="notice" touch: /default-packages: Permission denied N/A: version "N/A -> N/A" is not yet installed. You need to run "nvm install N/A" to install it before using it. ./nvm_default_packages: line 50: /default-packages: Permission denied Downloading and installing node v6.10.1... Local cache found: $NVM_DIR/.cache/bin/node-v6.10.1-darwin-x64/node-v6.10.1-darwin-x64.tar.xz Checksums match! Using existing downloaded archive $NVM_DIR/.cache/bin/node-v6.10.1-darwin-x64/node-v6.10.1-darwin-x64.tar.xz npm WARN invalid config loglevel="notice" npm WARN invalid config loglevel="notice" npm WARN invalid config loglevel="notice" touch: /default-packages: Permission denied ./nvm_default_packages: line 71: /default-packages: Permission denied Downloading and installing node v6.10.1... Local cache found: $NVM_DIR/.cache/bin/node-v6.10.1-darwin-x64/node-v6.10.1-darwin-x64.tar.xz Checksums match! Using existing downloaded archive $NVM_DIR/.cache/bin/node-v6.10.1-darwin-x64/node-v6.10.1-darwin-x64.tar.xz npm WARN invalid config loglevel="notice" npm WARN invalid config loglevel="notice" npm WARN invalid config loglevel="notice" touch: /default-packages: Permission denied ./nvm_default_packages: line 87: /default-packages: Permission denied Downloading and installing node v6.10.1... Local cache found: $NVM_DIR/.cache/bin/node-v6.10.1-darwin-x64/node-v6.10.1-darwin-x64.tar.xz Checksums match! Using existing downloaded archive $NVM_DIR/.cache/bin/node-v6.10.1-darwin-x64/node-v6.10.1-darwin-x64.tar.xz expected 'nvm install v6.10.1' to exit with 1, got 0 ``` ``` touch: cannot touch '/default-packages': Permission denied ./nvm_default_packages: line 26: /default-packages: Permission denied Downloading and installing node v6.10.1... Downloading https://nodejs.org/dist/v6.10.1/node-v6.10.1-linux-x64.tar.xz... ######################################################################## 100.0% Computing checksum with sha256sum Checksums matched! Now using node v6.10.1 (npm v3.10.10) Creating default alias: default -> v6.10.1 touch: cannot touch '/default-packages': Permission denied N/A: version "N/A -> N/A" is not yet installed. You need to run "nvm install N/A" to install it before using it. ./nvm_default_packages: line 50: /default-packages: Permission denied Downloading and installing node v6.10.1... Local cache found: $NVM_DIR/.cache/bin/node-v6.10.1-linux-x64/node-v6.10.1-linux-x64.tar.xz Checksums match! Using existing downloaded archive $NVM_DIR/.cache/bin/node-v6.10.1-linux-x64/node-v6.10.1-linux-x64.tar.xz touch: cannot touch '/default-packages': Permission denied ./nvm_default_packages: line 71: /default-packages: Permission denied Downloading and installing node v6.10.1... Local cache found: $NVM_DIR/.cache/bin/node-v6.10.1-linux-x64/node-v6.10.1-linux-x64.tar.xz Checksums match! Using existing downloaded archive $NVM_DIR/.cache/bin/node-v6.10.1-linux-x64/node-v6.10.1-linux-x64.tar.xz touch: cannot touch '/default-packages': Permission denied ./nvm_default_packages: line 87: /default-packages: Permission denied Downloading and installing node v6.10.1... Local cache found: $NVM_DIR/.cache/bin/node-v6.10.1-linux-x64/node-v6.10.1-linux-x64.tar.xz Checksums match! Using existing downloaded archive $NVM_DIR/.cache/bin/node-v6.10.1-linux-x64/node-v6.10.1-linux-x64.tar.xz expected 'nvm install v6.10.1' to exit with 1, got 0 ``` ``` ✗ nvm_default_packages touch: cannot touch '/default-packages': Permission denied ./nvm_default_packages: line 26: /default-packages: Permission denied Downloading and installing node v6.10.1... Downloading https://nodejs.org/dist/v6.10.1/node-v6.10.1-linux-x64.tar.xz... ######################################################################## 100.0% Computing checksum with sha256sum Checksums matched! npm WARN invalid config loglevel="notice" Now using node v6.10.1 (npm v3.10.10) Creating default alias: default -> v6.10.1 npm WARN invalid config loglevel="notice" npm WARN invalid config loglevel="notice" npm WARN invalid config loglevel="notice" touch: cannot touch '/default-packages': Permission denied N/A: version "N/A -> N/A" is not yet installed. You need to run "nvm install N/A" to install it before using it. ./nvm_default_packages: line 50: /default-packages: Permission denied Downloading and installing node v6.10.1... Local cache found: $NVM_DIR/.cache/bin/node-v6.10.1-linux-x64/node-v6.10.1-linux-x64.tar.xz Checksums match! Using existing downloaded archive $NVM_DIR/.cache/bin/node-v6.10.1-linux-x64/node-v6.10.1-linux-x64.tar.xz npm WARN invalid config loglevel="notice" npm WARN invalid config loglevel="notice" npm WARN invalid config loglevel="notice" touch: cannot touch '/default-packages': Permission denied ./nvm_default_packages: line 71: /default-packages: Permission denied Downloading and installing node v6.10.1... Local cache found: $NVM_DIR/.cache/bin/node-v6.10.1-linux-x64/node-v6.10.1-linux-x64.tar.xz Checksums match! Using existing downloaded archive $NVM_DIR/.cache/bin/node-v6.10.1-linux-x64/node-v6.10.1-linux-x64.tar.xz npm WARN invalid config loglevel="notice" npm WARN invalid config loglevel="notice" npm WARN invalid config loglevel="notice" touch: cannot touch '/default-packages': Permission denied ./nvm_default_packages: line 87: /default-packages: Permission denied Downloading and installing node v6.10.1... Local cache found: $NVM_DIR/.cache/bin/node-v6.10.1-linux-x64/node-v6.10.1-linux-x64.tar.xz Checksums match! Using existing downloaded archive $NVM_DIR/.cache/bin/node-v6.10.1-linux-x64/node-v6.10.1-linux-x64.tar.xz expected 'nvm install v6.10.1' to exit with 1, got 0 ```
testing,bugs,pull request wanted
low
Critical
238,095,629
flutter
Document template files in README.md
Excerpt from #9882 (by @Hixie): Before we add more files to the template, I think we should make sure the template contains a README that documents, for each file in the template: - What the file is for - Why you would edit that file - How to verify that the edits are valid - How to test the file The template is growing really big and it's not at all clear why some of these files are part of the user code and not just part of the framework.
framework,d: api docs,P2,team-framework,triaged-framework
low
Minor
238,111,976
angular
ExpressionChangedAfterItHasBeenCheckedError on ngSubmit
<!-- PLEASE HELP US PROCESS GITHUB ISSUES FASTER BY PROVIDING THE FOLLOWING INFORMATION. ISSUES MISSING IMPORTANT INFORMATION MIGHT BE CLOSED WITHOUT INVESTIGATION. --> ## I'm submitting a ... <!-- Check one of the following options with "x" --> <pre><code> [ ] Regression (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 --> [ ] 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. --> When submitting a form through ngSubmit which has transitive from controls an error is thrown iff the form is submitted by pressing enter in a text box (submitting by button works fine). The error is ExpressionChangedAfterItHasBeenCheckedError of a boolean which toggles in the submit function. I don't exactly know the cause. ## Expected behavior <!-- Describe what the desired behavior would be. --> No ExpressionChangedAfterItHasBeenCheckedError. ## 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). --> - Open the demo: https://plnkr.co/edit/vBszgl7DkIYC7Qw2GVhW?p=preview - Open Console - Submit once through button and text box. ## What is the motivation / use case for changing the behavior? <!-- Describe the motivation or the concrete use case. --> Using transitive forms allows me to abstract behavior that most forms in my app have: - showing loading animation during submission - show notification on error - guard with a confirm prompt ## Please tell us about your environment <pre><code> Angular version: v4.2.4 <!-- Check whether this is still an issue in the most recent Angular version --> Browser: - [ X ] Chrome (desktop) version XX - [ ] Chrome (Android) version XX - [ ] Chrome (iOS) version XX - [ ] Firefox version XX - [ ] Safari (desktop) version XX - [ ] Safari (iOS) version XX - [ ] IE version XX - [ ] Edge version XX For Tooling issues: - Platform: plnkr Others: <!-- Anything else relevant? Operating system version, IDE, package manager, HTTP server, ... --> </code></pre>
type: bug/fix,freq2: medium,area: forms,state: confirmed,forms: change detection,P4
low
Critical
238,211,315
go
html/template: parse failures lack sufficient context for debugging
Please answer these questions before submitting your issue. Thanks! ### What version of Go are you using (`go version`)? Unsure; this is in the Blaze version of "go_binary", "go_library", etc. (I'm having difficulty understanding which particular version of Go that is invoking). ### What operating system and processor architecture are you using (`go env`)? gLinux (Ubuntu 14.04.5 LTS) and also BuildRabbit ### What did you do? ``` import ( // ... "html/template", // ... ) // ... func CreateTemplate(name, text string) (*template.Template, error) { var newTemplate *template.Template newTemplate = template.New(name).Funcs(funcMap) parsedTemplate, err := newTemplate.Parse(text) if error != nil { return nil, status.Errorf( status.InvalidArgument, "error parsing template: %v") } return newTemplate, nil } // ... ``` ### What did you expect to see? When the parsing fails, I expect the error to include sufficient context to diagnose. For example: error parsing template: template: body:3 unexpected bad character U+002D '-' in command in the vicinity of "{{end-}}"; expected " " or "}}". ### What did you see instead? The error does not give any context. For example, it prints: error parsing template: template: body:3 unexpected bad character U+002D '-' in command Or: error parsing template: template: body:14 unexpected bad character U+002D '-' in template clause ... but doesn't give any surrounding context to understand what the specific error is.
NeedsInvestigation
low
Critical
238,223,293
vscode
[Feature request] Hide cursor while typing
https://superuser.com/questions/928839/what-does-the-hide-pointer-while-typing-feature-actually-do Can we get this as an option in VS Code?
feature-request,editor-core
high
Critical
238,264,229
rust
Tracking issue for future-incompatibility lint `late_bound_lifetime_arguments`
#### What is this lint about In functions not all lifetime parameters are created equal. For example, if you have a function like ```rust fn f<'a, 'b>(arg: &'a u8) -> &'b u8 { .... } ``` both `'a` and `'b` are listed in the same parameter list, but when stripped from the surface syntax the function looks more like ```rust for<'a> fn f<'b>(arg: &'a u8) -> &'b u8 { .... } ``` where `'b` is a "true" ("early-bound") parameter of the function, and `'a` is an "existential" ("late-bound") parameter. This means the function is not parameterized by `'a`. To give some more intuition, let's write a type for function pointer to `f`: ```rust // PtrF is not parameterized by 'a, type PtrF<'b> = for<'a> fn(&'a u8) -> &'b u8; // but it has to be parameterized by 'b type PtrF = for<'a, 'b> fn(&'a u8) -> &'b u8; // ERROR ``` See more about this distinction in http://smallcultfollowing.com/babysteps/blog/2013/10/29/intermingled-parameter-lists/#early--vs-late-bound-lifetimes When lifetime arguments are provided to a function explicitly, e.g. ``` f::<'my_a, 'my_b> ``` the first argument doesn't make much sense because the function is not parameterized by `'a`. Providing arguments for "late-bound" lifetime parameters in general doesn't make sense, while arguments for "early-bound" lifetime parameters can be provided. It's not clear how to provide arguments for early-bound lifetime parameters if they are intermixed with late-bound parameters in the same list. For now providing any explicit arguments is prohibited if late-bound parameters are present, so in the future we can adopt any solution without hitting backward compatibility issues. Note that late-bound lifetime parameters can be introduced implicitly through lifetime elision: ```rust fn f(&u8) {} // Desugars into fn f<'a>(&'a u8) {} // 'a is late-bound ``` The precise rules discerning between early- and late-bound lifetimes can be found here: https://github.com/rust-lang/rust/blob/91aff5775d3b4a95e2b0c2fe50785f3d28fa3dd8/src/librustc/middle/resolve_lifetime.rs#L1541-L1700 #### How to fix this warning/error Just removing the lifetime arguments pointed to by the lint should be enough in most cases. #### Current status - [x] https://github.com/rust-lang/rust/pull/42492 introduces the `late_bound_lifetime_arguments` lint as warn-by-default - [ ] PR ? makes the `late_bound_lifetime_arguments` lint deny-by-default - [ ] PR ? makes the `late_bound_lifetime_arguments` lint a hard error
A-lints,A-lifetimes,T-compiler,C-future-incompatibility,C-tracking-issue,T-types
medium
Critical
238,267,909
rust
std::fs::canonicalize returns UNC paths on Windows, and a lot of software doesn't support UNC paths
Hi, I hope this is the right forum/format to register this problem, let me know if it's not. Today I tried to use `std::fs::canonicalize` to make a path absolute so that I could execute it with `std::process::Command`. `canonicalize` returns so-called "UNC paths", which look like this: `\\?\C:\foo\bar\...` (sometimes the `?` can be a hostname). It turns out you can't pass a UNC path as the current directory when starting a process (i.e., `Command::new(...).current_dir(unc_path)`). In fact, a lot of other apps will blow up if you pass them a UNC path: for example, Microsoft's own `cl.exe` compiler doesn't support it: https://github.com/alexcrichton/gcc-rs/issues/169 It feels to me that maybe returning UNC paths from canonicalize is the wrong choice, given that they don't work in so many places. It'd probably be better to return a simple "absolute path", which begins with the drive letter, instead of returning a UNC path, and instead provide a separate function specifically for generating UNC paths for people who need them. Maybe if this is too much of an incompatible change, a new function for creating absolute paths should be added to std? I'd bet, however, that making the change to `canonicalize` itself would suddenly make more software suddenly start working rather than suddenly break.
O-windows,T-libs-api,C-bug,A-io
high
Critical
238,290,783
go
net: default dialer should accept list of IPs with fallback included
Please answer these questions before submitting your issue. Thanks! ### What version of Go are you using (`go version`)? master ### What did you do? 1. In case you want to implement/extend your own dialer you might want to use the original dialer to handle all the TCP/UDP connection, but to still resolve the DNS.. in this scenario you can't wrap it and just send list of IPs because it won't use fallbacks 2. In case you want to dial IP with fallbacks you can't do that. ### What did you expect to see? ```func (d *Dialer) DialContext(ctx context.Context, network string, addresses []string) (Conn, error)``` will accept list of `addresses` Or at least `func (d *Dialer) DialContextWithFallbacks(ctx context.Context, network string, addresses []string) (Conn, error)`
FeatureRequest
low
Critical
238,301,351
rust
Field pattern shorthand can be interpreted as an item reference
`B { X }` is a shorthand for `B { X: X }` and `X` here can be intepreted as an item reference, rather than a binding. I don't know if this is actually a bug or not. Possible fixes are: - Leave it as is. - Leave it as is with some warning. - Force `X` be interpreted as a binding and let it fail to compile (due to local-global shadowing). ```rust const X : i32 = 10; struct B { X: i32, } fn main() { match (B { X: 9 }) { B { X } => println!("Foo!"), B { .. } => println!("Bar!"), } } ``` - Current behavior: `Bar!` is printed. - Possible expected behaviors: as-is or some warning/error emitted. - Meta: `rustc 1.20.0-nightly (ab5bec255 2017-06-22)`
A-lints,T-lang,C-feature-request
low
Critical
238,302,145
rust
Tracking issue for unsized tuple coercion
This is a part of #18469. This is currently feature-gated behind `#![feature(unsized_tuple_coercion)]` to avoid insta-stability. Related issues/PRs: #18469, #32702, #34451, #37685, #42527 This is needed for unsizing the last field in a tuple: ```rust #![feature(unsized_tuple_coercion)] fn main() { let _: &(i32, [i32]) = &(3, [3, 3]) as _; } ``` <https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=5f93d1d7c6ee0e969df53c13e1aa941a>
T-lang,B-unstable,C-tracking-issue,S-tracking-design-concerns,S-tracking-needs-summary
low
Critical
238,361,815
go
proposal: cmd/trace: add 'greedy goroutine diagnosis' option
(Maybe helpful to bypass the issue #10958 in a quite different but probably better and more clean way. Coming from this [thread](https://groups.google.com/forum/#!topic/golang-nuts/8KYER1ALelg), many thanks to the participants of this discussion) Hi all :) I have implemented a sub-option in the `go tool trace` recently named "diagreedy" which means "diagnoses and finds out the greediest several goroutines". This tool already helped us tracked down several deep hidden problems in our go applications and achieved more stable and short GC pause latency by fixing them afterwards. ## Terminology ``` N = GOMAXPROCS Tmax_stw = sum{top max N on-processor time slices} Tgc = Tmax_stw + Tgcwork ``` ## Big Picture ``` t1=12 t2=11 t3=10 | | | | __________________________________________________ | | | | ---------------------------------------------------> time line P0 [------go 1------][-go 7-][-go 1-][-go 6-][-go 4-] P1 [-go 3-][-go 4-][------go 2-----][-go 1-][-go 2-] P2 [-go 4-][-go 3-][-go 8-][-go 9-][-----go 10-----] ``` In this diagram, the value of N is 3 (i.e. the GOMAXPROCS), and the top 3 long on-processor time slices is t1, t2, t3 and they are corresponding to goroutine 1, 2, 10. The max time cost of the pre-GC-action Stop-the-World is named Tmax_stw and is the sum of t1, t2 and t3. The Tgcwork is the time cost by the acually effective Garbage Collecting action after the phase Stop-the-World. Tgcwork is determined by the amount of the allocated objects and the complexity of the relationship among them. Tmax_stw and Tgcwork together finally determined the one typical GC pause cost. As for Tgcwork, we could optimize it by reusing the objects (via sync.Pool for example) and by many other methods. But we do not discuss Tgcwork futher here. We concentrate on the Tmax_stw right now. We could get this conclusion plainly: The bigger the Tmax_stw is and the greedier and less cooperative the goroutines are, the more thrashing and churning our go applications would become, thus the worse latency our programs would perform (caused by the GC pause). For some cpu intensive applications, the top max N on-processor time slices is often very big (if without very carefully task splits). Especially when our project is including tons of other and heavily used open source projects which will cause it becomes more complex and harder to trace. Although we already had some tools to sample out the top n cpu usage of the functions. But the accumulated cpu usage of the functions and the longest top n time slices is not the same thing at all. For example, if we have 1000 different cpu intensive goroutines something like: go func(){ do_cpu_staff() -- time cost 1ms time.Sleep(time.Second) }() Our Tmax_stw would become GOMAXPROCS*1 ms. It's terrible because sometimes we would set the GOMAXPROCS to a pretty big value (16 or even 36 for instance). With the sample of top n cpu usage, we may couldn't find out the sources of the problem easily. But with the 'top max N on-processor time slices' approach, we could track down the sources of the long GC pause immediately and fix them like this: go func(){ do_cpu_staff0() -- time cost 200us runtime.Gosched() do_cpu_staff1() -- time cost 200us runtime.Gosched() do_cpu_staff2() -- time cost 200us runtime.Gosched() do_cpu_staff3() -- time cost 200us runtime.Gosched() do_cpu_staff4() -- time cost 200us time.Sleep(time.Second) }() Then our Tmax_stw would turns from GOMAXPROCS*1 ms to GOMAXPROCS/5 ms afterwards :) (If your GOMAXPROCS is very big, just splits do_cpu_staff even further. And you even could implement some logic which would let the do_cpu_staff automated splits its tasks based on the value of GOMAXPROCS and a other parameter could named time_cost_wanted to solve this problem for good.) ### revision1 Sorry, I might had make a mistake: Tmax_stw = sum{top max N on-processor time slices} It should probably be: Tmax_stw = max{top max N on-processor time slices} Although I hadn't dive in the go scheduler's code yet, but I guess the 2nd is most likely the right answer, because the 1st algorithm is just too inefficient and unlikely using by the go scheduler. But no matter which one is the right answer, the 1st one or the 2nd, it couldn't change our conclusion made before utterly. ## Example And there is a example about the usage of `go tool trace -diagreedy` ```bash $ go tool trace -h Usage of 'go tool trace': Given a trace file produced by 'go test': go test -trace=trace.out pkg Open a web browser displaying trace: go tool trace [flags] [pkg.test] trace.out Generate a pprof-like profile from the trace: go tool trace -pprof=TYPE [pkg.test] trace.out [pkg.test] argument is required for traces produced by Go 1.6 and below. Go 1.7 does not require the binary argument. Supported profile types are: - net: network blocking profile - sync: synchronization blocking profile - syscall: syscall blocking profile - sched: scheduler latency profile Flags: -http=addr: HTTP service address (e.g., ':6060') -pprof=type: print a pprof-like profile instead -dump: dump all traced out as format text to stdout <- -diagreedy=N: dump the top N greedy goroutines <- new added options ``` Sample code to diagnose: ```bash package main import "os" import "fmt" import "runtime" import "runtime/trace" //import "sync/atomic" //import "math/big" import "time" func init() { //runtime.LockOSThread() } func main() { //debug.SetGCPercent(-1) runtime.GOMAXPROCS(2) go func() { for { fmt.Println("---------------") f, err := os.Create("trace_my_" + time.Now().Format("2006-01-02-15-04-05") + ".out") if err != nil { panic(err) } err = trace.Start(f) if err != nil { panic(err) } time.Sleep(time.Second / 1) trace.Stop() time.Sleep(time.Second * 2) } }() go func() { for { time.Sleep(time.Millisecond * 10) go func() { time.Sleep(time.Millisecond * 100) }() } }() go func() { for { fmt.Println("heartbeat... ", time.Now().Format("2006-01-02-15:04:05")) time.Sleep(time.Second) } }() // maybe highest cpu usage go func() { l := make([]int, 0, 8) l = append(l, 0) ct := 0 for { l = append(l, ct) ct++ l = l[1:] runtime.Gosched() } }() amount := 1000000 granul := 100000 go godeadloop0(amount, granul) go godeadloop1(amount, granul) godeadloop2(amount, granul) return } // potential greediest go functions func godeadloop0(amount, granul int) { func() { for { ct := 0 for { ct++ if ct%granul == 0 { runtime.Gosched() } if ct >= amount { fmt.Println("--->") break } } time.Sleep(time.Second / 10) } }() } func godeadloop1(amount, granul int) { func() { for { ct := 0 for { ct++ if ct%granul == 0 { runtime.Gosched() } if ct >= amount { fmt.Println("--->") break } } time.Sleep(time.Second / 10) } }() } func godeadloop2(amount, granul int) { func() { for { ct := 0 for { ct++ if ct%granul == 0 { runtime.Gosched() } if ct >= amount { fmt.Println("--->") break } } time.Sleep(time.Second / 10) } }() } ``` Diagnosis for the 1st time: ```bash $ go tool trace -diagreedy=10 /root/go/src/diaggreedy/trace_my_2017-06-25-10-01-13.out finally the found toppest 10 greedy goroutines info 7486357ns -> 0.007486s GoStart Ts: 739889373 P: 1 G: 9 StkID: 0 args0: 9 args1: 0 args2: 0 GoSched 4746045 main.godeadloop0.func1 /root/go/src/diaggreedy/x.go 86 4744357 main.godeadloop0 /root/go/src/diaggreedy/x.go 95 GoSched Ts: 747375730 P: 1 G: 9 StkID: 20 args0: 0 args1: 0 args2: 0 4746045 main.godeadloop0.func1 /root/go/src/diaggreedy/x.go 86 4744357 main.godeadloop0 /root/go/src/diaggreedy/x.go 95 3617038ns -> 0.003617s GoStartLabel Ts: 649291006 P: 0 G: 27 StkID: 0 args0: 27 args1: 7 args2: 2 GoStart -> GoBlock -> GoUnblock -> GoStartLabel -> GoBlock -> GoUnblock -> GoStartLabel -> GoBlock -> GoUnblock 4285073 runtime.gcBgMarkWorker /usr/local/go/src/runtime/mgc.go 1435 GC (fractional) GoBlock Ts: 652908044 P: 0 G: 27 StkID: 0 args0: 0 args1: 0 args2: 0 GoStart -> GoBlock -> GoUnblock -> GoStartLabel -> GoBlock -> GoUnblock -> GoStartLabel -> GoBlock -> GoUnblock -> GoStartLabel 4285073 runtime.gcBgMarkWorker /usr/local/go/src/runtime/mgc.go 1435 2763199ns -> 0.002763s GoStart Ts: 925956546 P: 1 G: 10 StkID: 0 args0: 10 args1: 0 args2: 0 GoSleep -> GoUnblock 4452857 time.Sleep /usr/local/go/src/runtime/time.go 59 4746323 main.godeadloop1.func1 /root/go/src/diaggreedy/x.go 112 4744437 main.godeadloop1 /root/go/src/diaggreedy/x.go 114 GoSched Ts: 928719745 P: 1 G: 10 StkID: 21 args0: 0 args1: 0 args2: 0 4746333 main.godeadloop1.func1 /root/go/src/diaggreedy/x.go 105 4744437 main.godeadloop1 /root/go/src/diaggreedy/x.go 114 2573480ns -> 0.002573s GoStart Ts: 750086169 P: 0 G: 9 StkID: 0 args0: 9 args1: 0 args2: 0 GoSched 4746045 main.godeadloop0.func1 /root/go/src/diaggreedy/x.go 86 4744357 main.godeadloop0 /root/go/src/diaggreedy/x.go 95 GoSched Ts: 752659649 P: 0 G: 9 StkID: 20 args0: 0 args1: 0 args2: 0 4746045 main.godeadloop0.func1 /root/go/src/diaggreedy/x.go 86 4744357 main.godeadloop0 /root/go/src/diaggreedy/x.go 95 2558799ns -> 0.002559s GoStart Ts: 625418894 P: 0 G: 9 StkID: 0 args0: 9 args1: 0 args2: 0 GoSched 4746045 main.godeadloop0.func1 /root/go/src/diaggreedy/x.go 86 4744357 main.godeadloop0 /root/go/src/diaggreedy/x.go 95 GoSched Ts: 627977693 P: 0 G: 9 StkID: 20 args0: 0 args1: 0 args2: 0 4746045 main.godeadloop0.func1 /root/go/src/diaggreedy/x.go 86 4744357 main.godeadloop0 /root/go/src/diaggreedy/x.go 95 2462919ns -> 0.002463s GoStart Ts: 975882408 P: 0 G: 9 StkID: 0 args0: 9 args1: 97 args2: 0 GoSched 4746045 main.godeadloop0.func1 /root/go/src/diaggreedy/x.go 86 4744357 main.godeadloop0 /root/go/src/diaggreedy/x.go 95 GoSched Ts: 978345327 P: 0 G: 9 StkID: 20 args0: 0 args1: 0 args2: 0 4746045 main.godeadloop0.func1 /root/go/src/diaggreedy/x.go 86 4744357 main.godeadloop0 /root/go/src/diaggreedy/x.go 95 2374319ns -> 0.002374s GoStart Ts: 240141393 P: 1 G: 10 StkID: 0 args0: 10 args1: 0 args2: 0 GoSleep -> GoUnblock 4452857 time.Sleep /usr/local/go/src/runtime/time.go 59 4746323 main.godeadloop1.func1 /root/go/src/diaggreedy/x.go 112 4744437 main.godeadloop1 /root/go/src/diaggreedy/x.go 114 GoSched Ts: 242515712 P: 1 G: 10 StkID: 21 args0: 0 args1: 0 args2: 0 4746333 main.godeadloop1.func1 /root/go/src/diaggreedy/x.go 105 4744437 main.godeadloop1 /root/go/src/diaggreedy/x.go 114 2250439ns -> 0.002250s GoStart Ts: 724664379 P: 0 G: 1 StkID: 0 args0: 1 args1: 0 args2: 0 GoSched 4746621 main.godeadloop2.func1 /root/go/src/diaggreedy/x.go 124 4744517 main.godeadloop2 /root/go/src/diaggreedy/x.go 133 4744280 main.main /root/go/src/diaggreedy/x.go 74 GoSched Ts: 726914818 P: 0 G: 1 StkID: 19 args0: 0 args1: 0 args2: 0 4746621 main.godeadloop2.func1 /root/go/src/diaggreedy/x.go 124 4744517 main.godeadloop2 /root/go/src/diaggreedy/x.go 133 4744280 main.main /root/go/src/diaggreedy/x.go 74 2230559ns -> 0.002231s GoStart Ts: 382544542 P: 1 G: 9 StkID: 0 args0: 9 args1: 0 args2: 0 GoSched 4746045 main.godeadloop0.func1 /root/go/src/diaggreedy/x.go 86 4744357 main.godeadloop0 /root/go/src/diaggreedy/x.go 95 GoSched Ts: 384775101 P: 1 G: 9 StkID: 20 args0: 0 args1: 0 args2: 0 4746045 main.godeadloop0.func1 /root/go/src/diaggreedy/x.go 86 4744357 main.godeadloop0 /root/go/src/diaggreedy/x.go 95 2112279ns -> 0.002112s GoStartLabel Ts: 866437288 P: 1 G: 28 StkID: 0 args0: 28 args1: 3 args2: 2 GoStart -> GoBlock -> GoUnblock 4285073 runtime.gcBgMarkWorker /usr/local/go/src/runtime/mgc.go 1435 GC (fractional) GoBlock Ts: 868549567 P: 1 G: 28 StkID: 0 args0: 0 args1: 0 args2: 0 GoStart -> GoBlock -> GoUnblock -> GoStartLabel 4285073 runtime.gcBgMarkWorker /usr/local/go/src/runtime/mgc.go 1435 ``` And then, we could found the source of the long GC pause godeadloop0 and chage the variable granul to value 10000. Test again: ```bash $ go tool trace -diagreedy=10 /root/go/src/diaggreedy/trace_my_2017-06-25-09-52-03.out finally the found toppest 10 greedy goroutines info 408760ns -> 0.000409s GoStart Ts: 564369612 P: 0 G: 8 StkID: 0 args0: 8 args1: 0 args2: 0 GoSched 4745644 main.main.func4 /root/go/src/diaggreedy/x.go 66 GoSched Ts: 564778372 P: 0 G: 8 StkID: 21 args0: 0 args1: 0 args2: 0 4745644 main.main.func4 /root/go/src/diaggreedy/x.go 66 393760ns -> 0.000394s GoStart Ts: 363796356 P: 1 G: 8 StkID: 0 args0: 8 args1: 0 args2: 0 GoSched 4745644 main.main.func4 /root/go/src/diaggreedy/x.go 66 GoSched Ts: 364190116 P: 1 G: 8 StkID: 21 args0: 0 args1: 0 args2: 0 4745644 main.main.func4 /root/go/src/diaggreedy/x.go 66 375760ns -> 0.000376s GoStartLabel Ts: 583805009 P: 0 G: 16 StkID: 0 args0: 16 args1: 3 args2: 2 GoStart -> GoBlock -> GoUnblock 4285073 runtime.gcBgMarkWorker /usr/local/go/src/runtime/mgc.go 1435 GC (fractional) GoBlock Ts: 584180769 P: 0 G: 16 StkID: 0 args0: 0 args1: 0 args2: 0 GoStart -> GoBlock -> GoUnblock -> GoStartLabel 4285073 runtime.gcBgMarkWorker /usr/local/go/src/runtime/mgc.go 1435 364040ns -> 0.000364s GoStart Ts: 211900654 P: 0 G: 10 StkID: 0 args0: 10 args1: 0 args2: 0 GoSleep -> GoUnblock 4452857 time.Sleep /usr/local/go/src/runtime/time.go 59 4746323 main.godeadloop1.func1 /root/go/src/diaggreedy/x.go 112 4744437 main.godeadloop1 /root/go/src/diaggreedy/x.go 114 GoSched Ts: 212264694 P: 0 G: 10 StkID: 23 args0: 0 args1: 0 args2: 0 4746333 main.godeadloop1.func1 /root/go/src/diaggreedy/x.go 105 4744437 main.godeadloop1 /root/go/src/diaggreedy/x.go 114 358280ns -> 0.000358s GoStart Ts: 736130271 P: 1 G: 9 StkID: 0 args0: 9 args1: 0 args2: 0 GoSched 4746045 main.godeadloop0.func1 /root/go/src/diaggreedy/x.go 86 4744357 main.godeadloop0 /root/go/src/diaggreedy/x.go 95 GoSched Ts: 736488551 P: 1 G: 9 StkID: 24 args0: 0 args1: 0 args2: 0 4746045 main.godeadloop0.func1 /root/go/src/diaggreedy/x.go 86 4744357 main.godeadloop0 /root/go/src/diaggreedy/x.go 95 357360ns -> 0.000357s GoStart Ts: 551030053 P: 0 G: 8 StkID: 0 args0: 8 args1: 0 args2: 0 GoSched 4745644 main.main.func4 /root/go/src/diaggreedy/x.go 66 GoSched Ts: 551387413 P: 0 G: 8 StkID: 21 args0: 0 args1: 0 args2: 0 4745644 main.main.func4 /root/go/src/diaggreedy/x.go 66 323360ns -> 0.000323s GoStart Ts: 103892587 P: 1 G: 1 StkID: 0 args0: 1 args1: 0 args2: 0 GoSched 4746621 main.godeadloop2.func1 /root/go/src/diaggreedy/x.go 124 4744517 main.godeadloop2 /root/go/src/diaggreedy/x.go 133 4744280 main.main /root/go/src/diaggreedy/x.go 74 GoSched Ts: 104215947 P: 1 G: 1 StkID: 22 args0: 0 args1: 0 args2: 0 4746621 main.godeadloop2.func1 /root/go/src/diaggreedy/x.go 124 4744517 main.godeadloop2 /root/go/src/diaggreedy/x.go 133 4744280 main.main /root/go/src/diaggreedy/x.go 74 320520ns -> 0.000321s GoStart Ts: 736132431 P: 0 G: 1 StkID: 0 args0: 1 args1: 0 args2: 0 GoSched 4746621 main.godeadloop2.func1 /root/go/src/diaggreedy/x.go 124 4744517 main.godeadloop2 /root/go/src/diaggreedy/x.go 133 4744280 main.main /root/go/src/diaggreedy/x.go 74 GoSched Ts: 736452951 P: 0 G: 1 StkID: 22 args0: 0 args1: 0 args2: 0 4746621 main.godeadloop2.func1 /root/go/src/diaggreedy/x.go 124 4744517 main.godeadloop2 /root/go/src/diaggreedy/x.go 133 4744280 main.main /root/go/src/diaggreedy/x.go 74 320480ns -> 0.000320s GoStartLabel Ts: 777280946 P: 0 G: 16 StkID: 0 args0: 16 args1: 5 args2: 2 GoStart -> GoBlock -> GoUnblock -> GoStartLabel -> GoBlock -> GoUnblock 4285073 runtime.gcBgMarkWorker /usr/local/go/src/runtime/mgc.go 1435 GC (fractional) GoBlock Ts: 777601426 P: 0 G: 16 StkID: 0 args0: 0 args1: 0 args2: 0 GoStart -> GoBlock -> GoUnblock -> GoStartLabel -> GoBlock -> GoUnblock -> GoStartLabel 4285073 runtime.gcBgMarkWorker /usr/local/go/src/runtime/mgc.go 1435 319480ns -> 0.000319s GoStart Ts: 940403207 P: 0 G: 10 StkID: 0 args0: 10 args1: 0 args2: 0 GoSleep -> GoUnblock 4452857 time.Sleep /usr/local/go/src/runtime/time.go 59 4746323 main.godeadloop1.func1 /root/go/src/diaggreedy/x.go 112 4744437 main.godeadloop1 /root/go/src/diaggreedy/x.go 114 GoSched Ts: 940722687 P: 0 G: 10 StkID: 23 args0: 0 args1: 0 args2: 0 4746333 main.godeadloop1.func1 /root/go/src/diaggreedy/x.go 105 4744437 main.godeadloop1 /root/go/src/diaggreedy/x.go 114 ``` As you see, the typical GC pause finally changed from 8ms to 0.4ms. Of course the situation would be much more complex in a real big project, but the key idea of the tracking is the same and clear. Also implemented a 'dump' option like this below: ```bash $ # Ts is the event's timestamp in nanoseconds $ # by reading the go/src/internal/trace/parser.go to get more info $ go tool trace -dump /root/go/src/diaggreedy/trace_my_2017-06-25-10-03-15.out 0xc42001c120 Off: 24 type: 13 GoCreate Ts: 0 P: 1 G: 0 StkID: 1 args0: 1 args1: 2 args2: 0 link: 0xc42001d050 4744891 main.main.func1 /root/go/src/diaggreedy/x.go 30 0xc42001c1b0 Off: 30 type: 13 GoCreate Ts: 3879 P: 1 G: 0 StkID: 1 args0: 2 args1: 3 args2: 0 link: 0x0 4744891 main.main.func1 /root/go/src/diaggreedy/x.go 30 0xc42001c240 Off: 36 type: 31 GoWaiting Ts: 4119 P: 1 G: 2 StkID: 0 args0: 2 args1: 0 args2: 0 link: 0x0 0xc42001c2d0 Off: 39 type: 13 GoCreate Ts: 8079 P: 1 G: 0 StkID: 1 args0: 3 args1: 4 args2: 0 link: 0x0 4744891 main.main.func1 /root/go/src/diaggreedy/x.go 30 0xc42001c360 Off: 45 type: 31 GoWaiting Ts: 8199 P: 1 G: 3 StkID: 0 args0: 3 args1: 0 args2: 0 link: 0xc427e29e60 0xc42001c3f0 Off: 48 type: 13 GoCreate Ts: 13639 P: 1 G: 0 StkID: 1 args0: 4 args1: 5 args2: 0 link: 0x0 4744891 main.main.func1 /root/go/src/diaggreedy/x.go 30 0xc42001c480 Off: 55 type: 31 GoWaiting Ts: 13759 P: 1 G: 4 StkID: 0 args0: 4 args1: 0 args2: 0 link: 0x0 0xc42001c510 Off: 58 type: 13 GoCreate Ts: 14159 P: 1 G: 0 StkID: 1 args0: 5 args1: 6 args2: 0 link: 0xc42001cb40 4744891 main.main.func1 /root/go/src/diaggreedy/x.go 30 0xc42001c5a0 Off: 64 type: 13 GoCreate Ts: 14399 P: 1 G: 0 StkID: 1 args0: 6 args1: 7 args2: 0 link: 0x0 4744891 main.main.func1 /root/go/src/diaggreedy/x.go 30 0xc42001c630 Off: 70 type: 31 GoWaiting Ts: 14439 P: 1 G: 6 StkID: 0 args0: 6 args1: 0 args2: 0 link: 0xc4223ee2d0 0xc42001c6c0 Off: 73 type: 13 GoCreate Ts: 18039 P: 1 G: 0 StkID: 1 args0: 7 args1: 8 args2: 0 link: 0x0 4744891 main.main.func1 /root/go/src/diaggreedy/x.go 30 0xc42001c750 Off: 79 type: 31 GoWaiting Ts: 18119 P: 1 G: 7 StkID: 0 args0: 7 args1: 0 args2: 0 link: 0xc44016d710 0xc42001c7e0 Off: 82 type: 13 GoCreate Ts: 21479 P: 1 G: 0 StkID: 1 args0: 8 args1: 9 args2: 0 link: 0xc42001d290 4744891 main.main.func1 /root/go/src/diaggreedy/x.go 30 0xc42001c870 Off: 88 type: 13 GoCreate Ts: 25199 P: 1 G: 0 StkID: 1 args0: 9 args1: 10 args2: 0 link: 0xc42592f440 4744891 main.main.func1 /root/go/src/diaggreedy/x.go 30 0xc42001c900 Off: 94 type: 13 GoCreate Ts: 29159 P: 1 G: 0 StkID: 1 args0: 10 args1: 11 args2: 0 link: 0xc42001d170 4744891 main.main.func1 /root/go/src/diaggreedy/x.go 30 0xc42001c990 Off: 100 type: 13 GoCreate Ts: 33279 P: 1 G: 0 StkID: 1 args0: 17 args1: 12 args2: 0 link: 0x0 4744891 main.main.func1 /root/go/src/diaggreedy/x.go 30 0xc42001ca20 Off: 106 type: 32 GoInSyscall Ts: 33359 P: 1 G: 17 StkID: 0 args0: 17 args1: 0 args2: 0 link: 0x0 0xc42001cab0 Off: 109 type: 5 ProcStart Ts: 33439 P: 1 G: 0 StkID: 0 args0: 3 args1: 0 args2: 0 link: 0x0 0xc42001cb40 Off: 112 type: 14 GoStart Ts: 33719 P: 1 G: 5 StkID: 6 args0: 5 args1: 0 args2: 0 link: 0xc42001ce10 4744545 main.main.func1 /root/go/src/diaggreedy/x.go 22 0xc42001cbd0 Off: 115 type: 33 HeapAlloc Ts: 36559 P: 1 G: 5 StkID: 0 args0: 253952 args1: 0 args2: 0 link: 0x0 0xc42001cc60 Off: 120 type: 33 HeapAlloc Ts: 36879 P: 1 G: 5 StkID: 0 args0: 262144 args1: 0 args2: 0 link: 0x0 0xc42001ccf0 Off: 172 type: 4 Gomaxprocs Ts: 42519 P: 1 G: 5 StkID: 13 args0: 2 args1: 0 args2: 0 link: 0x0 4366993 runtime.startTheWorld /usr/local/go/src/runtime/proc.go 951 4456480 runtime.StartTrace /usr/local/go/src/runtime/trace.go 256 4743634 runtime/trace.Start /usr/local/go/src/runtime/trace/trace.go 23 4744891 main.main.func1 /root/go/src/diaggreedy/x.go 30 0xc42001cd80 Off: 177 type: 13 GoCreate Ts: 64239 P: 1 G: 5 StkID: 15 args0: 18 args1: 14 args2: 0 link: 0xc42001cea0 4743712 runtime/trace.Start /usr/local/go/src/runtime/trace/trace.go 34 4744891 main.main.func1 /root/go/src/diaggreedy/x.go 30 0xc42001ce10 Off: 184 type: 19 GoSleep Ts: 69599 P: 1 G: 5 StkID: 16 args0: 0 args1: 0 args2: 0 link: 0xc44016e2d0 4452857 time.Sleep /usr/local/go/src/runtime/time.go 59 4744919 main.main.func1 /root/go/src/diaggreedy/x.go 34 0xc42001cea0 Off: 188 type: 14 GoStart Ts: 72679 P: 1 G: 18 StkID: 14 args0: 18 args1: 0 args2: 0 link: 0xc42001cfc0 4743809 runtime/trace.Start.func1 /usr/local/go/src/runtime/trace/trace.go 26 0xc42001cf30 Off: 191 type: 28 GoSysCall Ts: 73959 P: 1 G: 18 StkID: 17 args0: 0 args1: 0 args2: 0 link: 0x0 4552069 syscall.write /usr/local/go/src/syscall/zsyscall_linux_amd64.go 1064 4550393 syscall.Write /usr/local/go/src/syscall/syscall_unix.go 181 4591004 os.(*File).write /usr/local/go/src/os/file_unix.go 186 4587980 os.(*File).Write /usr/local/go/src/os/file.go 142 # ...... ``` ---- I would be very glad to push it to golang project and benefits more if this proposal is accepted. Many thanks for your time and good patience.
Proposal,Proposal-Hold
medium
Critical
238,494,841
angular
Feature: @Directive should support styles and styleUrls properties
## I'm submitting a ... <!-- Check one of the following options with "x" --> <pre><code> [ ] Regression (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 Currently, if you have a `@Directive` that requires some custom styles you have to deal with the inclusion of styles, the `@Directive` does not accept `styles` and `styleUrls` (and maybe `encapsulation: None|Emulated`). ## Expected behavior The `DirectiveResolver` should accept `styles`, `styleUrls` (and `encapsulation: None|Emulated`) for the `@Directive` decorator. ## What is the motivation / use case for changing the behavior? ``` /** * Removes the spacing around an `md-list` component when it is a child of `md-card`. */ @Directive({ selector: 'md-list[my-md-list-in-card]', styles: [` md-list[my-md-list-in-card] { .mat-list-item-content { padding-left: 0 !important; padding-right: 0 !important; } } `] }) export class MyMdListInCardStylerDirective { } ```
feature,area: core,core: stylesheets,feature: under consideration
high
Critical
238,495,828
go
time: time.Local is always UTC on iOS
Local timezone is hardcoded to UTC on iOS. https://github.com/golang/go/blob/master/src/time/zoneinfo_ios.go#L39-L42 ```go func initLocal() { // TODO(crawshaw): [NSTimeZone localTimeZone] localLoc = *UTC } ``` As mentioned in the code it should use [NSTimeZone localTimeZone](https://developer.apple.com/documentation/foundation/nstimezone/1387209-localtimezone) to get the current timezone. cc @eliasnaur @crawshaw (Same issue on android #20455)
NeedsFix,mobile
low
Major
238,554,237
flutter
PageStorageKey with TabBarView causes PageController and TabController to get out of sync
`TabBarView` uses the `index` of its `tabController` to set the `initialPage` of its `PageController`. However, the `PageController` can later determine a different `_pageToUseOnStartup` using its `PageStorage`. There's no mechanism currently in place for the `TabBarView` to notify its `tabController` that the `PageController` has decided to start up on a different page. The result is that you can have a `TabBar` that doesn't match its `TabBarView`, even though they share a common `TabController`. This seems like a bug. ![untitled 1](https://user-images.githubusercontent.com/394889/27542909-7fcca966-5a3d-11e7-97eb-ce00bac4a3d6.gif) ```dart import 'dart:async'; import 'package:flutter/material.dart'; void main() { runApp(new MaterialApp( home: new MyHomePage(), )); } class MyHomePage extends StatefulWidget { _MyHomePageState createState() => new _MyHomePageState(); } class _MyHomePageState extends State<MyHomePage> with TickerProviderStateMixin { PageController _controller = new PageController(); Widget build(BuildContext context) { return new Scaffold( body: new PageView( controller: _controller, children: <Widget>[ new DefaultTabController( length: 2, child: new Column( children: <Widget>[ new Container( height: 200.0, child: new Center( child: new Text('Swipe here'), ), ), new Container( height: 100.0, color: Colors.grey, child: new TabBar( key: new PageStorageKey<Type>(TabBar), tabs: <Widget>[ new Tab(text: 'Green'), new Tab(text: 'Red'), ], ), ), new Expanded( child: new TabBarView( key: new PageStorageKey<Type>(TabBarView), children: [ new Container(color: Colors.green), new Container(color: Colors.red), ], ), ), ], ), ), new Center( child: new Text('Ok now swipe back'), ), ], ), ); } } ``` ## Flutter Doctor ``` [✓] Flutter (on Mac OS X 10.12.4 16E195, locale en-US, channel master) • Flutter at /Users/jackson/git/flutter • Framework revision c5999c74c0 (2 hours ago), 2017-06-26 12:47:43 +0200 • Engine revision 8a2d337446 • Tools Dart version 1.24.0 [✓] Android toolchain - develop for Android devices (Android SDK 25.0.3) • Android SDK at /Users/jackson/Library/Android/sdk/ • Platform android-25, build-tools 25.0.3 • ANDROID_HOME = /Users/jackson/Library/Android/sdk/ • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b06) [✓] iOS toolchain - develop for iOS devices (Xcode 8.3.3) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 8.3.3, Build version 8E3004b, • ios-deploy 1.9.1 • CocoaPods version 1.2.1 [✓] Android Studio (version 2.3) • Android Studio at /Applications/Android Studio.app/Contents • Gradle version 3.2 • Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b06) [✓] IntelliJ IDEA Community Edition (version 2017.1.3) • Flutter plugin version 14.0 • Dart plugin version 171.4424.63 [✓] Connected devices • iPhone 7 Plus • F8A917C4-9848-49C2-8F0D-664B49E0B635 • ios • iOS 10.3 (simulator) ```
framework,f: material design,has reproducible steps,P2,found in release: 3.7,found in release: 3.9,team-design,triaged-design
low
Critical
238,563,315
kubernetes
Environment variables are not re-interpolated when re-applying deployment
/kind bug **What happened**: The environment variables were not interpolated **What you expected to happen**: **How to reproduce it (as minimally and precisely as possible)**: create environment variable like this ``` - name: REDIS_URL value: redis://:$(REDIS_PASSWORD)@redis-master-service.default.svc.cluster.local:$(REDIS_MASTER_SERVICE_SERVICE_PORT)/0 ``` do "kubectl apply -f ." add another variable: ``` - name: REDIS_PASSWORD valueFrom: configMapKeyRef: name: global-config key: redis.password ``` and if you bash'in in the container, the command "env" will print value for REDIS_URL with not interpolated $(REDIS_PASSWORD) even though it should have been replaced. The current workaround is to add REDIS_PASSWORD first and remove REDIS_URL, apply changes, then add REDIS_URL, and then apply changes again. **Anything else we need to know?**: **Environment**: - Kubernetes version (use `kubectl version`): ``` Client Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.0", GitCommit:"58b7c16a52c03e4a849874602be42ee71afdcab1", GitTreeState:"clean", BuildDate:"2016-12-12T23:35:54Z", GoVersion:"go1.7.4", Compiler :"gc", Platform:"windows/amd64"} Server Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.3", GitCommit:"029c3a408176b55c30846f0faedf56aae5992e9b", GitTreeState:"clean", BuildDate:"2017-02-15T06:34:56Z", GoVersion:"go1.7.4", Compiler :"gc", Platform:"linux/amd64"} ``` - Cloud provider or hardware configuration**: AZURE - OS (e.g. from /etc/os-release): ``` NAME="Ubuntu" VERSION="16.04.2 LTS (Xenial Xerus)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 16.04.2 LTS" VERSION_ID="16.04" HOME_URL="http://www.ubuntu.com/" SUPPORT_URL="http://help.ubuntu.com/" BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/" VERSION_CODENAME=xenial UBUNTU_CODENAME=xenial ``` - Kernel (e.g. `uname -a`): Linux k8s-master-FD89DE52-0 4.4.0-72-generic #93-Ubuntu SMP Fri Mar 31 14:07:41 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
kind/bug,sig/apps,lifecycle/frozen,needs-triage
medium
Critical
238,563,845
opencv
locale dependencies
<!-- 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) - OpenCV => 3.2.0 - Operating System / Platform => Ubuntu 16.04 x86_64 - Compiler => gcc ##### Detailed description https://github.com/opencv/opencv/blob/master/modules/features2d/src/orb.cpp line:73 in unlucky locale you'll get an error: OpenCL program build log: -D ORB_RESPONSES -D blockSize=7 -D scale_sq_sq=3,847753306719e-16f -D HARRIS_K=0,039999999106f <kernel>:35:49: error: invalid digit '9' in octal constant responses[idx] = ((float)a * b - (float)c * c - HARRIS_K * (float)(a + b) * (a + b))*scale_sq_sq; "scale_sq_sq" certainly has not valid value too. Setting up "LANG" environment variable to "en_US.UTF-8" could help, but it's not a good solution, I think.. ##### Steps to reproduce <!-- to add code example fence it with triple backticks and optional file extension ```.cpp // C++ code example ``` or attach as .txt or .zip file -->
bug,category: core,category: ocl,incomplete
low
Critical
238,592,859
rust
Add lint for u8 as *mut cast
This is an easy error to make: #42901 #42827 A cast from u8 to a pointer is probably always an error. In the rare case that you're creating a pointer into the first 256 bytes of address space, `u8 as usize as *mut` is more clear, or you can be troubled to `#[allow(u8_to_ptr)]`.
A-lints,C-feature-request
low
Critical
238,624,767
angular
Change detection is not triggered by an Observable whose values are emitted from an ErrorHandler
<!-- PLEASE HELP US PROCESS GITHUB ISSUES FASTER BY PROVIDING THE FOLLOWING INFORMATION. ISSUES MISSING IMPORTANT INFORMATION MIGHT BE CLOSED WITHOUT INVESTIGATION. --> ## I'm submitting a ... <!-- Check one of the following options with "x" --> <pre><code> [ ] Regression (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 --> [ ] 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. --> Component change detection is not triggered when connecting an AsyncPipe to an RxJS Observable whose values are emitted asynchronously from a custom ErrorHandler. ## Expected behavior <!-- Describe what the desired behavior would be. --> Component change detection is triggered and the component is updated with the value emitted in the Observable. ## 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). --> See this [plunker](https://plnkr.co/edit/1ZtlP31v6QWc0yNqeEP3). 1. Open the console to see some debug log. 2. Click on <kbd>Do an async error</kbd> button to make an HTTP call that results in an error. 3. Look at the console. - `MyErrorHandler emit "oups" in the subject` tells us that the error is correctly catch by the error handler. - `DisconnectedAlertComponent receives an error from the service: oups` tells us that the component listening on the observable correctly receive the error. 4. But the `<p>{{ error$ | async }}</p>` is not updated and _**oups**_ is not written in the DOM. 5. Click on <kbd>Clic me to perform a user action and trigger the change detection</kbd> button to perfom a simple user interaction that trigger the change detection. 6. `<p>{{ error$ | async }}</p>` is updated and _**oups**_ is written in the DOM ## What is the motivation / use case for changing the behavior? <!-- Describe the motivation or the concrete use case. --> I am trying to detect when my backend API isn't reachable, and emit some HTTP error. A custom error handler listen for that kind of error, and emit the error inside the observable of a global service. A popup component is listening on this observable to display the error when it occurs. ## Please tell us about your environment <pre><code> Angular version: 4.2.4 <!-- Check whether this is still an issue in the most recent Angular version --> Browser: - [x] Chrome (desktop) version 59 - [ ] Chrome (Android) version XX - [ ] Chrome (iOS) version XX - [x] Firefox version 54 - [ ] Safari (desktop) version XX - [ ] Safari (iOS) version XX - [ ] IE version XX - [ ] Edge version XX For Tooling issues: - Node version: 8.1.2 <!-- use `node --version` --> - Platform: Windows 10, Linux Xubuntu<!-- Mac, Linux, Windows --> Others: <!-- Anything else relevant? Operating system version, IDE, package manager, HTTP server, ... --> - NPM version: 5 - Angular CLI version: 1.1.3 - ZoneJS version: 0.8.12 </code></pre>
type: bug/fix,freq2: medium,area: core,core: change detection,core: error handling,P3
low
Critical
238,632,243
go
proposal: spec: consider more strict "declared and not used" check (go/vet or even spec)
The following code ``` func f(i interface{}) *T { x, ok := i.(*T) if !ok { x := new(T) x.f = 0 } return x } ``` compiles without errors even though it is obviously incorrect: Inside the block of the `if` statement, the `:=` operator should have been `=` instead. The compiler doesn't complain because the assignment to `x.f` counts as _use_ of `x`. Arguably, assignments to fields/elements of composite type variables shouldn't be counted as _uses_. Their effect is lost if the variable itself is never used and they may hide the fact that the variable is not used. (This was the underlying cause for #20789.)
LanguageChange,Proposal,LanguageChangeReview
low
Critical
238,633,109
flutter
Factor out deep linking logic
The deep linking functionality that landed last week has a few side effects. (Videos sent in an email). Starting from a position where the app is closed (nothing to restore) I get the following: 1. If the route passed has the format `/blah/this/thing` then the `Navigator` (as designed) will attempt to push to the stack the matching Route and parents in the hierarchy. This all appears to work fine, other than a momentary "black screen" while starting up. 2. If the route passed has the format `some:route:togoto` then the `Navigator` (as designed) will NOT attempt to push the hierarchy. What will happen though is that because you are pushing a route where there is no parent, `Navigator.pop` doesn't know how to correctly dispose of the pushed widget but the back button does. If you use `Navigator.pop` then you will be left with a black screen. Starting from a position where the app has an existing state but is backgrounded I get the following: 3. If you pass a route that starts with a slash then flutter will push an additional root route. I'm not sure if that is the expectation, but you will definitely have situations where you go from ScreenB -> ScreenA -> ScreenA. I know on Android this will more likely be an issue, but wouldn't it still create a possible scenario where there is an "active" screen that can never be reached. i.e: if you have a "Home" screen (no back button on it) and then a second one pops on top of it. Feel free to reach out because its hard to describe and I'm sure stuff didn't make sense.
framework,customer: posse (eap),f: routes,P3,team-framework,triaged-framework
medium
Critical
238,652,991
go
proposal: spec: require return values to be explicitly used or ignored (Go 2)
Today, if a Go function returns both a value and an error, the user must either assign the error to a variable ```go v, err := computeTheThing() ``` or explicitly ignore it ```go v, _ := computeTheThing() ``` However, errors that are the only return value (as from `io.Closer.Close` or [`proto.Unmarshal`](https://godoc.org/github.com/golang/protobuf/proto#Unmarshal)) or paired with an often-unneeded return value (as from `io.Writer.Write`) are easy to accidentally forget, and not obvious in the code when forgotten. ```go tx.Commit() // Store the transaction in the database! ``` The same problem can occur even when errors are not involved, as in functional-style APIs: ```go t := time.Now() t.Add(10 * time.Second) // Should be t = t.Add(…) ``` ```go strconv.AppendQuote(dst, "suffix") // Should be dst = strconv.AppendQuote(…) ``` For the few cases where the user really does intend to ignore the return-values, it's easy to make that explicit in the code: ```go _, _ = fmt.Fprintln(&buf, v) // Writes to a bytes.Buffer cannot fail. go func() { _, _ = fmt.Fprintln(os.Stderr, findTheBug()) }() ``` And that transformation should be straightforward to apply to an existing code base (e.g. in a Go 1-to-2 conversion). On the other hand, the consequences of a forgotten error-check or a dropped assignment can be quite severe (e.g., corrupted entries stored to a production database, silent failure to commit user data to long-term storage, crashes due to unvalidated user inputs). ---- Other modern languages with explicit error propagation avoid this problem by requiring (or allowing API authors to require) return-values to be used. * Swift warns about unused return values, but allows the warning to be suppressed if the [`@discardableResult`](https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Attributes.html#//apple_ref/doc/uid/TP40014097-CH35-ID347) attribute is set. * Prior to a [change in Swift 3](https://github.com/apple/swift-evolution/blob/master/proposals/0047-nonvoid-warn.md), return-values could be ignored by default (but a warning could be added with `@warn_unused_result`) * Rust has the [`#[must_use]`](https://doc.rust-lang.org/std/result/#results-must-be-used) attribute. * C++17 has the [`[[nodiscard]]`](http://en.cppreference.com/w/cpp/language/attributes) attribute, which standardizes the longstanding `__attribute__((warn_unused_result))` GNU extension. * The `ghc` Haskell compiler provides warning flags for unused results ([`-fwarn-unused-do-bind` and `-fwarn-wrong-do-bind`](https://downloads.haskell.org/~ghc/7.8.4/docs/html/users_guide/options-sanity.html)). * OCaml warns about unused return values by default. It provides an [`ignore`](https://caml.inria.fr/pub/docs/manual-ocaml/libref/Pervasives.html) function in the standard library. I believe that the OCaml approach in particular would mesh well with the existing design of the Go language. I propose that Go should reject unused return-values by default. If we do so, we may also want to consider an `ignore` built-in or keyword to ignore any number of values: ```go go func() { ignore(fmt.Fprintln(os.Stderr, findTheBug())) }() ``` or ```go go func() { ignore fmt.Fprintln(os.Stderr, findTheBug()) }() ``` or ```go go func() { _ fmt.Fprintln(os.Stderr, findTheBug()) }() ``` If we use a built-in function, we would probably want a corresponding `vet` check to avoid subtle eager-evaluation bugs: ```go go ignore(fmt.Fprintln(os.Stderr, findTheBug())) // BUG: evaluated immediately ``` ---- **Related proposals** Extending `vet` checks for dropped errors: #19727, #20148 Making the language more strict about unused variables in general: #20802 Changing error-propagation: #19991
LanguageChange,Proposal,error-handling,LanguageChangeReview
high
Critical
238,668,073
TypeScript
TypeScript complains about overwriting .d.ts files that are potentially known outputs
<!-- BUGS: Please use this template. --> Using tsc at the command line, I got ``` error TS5055: Cannot write file '/Users/alexamil/WebstormProjects/oresoftware/ldap-pool/index.d.ts' because it would overwrite input file. ``` why? :) my tsconfig.json file is as follows ```json { "compilerOptions": { "declaration": true, "baseUrl": ".", "types": [ "node" ], "typeRoots": [ "node_modules/@types" ], "target": "es5", "module": "commonjs", "noImplicitAny": true, "removeComments": true, "allowUnreachableCode": true, "lib": [ "es2015", "es2016", "es2017" ] }, "compileOnSave": false, "exclude": [ "node_modules" ] } ```
Suggestion,Awaiting More Feedback
medium
Critical
238,696,506
go
image/gif: decoding gif returns `unknown block type: 0x01` error
Please answer these questions before submitting your issue. Thanks! ### What version of Go are you using (`go version`)? ``` go version go1.8.3 darwin/amd64 ``` ### What operating system and processor architecture are you using (`go env`)? ``` GOARCH="amd64" GOBIN="" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/montanaflynn/Development/go" GORACE="" GOROOT="/usr/local/go" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" GCCGO="gccgo" CC="clang" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/w7/gd1mgc9n05q_9hrtt2sd75dw0000gn/T/go-build873139005=/tmp/go-build -gno-record-gcc-switches -fno-common" CXX="clang++" CGO_ENABLED="1" PKG_CONFIG="pkg-config" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" ``` ### What did you do? Tried to decode [this gif](http://i.imgur.com/cjbY0nE.gif): ```go package main import ( "flag" "fmt" "image/gif" "net/http" "os" ) func exitIfError(err error) { if err == nil { return } fmt.Fprintf(os.Stderr, "%v\n", err) os.Exit(1) } func main() { gifURL := flag.String("url", "http://i.imgur.com/cjbY0nE.gif", "the URL of the GIF") flag.Parse() res, err := http.Get(*gifURL) exitIfError(err) _, err = gif.DecodeAll(res.Body) _ = res.Body.Close() exitIfError(err) } ``` ### What did you expect to see? The gif decode not to error ### What did you see instead? ``` gif: unknown block type: 0x01 ```
NeedsInvestigation
low
Critical
238,706,123
go
x/build/cmd/coordinator: use maintner to start trybots, not polling gerrit API
Currently Trybots start by a goroutine loop in the coordinator (findTryWorkLoop) running a Gerrit query every 60 seconds: ```go func findTryWorkLoop() { if errTryDeps != nil { return } ticker := time.NewTicker(60 * time.Second) for { if err := findTryWork(); err != nil { log.Printf("failed to find trybot work: %v", err) } <-ticker.C } } func findTryWork() error { query := "label:Run-TryBot=1 label:TryBot-Result=0 status:open" ... cis, err := gerritClient.QueryChanges(context.Background(), query, gerrit.QueryChangesOpt{ Fields: []string{"CURRENT_REVISION", "CURRENT_COMMIT", "CURRENT_FILES"}, }) ... ``` This sucks for two reasons: 1) It runs every 60 seconds, wasting on average 30 seconds and at worst 60 seconds of our overall 5 minute goal for Trybots. 2) If a new CL is uploaded in the meantime, Gerrit removes +1 votes and the CL is treated as if it's no longer desired to be a trybot job. (see confusion in @shurcooL's https://golang.org/cl/46715). We should fix both at the same time by watching maintner instead and using the live Gerrit data and knowing the history of the vote. /cc @andybons @shurcooL
Builders,NeedsInvestigation
low
Critical
238,803,732
vscode
Selection of problem matcher is not very intuitive when running a task
Testing the following in #29442: > Task > Run Build Task: shows the list again with the task run last listed under recently used tasks. This time select a problem matcher: Enusre that problems are detected (2) and that the tasks.json file opens with a configuration like this... I was presented with a list that contains several items that look similar but do not work the same way ![image](https://user-images.githubusercontent.com/2239563/27582143-38bdde48-5b30-11e7-9856-f44f8264b241.png) To me `Gulp TSC Problems [$gulp-tsc]` and `TypeScript problems [$tsc]` problem matchers seemed semantically identical, so I picked up the first one just because I am using gulp task, and I needed to match TSC problems. It did not work, and only then I tried the second one, which worked and matched the problem. If I wouldn't know what problem matchers do, I would not experience any difference whether I selected anything from the list or not. Hence, two points: 1. If I select a problem matcher that does not find anything because it is wrong, I should have indication of this. Maybe 'Problems' tab can have a hint, pointing to problem matchers if a task was executed and no problems were detected? Other option is to echo information to the terminal that problem matcher did not find any problems. Otherwise it is very difficult to understand what was the impact of the selected problem matcher. Also having a badge with count of 'Problems found' on Problems tab in workbench pane would be beneficial, in order to see the result of problem matcher straight after running a task. Currently you have to move to 'Problems' tab to see problem count. 2. There should be a better way of semantic separation between those two tasks (and maybe any others). This is a difficult thing to do, and I cannot suggest anything at this time but we should be aware of it.
feature-request,tasks
low
Minor
238,831,784
vscode
Auto indent on pasting does not satisfy indentation for braces in JS/TS
Testing #29494 Copy the following code into into an editor file of type JavaScript, indented with tabs (4): ``` function makeSub(a,b) { subsent = sent.substring(a,b); return subsent; } ``` **Result**: ![image](https://user-images.githubusercontent.com/2239563/27587148-7f5d2e86-5b43-11e7-997c-37c6fb4e2519.png) **Expectation**: Closing curly brace not to be indented.
typescript,javascript,editor-autoindent,under-discussion,on-unit-test
low
Major
238,848,793
angular
Disabling form controls leads to changed-after-checked errors
<!-- PLEASE HELP US PROCESS GITHUB ISSUES FASTER BY PROVIDING THE FOLLOWING INFORMATION. ISSUES MISSING IMPORTANT INFORMATION MIGHT BE CLOSED WITHOUT INVESTIGATION. --> ## I'm submitting a ... <!-- Check one of the following options with "x" --> <pre><code> [ ] Regression (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 --> [ ] 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. --> MyComponent has a `disabled` Input property and a `valueChange` Output property. Users sometimes want to disable the component after the `valueChange` event was handled. Setting the component's `[disabled]` property to `true` rightfully causes its child input element to emit a `blur` event. The `onTouched` is then called, which changes the `ng-touched` binding causing ExpressionChangedAfterItHasBeenCheckedError. This happens only if `ngModel` binding is used. ## Expected behavior <!-- Describe what the desired behavior would be. --> ExpressionChangedAfterItHasBeenCheckedError should not be thrown. ## 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). --> Steps to reproduce: 1. Focus the input element 2. Change the text 3. Press Enter [DEMO HERE](http://plnkr.co/edit/4E4eDogGVuhKGkLD8WaR?p=preview) ## What is the motivation / use case for changing the behavior? <!-- Describe the motivation or the concrete use case. --> Ideally, using `ngModel` binding should not break a scenario that is otherwise working with `[value]` and `(valueChange)` bindings. Using timeouts or manual change detection is plausible, but those are workarounds to an outstanding issue. ## Please tell us about your environment <pre><code> Angular version: 4.2.3 <!-- Check whether this is still an issue in the most recent Angular version --> Browser: - [x] Chrome (desktop) version 58.0.3029.110 - [?] Chrome (Android) version XX - [?] Chrome (iOS) version XX - [ ] Firefox version 53.0.2 - [?] Safari (desktop) version XX - [?] Safari (iOS) version XX - [x] IE version 11.962 **PRESSING ENTER DOES NOT TRIGGER CHANGE** - [ ] Edge version 25.1 / 13.10 </code></pre>
type: bug/fix,hotlist: components team,freq2: medium,area: forms,state: confirmed,forms: disabling controls,P4
low
Critical
238,909,739
opencv
Documentation for reduce() function does not match its CV2 implementation in python
For Python programmers who have OpenCV v3.xxx installed (aka the cv2 library in Python-world), the only OpenCV online documentation available for the **reduce()** function shows incorrect info that makes the function impossible to use. When searching for usage info for this function (eg, search: "python open cv reduce()" or something similar), we get only the v2.4 doc pages. So those with OpenCV 3.xxx installed will see only the v2.4 pages (there are no v3.xxx doc pages available for Python programmers importing cv2) Those users will be unable to use the **reduce()** function because they will not know that the OpenCV v2.4 doc pages describe older/deprecated constants (**_CV_REDUCE_SUM_**, et al), which were renamed in openCV 3.0 (they are now called **_REDUCE_SUM_**, et al). ##### System information (version) - OpenCV => my system has v3.1.0 - Operating System / Platform => Windows 10 (and prior) - Compiler => Python 3.6 (Anaconda3) ##### Detailed description Documentation for the **reduce()** function has differing doc pages for OpenCV version 2 (2.1 through latest 2.4.13.2) versus the newer OpenCV 3 (versions 3.0.0 to latest 3.2.0-dev). By itself this is not a problem (other than maybe?? backward compatibility issues). However, when compounded with the fact that web-search for usage info for the **reduce()** function show results **_only for the v2.4 OpenCV modules_** (ie. no info for v3.xxx modules appear if we search with "Python" or "cv2" as a keyword), thus Python users of OpenCV 3.xxx looking for this info will currently get the incorrect info. They will soon see the **reduce()** function does not work according to how it's described in the official OpenCV doc pages. They have no way of knowing that there are totally different doc pages for v3.xxx containing different info, including the renamed REDUCE_SUM (and related) constants. The difference between the 2.xx and 3.xx doc pages that causes the problem is that there are 4 constants required to use function **reduce()**, and these constants were renamed between OpenCV 2 and 3: "**_CV_REDUCE_xxx_**" (CV_REDUCE_SUM, CV_REDUCE_AVG, CV_REDUCE_MAX, and CV_REDUCE_MIN) became "**_REDUCE_xxx_**" (REDUCE_SUM, et al) in OpenCV 3.xxx. This problem occurs mainly because doc pages with "Python" always brings up the 2.4 version of the online OpenCV documentation -- which shows the deprecated constants. However, 3.xxx binaries/sources and definitions don't conform to that 2.4xx documentation. Possible Solution: a) update the v3.xx documentation to also show Python headers (so they appear in search results), **and** b) update the v2.4.x documentation to include a note that the four CV_REDUCE_xxx constants were renamed in OpenCV 3, to be REDUCE_xxx. (I didn't check this but it's possible the constants for 2.4 were also renamed in v2.4 binaries, which means the v2.4 doc pages are also in error and so must be updated to also show the renamed constants) I believe the Python doc pages and bindings are automagically generated from the official C++ version. So the problem may be caused by the Python bindings no longer being correct (for OpenCV v3.xxx files, for the **reduce()** function or its constants definitions). ##### Steps to reproduce - This link shows the problem (for v2.4.13.2): [http://docs.opencv.org/2.4.13.2/modules/core/doc/operations_on_arrays.html?highlight=cv_reduce_avg#cv2.reduce](url) _This first URL shows the Python header (highlighted) for the **reduce()** function. In the paragraph, it describes 4 constants (which are required) to call this function. This is the only official documentation available to Python programmers on the web (on [docs.OpenCV.org](url) )._ - Another link (for v2.4 doc page): [http://docs.opencv.org/2.4/modules/core/doc/operations_on_arrays.html?highlight=cv_reduce_avg#cv2.reduce](url) - The correct documentation exists only for v3 and up, however Python programmers cannot see/find those links. This page show the (now renamed) constants that Python programmers don't know about: [http://docs.opencv.org/3.1.0/d2/de8/group__core__array.html#ga4b78072a303f29d9031d56e5638da78e](url) - Here's the v3.1.0 constants definition for **cv::ReduceTypes**: [http://docs.opencv.org/3.1.0/d0/de1/group__core.html#ga14cdedf2933367eb9395ec16798af994](url)
feature,category: documentation,category: features2d
low
Critical
238,956,416
go
x/tools/cmd/goimports: support repairing import grouping/ordering
I'm working on a tool to fix up non-conventional or incorrect imports grouping/ordering, but I'd much rather have this be part of goimports. Would it be welcome? ### What goimports does now When goimports adds or removes an import, it heuristically attempts to find a good place for it. So if I add an `os.Open()` call, and my imports already look like this: ```go import ( "context" "testing" "github.com/Sirupsen/logrus" ) ``` Then goimports will put "os" in the proper spot, beween "context" and "testing". That's great! ### What goimports does not do If my imports are not grouped and sorted in the conventional way, goimports will not usually fix the problem. For example, if I was using the old context package, my imports might look like this: ```go import ( "testing" "github.com/Sirupsen/logrus" "golang.org/x/net/context" ) ``` When I edit the context import to the new package, "context", I have this: ```go import ( "testing" "github.com/Sirupsen/logrus" "context" ) ``` Running goimports will notice that logrus and context don't make a proper group, so it will separate them: ```go import ( "testing" "context" "github.com/Sirupsen/logrus" ) ``` But this isn't what we really want. Ideally, it would just re-group and re-order all the imports, to yield: ```go import ( "context" "testing" "github.com/Sirupsen/logrus" ) ``` ### Work so far I have a tool that will globally reorder imports according to the grouping rules, including the associated doc-comments; see below. I could also develop similar funcitonality inside goimports. My tool is not nearly perfect: It doesn't handle multiple import declarations; it doesn't know about `import "C"`. It's not even clear what *should* happen to random non-doc-comments inside the import block, eg: ```go import ( "github.com/Sirupsen/logrus" // When we re-order, what happens to this comment? "testing" ) ``` Automatically grouping and ordering would also be a behavioral change for goimports, so it would have to be behind a flag for now.
Proposal,Proposal-Accepted,NeedsFix,Tools
high
Critical
238,964,241
rust
impl-trait return type is bounded by all input type parameters, even when unnecessary
``` rustc 1.20.0-nightly (f590a44ce 2017-06-27) binary: rustc commit-hash: f590a44ce61888c78b9044817d8b798db5cd2ffd commit-date: 2017-06-27 host: x86_64-pc-windows-msvc release: 1.20.0-nightly LLVM version: 4.0 ``` ```rust trait Future {} impl<F> Future for Box<F> where F: Future + ?Sized {} struct SomeFuture<'a>(&'a Client); impl<'a> Future for SomeFuture<'a> {} struct Client; impl Client { fn post<'a, B>(&'a self, _body: &B) -> impl Future + 'a /* (1) */ { SomeFuture(self) } } fn login<'a>(client: &'a Client, username: &str) -> impl Future + 'a { client.post(&[username]) } fn main() { let client = Client; let _f = { let username = "foo".to_string(); login(&client, &username) }; } ``` Since `SomeFuture` borrows `'a Client`, I'd expect `impl Future + 'a` to be the correct return type, but it gives this error: ``` error[E0700]: hidden type for `impl Future + 'a` captures lifetime that does not appear in bounds --> src/main.rs:16:5 | 15 | fn login<'a>(client: &'a Client, username: &str) -> impl Future + 'a { | ---- ---------------- opaque type defined here | | | hidden type `impl Future + 'a` captures the anonymous lifetime defined here 16 | client.post(&[username]) | ^^^^^^^^^^^^^^^^^^^^^^^^ | help: add a `use<...>` bound to explicitly capture `'_` | 15 | fn login<'a>(client: &'a Client, username: &str) -> impl Future + 'a + use<'a, '_> { | +++++++++++++ ``` - Changing `_body` to have an explicit lifetime like `_body: &'b B` where `'b` is independent of `'a` or where `'a: 'b` does not change the error. This and the original error make it seem that returning an `impl trait` is somehow causing the `_body` parameter to get the `'a` lifetime, even though it's clearly unused, let alone used in a way that it would require the `'a` lifetime. - Changing `(1)` from `impl Future + 'a` to `SomeFuture<'a>` fixes it. - Changing `(1)` from `impl Future + 'a` to `Box<Future + 'a>` and returning `Box::new(SomeFuture(self))` fixes it.
A-lifetimes,T-compiler,A-impl-trait,C-bug,WG-async,F-precise_capturing
medium
Critical
238,972,883
vscode
auto indenting issues with C# files
testing #29493 ![image](https://user-images.githubusercontent.com/1487073/27608238-894db968-5b3b-11e7-8cc8-8b204721c1cf.png) 1. Create a simple C# file that looks like this: ``` c# using System; namespace ConsoleApplication { public class Program { public static void Main(string[] args) { // Console.WriteLine("Adfasdf"); // Console.WriteLine("Hello World!"); } } } ``` 2. Install the C# extension if not already installed 3. Put cursor on line 12, the most inner closing curly brace 4. Move line up, above the first comment: ![image](https://user-images.githubusercontent.com/1487073/27608300-c7ead16a-5b3b-11e7-8a33-ef64e72759c9.png) Result: Closing brace is indented incorrectly (IMO). 5. Move the line back down to where it was: ![image](https://user-images.githubusercontent.com/1487073/27608485-929f6a24-5b3c-11e7-98bb-213f060ecfcd.png) Result: the closing brace is not indented properly
feature-request,editor-autoindent,c#
low
Minor
238,994,469
go
runtime: TestGdbPython* fails on solaris
On a development build of Solaris, TestGdbPythonCgo fails: ``` $ uname -a SunOS darwin-sunw 5.12 s12_127 i86pc i386 i86pc ``` ``` $ gdb --version GNU gdb (GDB) 7.12.1 ``` ``` $ go version go version devel +33b3cc1568 Tue Jun 27 20:45:38 2017 +0000 solaris/amd64 ``` ``` $ go env GOARCH="amd64" GOBIN="" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="solaris" GOOS="solaris" GOPATH="/builds/srwalker/gocode" GORACE="" GOROOT="/builds/srwalker/golang/go-trunk" GOTOOLDIR="/builds/srwalker/golang/go/pkg/tool/solaris_amd64" GCCGO="gccgo" CC="gcc" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build788895360=/tmp/go-build -gno-record-gcc-switches" 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" ``` ``` $ go test -v -run TestGdbPythonCgo === RUN TestGdbPythonCgo --- FAIL: TestGdbPythonCgo (2.51s) runtime-gdb_test.go:55: gdb version 7.12 runtime-gdb_test.go:218: goroutine 1 bt failed: #0 0x00007fffbf25574a in __nanosleep () from /lib/64/libc.so.1 #1 0x00007fffbf23d8e3 in nanosleep () from /lib/64/libc.so.1 Backtrace stopped: previous frame inner to this frame (corrupt stack?) FAIL exit status 1 FAIL runtime 2.520s ``` At the moment, it's unclear if this is due to GDB 7.12 or because of something else as all other runtime tests pass. I intend to investigate and root cause if possible soon.
Testing,OS-Solaris,NeedsFix,compiler/runtime
medium
Critical
239,033,995
go
runtime: add test for syscall failing to create new OS thread during syscall.Exec
Please answer these questions before submitting your issue. Thanks! ### What version of Go are you using (`go version`)? `go version go1.8 linux/amd64` (same behavior with 1.8.3) ### What operating system and processor architecture are you using (`go env`)? ``` GOARCH="amd64" GOBIN="" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/jvshahid/codez/gocodez" GORACE="" GOROOT="/home/jvshahid/.gvm/gos/go1.8" GOTOOLDIR="/home/jvshahid/.gvm/gos/go1.8/pkg/tool/linux_amd64" GCCGO="gccgo" CC="gcc" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build588313748=/tmp/go-build -gno-record-gcc-switches" CXX="g++" CGO_ENABLED="1" PKG_CONFIG="pkg-config" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" ``` ### What did you do? Run [this app](https://play.golang.org/p/bdTxZynzT4) in a while loop, e.g. `while true; do go run main.go; done` ### What did you expect to see? ``` /path/to/pwd /path/to/pwd /path/to/pwd /path/to/pwd /path/to/pwd /path/to/pwd ``` ### What did you see instead? ``` runtime: failed to create new OS thread (have 5 already; errno=11) runtime: may need to increase max user processes (ulimit -u) fatal error: newosproc ``` ### Kernel version (uname -a) ``` Linux amun 4.4.0-81-generic #104-Ubuntu SMP Wed Jun 14 08:17:06 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux ``` There are few issues that were opened in the past with the same error message. The most relevant comment i found in all of them is [this comment](https://github.com/golang/go/issues/13968#issuecomment-171985380) which suggests that this could be a kernel issue and was looking for a way to reproduce the problem. Some interesting notes: 1. setting `GOMAXPROCS` to `1` make the problem hard to reproduce (may be event eliminate it) 2. the go runtime usually gets a chance to run for a while before the process threads are killed. that means that the process will sometime exec successfully and exit 0 and will sometimes exit with non-0 status code after panicing
Testing,NeedsFix
low
Critical
239,050,098
vue
Callback refs as additional alternative to "named" refs
### What problem does this feature solve? Currently if you want to use refs to elements (DOM elements or Vue components - see attribute/prop "ref") you have to provide a string as "ref" attribute. A callback function as "ref" attribute like in React is currently not supported in Vue. It would be great if also callback functions could be provided as "ref" attributes (especially when doing a bit more advanced stuff using the "render" function). The callback function should be called both when the referred element is created and also when it is disposed (React for example passes null in the latter case). It seems that this feature had already been implemented in the past but has been reverted later (I do not know for what reasons the changes have been reverted) => see: "[WIP] Support for ref callback #4807" Thank you very much. ### What does the proposed API look like? Please see line 178 here: https://github.com/vuejs/vue/pull/4807/commits/90c6c2902b1f124093ad0d514984230194cb818e const myRefCallback(ref, remove) {...} (where "remove" is boolean) seems to me like a better solution that the one that is used in React where in the "remove" case the ref callback function is just called with null. <!-- generated by vue-issues. DO NOT REMOVE -->
feature request
low
Major
239,079,493
go
x/mobile: SIGABRT when trying to call Go functions on Android
Please answer these questions before submitting your issue. Thanks! ### What version of Go are you using (`go version`)? go version go1.8.3 darwin/amd64 ### What operating system and processor architecture are you using (`go env`)? OSX Sierra 10.12.5 GOARCH="amd64" GOOS="darwin" ### What did you do? 1. Create empty Android project in Android studio. 2. Build hello.aar from mobile examples by `gomobile bind -target=android golang.org/x/mobile/example/bind/hello` 3. Import hello.aar as a new module into existed Android project. 4. Make golang call from Java code `hello.Hello.greetings("Test");` 5. Build and run ### What did you expect to see? Everything works OK. ### What did you see instead? App is built and run, but it crashes when golang call is happened. There's a logcat output: 06-27 13:54:27.849 10901-10930/? A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 10930 (upikin.mygotest) [ 06-27 13:54:27.849 160: 160 W/ ] debuggerd: handling request: pid=10901 uid=10071 gid=10071 tid=10930 06-27 13:54:27.883 10931-10931/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 06-27 13:54:27.883 10931-10931/? A/DEBUG: Build fingerprint: 'google/fugu/fugu:7.1.2/N2G47X/4026974:user/release-keys' 06-27 13:54:27.883 10931-10931/? A/DEBUG: Revision: '0' 06-27 13:54:27.883 10931-10931/? A/DEBUG: ABI: 'x86' 06-27 13:54:27.883 10931-10931/? A/DEBUG: pid: 10901, tid: 10930, name: upikin.mygotest >>> com.example.dtupikin.mygotest <<< 06-27 13:54:27.883 10931-10931/? A/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr -------- 06-27 13:54:27.883 10931-10931/? A/DEBUG: eax 00000000 ebx 00002a95 ecx 00002ab2 edx 00000006 06-27 13:54:27.883 10931-10931/? A/DEBUG: esi d0c47978 edi d0c47920 06-27 13:54:27.883 10931-10931/? A/DEBUG: xcs 00000023 xds 0000002b xes 0000002b xfs 0000006b xss 0000002b 06-27 13:54:27.883 10931-10931/? A/DEBUG: eip ffffe430 ebp d0c474e8 esp d0c4748c flags 00000296 06-27 13:54:27.886 10931-10931/? A/DEBUG: backtrace: 06-27 13:54:27.886 10931-10931/? A/DEBUG: #00 pc ffffe430 [vdso:ffffe000] (__kernel_vsyscall+16) 06-27 13:54:27.887 10931-10931/? A/DEBUG: #01 pc 000893dc /system/lib/libc.so (tgkill+28) 06-27 13:54:27.887 10931-10931/? A/DEBUG: #02 pc 00084c35 /system/lib/libc.so (pthread_kill+85) 06-27 13:54:27.887 10931-10931/? A/DEBUG: #03 pc 00036c2a /system/lib/libc.so (raise+42) 06-27 13:54:27.887 10931-10931/? A/DEBUG: #04 pc 0002e186 /system/lib/libc.so (abort+86) 06-27 13:54:27.887 10931-10931/? A/DEBUG: #05 pc 000a42e3 /data/app/com.example.dtupikin.mygotest-2/lib/x86/libgojni.so I do my tests on Asus Nexus Player (Android TV 7.1.2). The issue doesn't happen on Android TV emulator (versions 5,6,7) Tried to build aar on another PC (Windows 10 x64). The same crash happens.
mobile
low
Critical
239,079,924
TypeScript
Generic functon doesn't resolve type property when accept this as a parameter ?
**TypeScript Version:** 2.4.0 **Code** ```ts function getValue<T, TK extends keyof T>(obj: T, key: TK): T[TK] { return obj[key]; } class TestClass { z: number; testtest1(): number { return getValue(this as TestClass, 'z') + 1; // ok } testtest2(): number { return getValue(this, 'z') + 1; // error is here } } ``` **Expected behavior:** No error. **Actual behavior:** Getting an error "Operator + cannot be applied to types 'this["z"]' and '1' "
Bug
low
Critical
239,096,387
rust
Closure arguments are inferred monomorphically
Without an explicit annotation, closure arguments are inferred to have a concrete lifetime. You must manually annotate the argument in order to satisfy a HRTB. ```rust #[derive(PartialEq)] struct Foo; fn use_a_foo(_: &Fn(&Foo)) {} fn main() -> () { // This doesn't compile // let function = |foo_arg| { // assert!(&foo == foo_arg); // }; // explicit_for(&foo, &function); // This does let function = |foo_arg: &_| {}; use_a_foo(&function); } ```
C-enhancement,A-inference
low
Minor
239,155,747
pytorch
[feature request] time-distributed layers for application of normal layers to sequence data
As we move from images to videos, it seems imperative to feed sequential data into common image layers. However, the problem of dealing sequential data with such layers is not clears on Pytorch. I suggest here to devise something like -time-distributed layers for wrapping normal layers and aligning them for sequential inputs and outputs. I think in the course of time, it is going to be a more important pattern to have in Pytorch. Hope, I explain the problem clearly? Lately, I solved that problem for 1D feat vectors as follows; I wait some comments to generalize it if necessary. ```python class TimeDistributed(nn.Module): def __init__(self, module): super(TimeDistributed, self).__init__() self.module = module def forward(self, x): if len(x.size()) <= 2: return self.module(x) t, n = x.size(0), x.size(1) # merge batch and seq dimensions x_reshape = x.contiguous().view(t * n, x.size(2)) y = self.module(x_reshape) # We have to reshape Y y = y.contiguous().view(t, n, y.size()[1]) return y ```
module: nn,triaged
medium
Major
239,275,725
pytorch
Feature Request: ReLU on LSTMs and GRUs
Hello, I would really like the functionality to use a different activation function on the output of the RNNs. I have found ReLU more useful in classification models because, for instance, tanh output from an LSTM makes it easy for a subsequent softmax-linear layer to produce values near .999. Just throwing the idea out there incase someone wants to include that in an upcoming release. cc @zou3519
feature,module: nn,module: rnn,triaged
low
Major
239,334,944
flutter
Consider migrating AccessibilityNodeProvider to ExploreByTouchHelper
According to the Android Accessibility folks `ExploreByTouchHelper` would be better suitable for our use case as it supposedly already implements much of the logic we need. https://github.com/flutter/engine/blob/1009e9c0977d266c3af7eea3148f855e34006450/shell/platform/android/io/flutter/view/AccessibilityBridge.java#L26 https://developer.android.com/reference/android/support/v4/widget/ExploreByTouchHelper.html
platform-android,engine,a: accessibility,P3,team-android,triaged-android
low
Minor
239,481,893
opencv
cv::cudacodec::VideoReaderImpl cannot correctly catch several RTP streams
##### System information (version) - OpenCV => 3.2 - Operating System / Platform => Ubuntu 16.04, x86_64 - Compiler => gcc-5 - Cuda => 8.0 - NVidia Card => GTX 1070 ##### Detailed description When I try to show videos from multiple IP-cameras in one application, I see that all streams is "broken" like here: http://answers.opencv.org/question/34012/ip-camera-h264-error-while-decoding/. But when I try to show only one video from one camera, all is perfect. All streams from cameras is encoded in H264. ##### Steps to reproduce ``` // C++ Code: video_reader.cpp #include <iostream> #include "opencv2/opencv_modules.hpp" #include <string> #include <vector> #include <algorithm> #include <numeric> #include <thread> #include <opencv2/core.hpp> #include <opencv2/core/opengl.hpp> #include <opencv2/cudacodec.hpp> #include <opencv2/highgui.hpp> struct source { std::string filename; cv::Ptr<cv::cudacodec::VideoReader> d_reader; cv::cuda::GpuMat current_frame; }; int main(int argc, const char* argv[]) { if (argc < 2) return -1; cv::cuda::setGlDevice(); std::vector<source> src; for(uint32_t i=1;i<argc;++i) { cv::namedWindow(argv[i], cv::WINDOW_OPENGL); source s; s.filename=argv[i]; printf("%s\n",s.filename.c_str()); s.d_reader=cv::cudacodec::createVideoReader(s.filename); src.push_back(s); } for (;;) { for(auto it : src) { if (!it.d_reader->nextFrame(it.current_frame)) break; cv::imshow(it.filename, it.current_frame); if (cv::waitKey(3) > 0) break; } } return 0; } ``` For compile: $ g++ -std=c++11 video_reader.cpp -lopencv_core -lopencv_cudacodec -lopencv_imgproc -lopencv_imgcodecs -lopencv_highgui -lopencv_videoio -o reader Example of using: $ ./reader rtsp://91.5.1.106:554/Streaming/Channels/1/?transportmode=unicast \ rtsp://91.5.1.105:554/Streaming/Channels/1/?transportmode=unicast
bug,priority: low,category: videoio,category: gpu/cuda (contrib)
low
Critical
239,548,740
flutter
Detect incompatible plugin Maven/CocoaPod dependencies
If a developer is using multiple plugins that depend on mutually incompatible Maven or CocoaPods dependencies, it would be nice to detect this and help them resolve it (ideally automatically, but that would require teaching pub to do dependency resolution across both CocoaPods and Maven, which seems hard or even impossible). More context: https://stackoverflow.com/questions/44826801/flutter-app-doesnt-build-when-i-add-google-sign-in-or-firebase-dependencies-to
tool,t: gradle,t: xcode,P2,a: plugins,team-tool,triaged-tool
low
Minor
239,571,210
go
image: Decode drops interfaces
### What version of Go are you using (`go version`)? 1.8 Background: I am trying to register an image decoder for Webm (to make thumbnails). Commonly the reader passed to `image.Decode()` is an `*os.File` or a `multipart.File`. ### What did you see instead? The Reader passed to the decoder function (register with `image.RegisterFormat`) is almost never the same one as was passed to `image.Decode`. It is wrapped in a `reader` which also implements `Peek` (for looking at the first few bytes without accidentally consuming them. The problem is that wrapping in this type drops all the other interfaces of the reader, which may be useful to the Decoder. For example, in my case, the image decoding will be delegated to an executable. It would be better to pass the file name to the subprocess rather than streaming it over stdin. The `interface{Name() string}` interface of `*os.File`, and the `io.ReaderAt` and `io.Seeker` shared by `*os.File` and `multipart.File` cannot be accessed. It would be nice if the image package forwarded commonly used methods by optionally implementing them if the source reader did. For example: ``` type readernamer interface { reader Name() string } ``` which the image package would pass instead. I realize that would result in 2^n interfaces, but I don't see a way around it without exposing the original reader. One thing worth noting: The peeker interface is unnecessary if the input reader implements Seeker. Peek can be implemented with Read and Seek
NeedsDecision,early-in-cycle
low
Major
239,627,525
TypeScript
2.4: Readonly<Map<k,v>> vs. ReadonlyMap<k,v>
**TypeScript Version:** 2.4.1 **Code** ```ts function GenMap() : ReadonlyMap<string, number> { const theMap = new Map<string, number>(); theMap.set("one", 1); theMap.set("two", 2); return Object.freeze(theMap); } ``` **Expected behavior:** Compiles without error in tsc@<2.4.0 **Actual behavior:** ``` TryX.ts(5,5): error TS2322: Type 'Readonly<Map<string, number>>' is not assignable to type 'ReadonlyMap<s tring, number>'. Property '[Symbol.iterator]' is missing in type 'Readonly<Map<string, number>>'. ```
Bug,Help Wanted,Domain: lib.d.ts
low
Critical
239,630,869
go
image/gif: decoding gif returns `frame bounds larger than image bounds` error
Please answer these questions before submitting your issue. Thanks! ### What version of Go are you using (`go version`)? ``` go version go1.8.3 darwin/amd64 ``` ### What operating system and processor architecture are you using (`go env`)? ``` GOARCH="amd64" GOBIN="" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/montanaflynn/Development/go" GORACE="" GOROOT="/usr/local/go" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" GCCGO="gccgo" CC="clang" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/w7/gd1mgc9n05q_9hrtt2sd75dw0000gn/T/go-build873139005=/tmp/go-build -gno-record-gcc-switches -fno-common" CXX="clang++" CGO_ENABLED="1" PKG_CONFIG="pkg-config" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" ``` ### What did you do? Tried to decode [this gif](https://cdn.keycdn.com/img/analytics.gif): ```go package main import ( "flag" "fmt" "image/gif" "net/http" "os" ) func exitIfError(err error) { if err == nil { return } fmt.Fprintf(os.Stderr, "%v\n", err) os.Exit(1) } func main() { gifURL := flag.String("url", "https://cdn.keycdn.com/img/analytics.gif", "the URL of the GIF") flag.Parse() res, err := http.Get(*gifURL) exitIfError(err) _, err = gif.DecodeAll(res.Body) _ = res.Body.Close() exitIfError(err) } ``` ### What did you expect to see? The gif decoding not to return an error. The gif opens up in browsers, ffmpeg and photoshop. When using ffmpeg you see this warning log: ``` [gif @ 0x7faca2801000] Image too wide by 1, truncating. ``` ### What did you see instead? ``` gif: frame bounds larger than image bounds ``` I found this link which seems related: https://groups.google.com/forum/#!topic/golang-codereviews/3zxEsAv4IuU
NeedsInvestigation
low
Critical
239,672,855
go
cmd/compile: generate same code regardless of whether return values are named
There's an article at the top of Hacker News right now, https://blog.minio.io/golang-internals-part-2-nice-benefits-of-named-return-values-1e95305c8687 https://news.ycombinator.com/item?id=14668323 ... which advocates for naming return values for the benefit of better generated code. It concludes: > So we will be gradually adopting named return values more and more, both for new code as well as for existing code. > > In fact we are also investigating if we can develop a little utility to help or automate this process. This is totally counter to: https://golang.org/s/style#named-result-parameters ... which says that naming result parameters should only be for godoc cleanliness. We should fix the compiler to generate the same code regardless. /cc @randall77 @mdempsky @josharian @brtzsnr @cherrymui
NeedsFix,compiler/runtime
high
Critical
239,681,006
TypeScript
`--globalPlugins` and `--pluginProbeLocations` default to list with empty string
**TypeScript Version:** 2.5.0-dev.20170629 **Code** src/server/server.ts, line 758: ```ts const globalPlugins = (findArgument("--globalPlugins") || "").split(","); const pluginProbeLocations = (findArgument("--pluginProbeLocations") || "").split(","); ``` **Expected behavior:** `--globalPlugins` and `--pluginProbeLocations` default to empty list (`[]`). **Actual behavior:** `--globalPlugins` and `--pluginProbeLocations` default to list with empty string (`[""]`). This causes unnecessary attempts to load `""` as a module when the server is started: ```shell $ mkdir project && cd project $ npm install [email protected] $ touch index.ts tsconfig.json $ export TSS_LOG="-traceToConsole true -level verbose" $ echo '{"seq":1,"type":"quickinfo","command":"open","arguments":{"file":"index.ts"}}' | node node_modules/typescript/lib/tsserver.js Info 0 Binding... Info 1 request: {"seq":1,"type":"quickinfo","command":"open","arguments":{"file":"index.ts"}} Info 2 Search path: Info 3 Config file name: tsconfig.json Info 4 Loading from project/node_modules/typescript/lib/tsserver.js/../../.. (resolved to project/node_modules/node_modules) Info 5 Failed to load module: {} Info 6 Loading from (resolved to project/node_modules) Info 7 Failed to load module: {} ```
Bug
low
Critical
239,694,939
vscode
CLI proxy support
- VSCode Version: Code 1.13.1 (379d2efb5539b09112c793d3d9a413017d736f89, 2017-06-14T18:21:47.485Z) - OS Version: Windows_NT ia32 6.1.7601 - Extensions: none --- Steps to Reproduce: Without http.proxy set 1. run "code --install-extension HookyQR.beautify" in CLI 2. Error: getaddrinfo ENOTFOUND marketplace.visualstudio.com marketplace.visualstudio.com:443 at errnoException (dns.js:28:10) at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26) With 1. run "code --install-extension HookyQR.beautify" in CLI 2. result says "Found 'HookyQR.beautify' in the marketplace. Installing..." But it does not install. Please I need help . Thanks in advance ![extension](https://user-images.githubusercontent.com/11145777/27724739-e09a5ffc-5da5-11e7-8fe6-6f539cb5e86c.PNG) ![extension2](https://user-images.githubusercontent.com/11145777/27724751-f3425038-5da5-11e7-8f0a-bae203d0e4f2.PNG)
feature-request,proxy
low
Critical
239,770,733
opencv
VideoCapture::set (CAP_PROP_POS_FRAMES, frameNumber) not exact in opencv 3.2 with ffmpeg
Example and confirmed effect: http://answers.opencv.org/question/162781/videocaptureset-cap_prop_pos_frames-framenumber-not-exact-in-opencv-32-with-ffmpeg/
bug,priority: low,category: videoio,category: 3rdparty
low
Critical
239,811,810
go
math/big: underflow panic in roundShortest
```go f := new(big.Float).SetPrec(big.MaxPrec).SetFloat64(1) b := f.Append(nil, 'g', -1) ``` panics with the following stack trace: ``` panic: underflow goroutine 1 [running]: math/big.nat.sub(0x0, 0x0, 0x0, 0x104402c0, 0x0, 0x6, 0x180010, 0x1, 0x1, 0x0, ...) /usr/local/go/src/math/big/nat.go:129 +0x3e0 math/big.roundShortest(0x10429f38, 0x10429f90) /usr/local/go/src/math/big/ftoa.go:195 +0x1c0 math/big.(*Float).Append(0x10429f90, 0x0, 0x0, 0x0, 0x10429f67, 0xffffffff, 0x104340b0, 0x371f, 0x0, 0x1040a130) /usr/local/go/src/math/big/ftoa.go:97 +0x680 main.main() /tmp/sandbox082194187/main.go:11 +0xc0 ``` (https://play.golang.org/p/68rBsop-pW)
help wanted,NeedsFix
low
Major
239,812,209
TypeScript
HTMLCanvasElement.getContext() wrong typings when used with attributes.
<!-- BUGS: Please use this template. --> <!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript --> <!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md --> **TypeScript Version:** 2.4.1 **Code** ```ts declare const canvas: HTMLCanvasElement; //correct typing const gl1 = canvas.getContext('webgl', { preserveDrawingBuffer: true, depth: false }); // wrong typing for gl2 const attributes = { preserveDrawingBuffer: true, depth: false }; const gl2 = canvas.getContext('webgl', attributes); // If we copy HTMLCanvasElement.getContext() signatures it works function getContext2(contextId: '2d', contextAttributes?: Canvas2DContextAttributes): CanvasRenderingContext2D | null; function getContext2(contextId: 'webgl' | 'experimental-webgl', contextAttributes?: WebGLContextAttributes): WebGLRenderingContext | null; function getContext2(contextId: string, contextAttributes?: {}): CanvasRenderingContext2D | WebGLRenderingContext | null { return null; } // correct typing const gl3 = getContext2('webgl', attributes); ``` You can copy/paste that code on the playground to see it live (couldn't share: 'Text buffer too large to share'). **Expected behavior:** Typing of all `gl` var should be `WebGLRenderingContext`. **Actual behavior:** Typing for `gl2` is `Canvas2DContextAttributes | WebGLRenderingContext`. I wanted to try to resolve this by changing the typings but then I found out that if we copy the exact same signature it works as expected. So the typing indeed seem correct, dunno what's going on.
Bug
low
Critical
239,905,595
go
cmd/compile: add OpAMD64CMPptr and friends?
amd64.rules contains a fair number of rules that are conditional on config.PtrSize, to support amd64p32. See CL 46870 for a recent example. To reduce duplication, I suggest we add ops whose lowering depends on pointer size. So for example, instead of: ``` (IsInBounds idx len) && config.PtrSize == 8 -> (SETB (CMPQ idx len)) (IsInBounds idx len) && config.PtrSize == 4 -> (SETB (CMPL idx len)) ``` we would have only: ``` (IsInBounds idx len) -> (SETB (CMPptr idx len)) ``` where CMPptr is treated as CMPQ for amd64 and CMPL for amd64p32. Similarly so for other such duplicated rules. Opinions or objections, @randall77 @cherrymui?
NeedsDecision,compiler/runtime
low
Minor
239,909,828
go
testing: consider calling ReadMemStats less during benchmarking
https://golang.org/cl/36791 reduced the number of times benchmarks call ReadMemStats. However, the implementation was incorrect (#20590, #20863), and it was rolled back (https://golang.org/cl/46612 and https://golang.org/cl/47350). The rationale for the rollback is that ReadMemStats is now fast (https://golang.org/cl/34937). However, using tip as of June 30, 2017 (445652f45361d4935a828f394d7f0322faa6d9ad), cpuprofiling of package sort's benchmarks still shows almost half of all execution time in ReadMemStats. See [sort-cpu.pdf](https://github.com/golang/go/files/1116678/o.pdf). So for 1.10, either ReadMemStats should be made cheaper still, or we should re-roll https://golang.org/cl/36791 with a better implementation; see the initial patchsets of https://golang.org/cl/46612 for improvements. cc @bradfitz @aclements @meirf @ALTree
Performance,NeedsFix
medium
Major
239,935,161
opencv
Non-ASCII symbols in source code files
Example (marked by `--> <--`): ``` 202:In the figure below, the Delaunay-->’<<--s triangulation is marked with black lines and the Voronoi 856://! Guil, N., Gonz-->á<--lez-Linares, J.M. and Zapata, E.L. (1999). Bidimensional shape detection using an invariant approach. Pattern Recognition 32 (6): 1025-1038. 958: @param rect -->–<-- Rectangle that includes all of the 2D points that are to be added to the subdivision. ``` About 68 lines. Some files has BOM header again (64 files).
bug
low
Minor
239,949,568
go
cmd/compile: []byte(string) incurs allocation even when it does not escape
The following Go program reports that the function makes an allocation to do the string to []byte conversion, even though the compiler reports the conversion as non-escaping. https://play.golang.org/p/y2d2RiYqK5 It prints: 48 B/op 1 allocs/op Given that the compiler has marked it as non-escaping, I'd expect no allocations. go version devel +eab99a8 Mon Jun 26 21:12:22 2017 +0000 linux/amd64
Performance,help wanted,NeedsFix
low
Major
239,996,755
rust
Confusing error message: the trait `std::ops::Fn<(char,)>` is not implemented for `T`
Hey I am a newbie trying to learn rust following th rust-book(2nd edition). So, I was trying to implement the greps project and I am stuck at the search function. fn search<'a, T>(query: &T, contents: &'a str) -> Vec<&'a str> { let mut results = Vec::new(); for line in contents.lines() { if line.contains(query) { results.push(line); } } results } I am getting this error. : rustc 1.18.0 (03fc9d622 2017-06-06) error[E0277]: the trait bound `T: std::ops::Fn<(char,)>` is not satisfied --> <anon>:39:17 | 39 | if line.contains(query) { | ^^^^^^^^ the trait `std::ops::Fn<(char,)>` is not implemented for `T` | = help: consider adding a `where T: std::ops::Fn<(char,)>` bound = note: required because of the requirements on the impl of `std::ops::FnOnce<(char,)>` for `&T` = note: required because of the requirements on the impl of `std::str::pattern::Pattern<'_>` for `&T` error[E0277]: the trait bound `T: std::ops::FnOnce<(char,)>` is not satisfied --> <anon>:39:17 | 39 | if line.contains(query) { | ^^^^^^^^ the trait `std::ops::FnOnce<(char,)>` is not implemented for `T` | = help: consider adding a `where T: std::ops::FnOnce<(char,)>` bound = note: required because of the requirements on the impl of `std::str::pattern::Pattern<'_>` for `&T` error[E0277]: the trait bound `str: std::marker::Sized` is not satisfied --> <anon>:57:40 | 57 | assert_eq!(vec!["KAMEHAMEHA"], search(query, contents)); | ^^^^^^ the trait `std::marker::Sized` is not implemented for `str` | = note: `str` does not have a constant size known at compile-time = note: required by `search` error: aborting due to 3 previous errors Why do I need the Fn trait? And also adding that trait isn't solving my problem. I am using generics, and I know I don't really need generics here but I am trying to understand the topic. Rust-playground gist: https://play.rust-lang.org/?gist=ca11eb8e51982f63a61ff05c542ec0db&version=stable&backtrace=0
C-enhancement,A-diagnostics,T-compiler,D-confusing
low
Critical
240,010,284
flutter
Use a more resilient mechanism for showing the icons on the Icons page
The source code for `icons.dart` looks like this: ```dart /// <p><i class="material-icons md-36">4k</i> &#x2014; material icon named "4k".</p> static const IconData four_k = const IconData(0xe072, fontFamily: 'MaterialIcons'); /// <p><i class="material-icons md-36">ac_unit</i> &#x2014; material icon named "ac unit".</p> static const IconData ac_unit = const IconData(0xeb3b, fontFamily: 'MaterialIcons'); /// <p><i class="material-icons md-36">access_alarm</i> &#x2014; material icon named "access alarm".</p> static const IconData access_alarm = const IconData(0xe190, fontFamily: 'MaterialIcons'); ``` This HTML shows up in the IDE: ![Icons](https://user-images.githubusercontent.com/1078012/27770228-80f92dec-5f32-11e7-81b8-c5e018c54b1e.png) I don't know what's expected here - even if I was able to get the IDE tooltips to handle the HTML (though [the docs say](https://www.dartlang.org/guides/language/effective-dart/documentation#avoid-using-html-for-formatting) avoid HTML) the icons wouldn't render correctly because the CSS isn't being loaded in the tooltips.
framework,f: material design,d: api docs,c: proposal,P2,team-design,triaged-design
low
Major
240,013,824
flutter
Flutter tool fails to build on macOS if "gnu-tar" is installed
## Steps to Reproduce Follow the steps from the website: ``` $ git clone -b alpha https://github.com/flutter/flutter.git $ export PATH=`pwd`/flutter/bin:$PATH ``` Then, an error message is produced: ``` Building flutter tool... gzip: (stdin): trailing garbage ignored gzip: (stdin): trailing garbage ignored tar: Child returned status 1 tar: Error is not recoverable: exiting now gzip: (stdin): trailing garbage ignored gzip: (stdin): trailing garbage ignored Write failed (OS Error: Broken pipe, errno = 32), port = 0 ``` The fix was to uninstall gnu-tar from homebrew: `brew uninstall gnu-tar`. The version of tar from homebrew is much newer, so it's useful to have installed.
c: crash,tool,a: first hour,P2,team-tool,triaged-tool
low
Critical