sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: Tracking issue: platform-specific APIs for SGX target
Labels: T-lang,T-libs-api,B-unstable,C-tracking-issue,O-SGX,Libs-Tracked,S-tracking-design-concerns

This issue tracks the functionality available behind the `sgx_platform` feature gate.

Relevant PRs:
* #56978
* #57119

TODO:
* [ ] arch module
  * More details in https://github.com/fortanix/rust-sgx/issues/15
  * At the very least the `AlignXXX<[u8; _]>` types should be replaced by the actual types  (from the [`sgx-isa` crate](https://crates.io/crates/sgx-isa)). Concern: that would make `std` dependent on the `bitflags` crate.
* [ ] ffi module
  * No concerns
* [ ] io module
  * No concerns
* [ ] mem module
  * No concerns, but no evidence of real-world usage
* [ ] thread module
  * No concerns
* [ ] usercalls module
  * This is all pretty untested outside of std

For more information about the target, see https://edp.fortanix.com
Repository: node
Issue: regression: child_process stdin pipe close event not emitted
Labels: confirmed-bug,child_process,net,stream

### Summary
* **Version**: v8.12.0 and newer, all v10.x and all v11.x
* **Platform**: Linux and macOS amd64
* **Subsystem**: child_process

Since #18701 Node.js doesn't emit a close event when a child process closes its stdin pipe. The close is only detected if the parent tries to write to the child's stdin and receives an EPIPE.

The original behaviour is preferable because it allows immediate detection of the close event, rather than waiting for a failed write.

### Reproducer

This works as expected in v8.11.4 and fails in all newer versions of v8.x, as well as all v10.x and all v11.x.

```js
const {spawn} = require('child_process');

const cp = spawn(
    'node', [
        '-e',
        'fs.closeSync(0); setTimeout(() => {}, 2000)'
    ],
    {stdio: ['pipe', 'inherit', 'inherit']}
)

setTimeout(() => {
    console.log('BUGGY! stdin close event was not emitted')
    process.exit(1);
}, 1000);

cp.stdin.on('close', () => {
    console.log('Ok!')
    process.exit(0);
});
```

### Problem detail

As far as I can tell the only way the close event can be emitted is if the `Socket` constructor calls `this.read(0)`. This triggers `onStreamRead()` to be called, which does `stream.push(null)` and eventually results in the close event. This is a little weird because stdin isn't a readable stream :)

In Node 8.11.4 this worked because `child_process.js:createSocket()` called the `Socket` constructor with `options.readable === undefined`. So the `Socket` constructor sees that `options.readable !== false` and runs `this.read(0)`

In PR #18701 `createSocket()` was changed to call the `Socket` constructor with `options.readable === true`. This stops `this.read(0)` from being called and the close event is not emitted.

### Hacky solution

```diff
--- a/lib/internal/child_process.js
+++ b/lib/internal/child_process.js
@@ -286,3 +286,3 @@ function flushStdio(subprocess) {
 function createSocket(pipe, readable) {
-  return net.Socket({ handle: pipe, readable, writable: !readable });
+  return net.Socket({ handle: pipe, readable, writable: !readable, childProcess: true });
 }
--- a/lib/net.js
+++ b/lib/net.js
@@ -315,3 +315,5 @@ function Socket(options) {
   // buffer.  if not, then this will happen when we connect
-  if (this._handle && options.readable !== false) {
+  if (options.childProcess) {
+    this.read(0);
+  } else if (this._handle && options.readable !== false) {
     if (options.pauseOnCreate) {
```

This passes the full test suite with a minor change to `test-pipewrap.js`. I haven't raised a PR because I'm sure somebody could think of a better solution. If someone can point me in the right direction I'm happy to try and implement it.

Thanks :)
Repository: vscode
Issue: Microsoft Surface Precision Mouse - "Accelerated Vertical Scrolling" breaks smooth scroll
Labels: feature-request,windows,trackpad/scroll

<!-- Please search existing issues to avoid creating duplicates. -->
<!-- Also please test using the latest insiders build to make sure your issue has not already been fixed: https://code.visualstudio.com/insiders/ -->

<!-- Use Help > Report Issue to prefill these. -->
- VSCode Version: 1.30.1
- OS Version: Win 10 1809

Steps to Reproduce:

1. Use a Microsoft Surface Precision Mouse (I used it in bluetooth mode).
2. Activate `Accelerated Vertical Scrolling` in the *Microsoft  Mouse and Keyboard Cente* (it's enabled by default).
3. Scroll in vscode is not smooth anymore. Other applications like chrome are still smooth however.

![image](https://user-images.githubusercontent.com/9069888/50219991-438d8480-0391-11e9-9b3f-8da1c825d89d.png)

<!-- Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: **Yes**
Repository: go
Issue: syscall: modest improvement to Windows DLL-preloading protection
Labels: Security,OS-Windows,NeedsDecision,compiler/runtime

### What version of Go are you using (`go version`)?

<pre>
go version go1.11 windows/amd64
</pre>

### Does this issue reproduce with the latest release?

yes

### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Alex\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\MyGo
set GOPROXY=
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-LC:/winsdklibs64
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\Alex\AppData\Local\Temp\go-build831000242=/tmp/go-build -gno-record-gcc-switches
</pre></details>

### What did you do?

I'm looking into protecting my project from DLL-preloading attacks. Many of the vendored libraries I use use the syscall/windows LoadDLL call rather than the safer x/sys/windows LazySystemDLL method.

I note that syscall/windows LoadDLL has some limited protection for a preset list of system DLLs via sysdll.IsSystemDLL . However this is case-sensitive, when LoadLibrary etc. are case insensitive. Therefore:

`windows.LoadDLL("advapi32.dll")` is protected but `windows.LoadDLL("Advapi32.dll")` is not

A simple tweak would be to string.ToUpper in sysdll.Add and string.ToUpper in the check in LoadDLL
Repository: flutter
Issue: CupertinoTextField should not allow horizontal scrolling
Labels: a: text input,framework,a: fidelity,f: cupertino,c: proposal,P2,team-design,triaged-design

If you have a `CupertinoTextField` and you write a lot of text in it, so it doesn't fit and you need to scroll the text, then if you scroll horizontally in the `CupertinoTextField` you can actually scroll to different positions of the text. This is not possible in native Cupertino widgets. If you try to do the same thing in a Swift/Obj-C iOS app then you will see it is not possible, you can do this only by dragging the marker selectors.

## Steps to Reproduce

Any `CupertinoTextField` is like this. This is not something specific to an isolated case.


## Logs
```
[✓] Flutter (Channel stable, v1.0.0, on Mac OS X 10.14.1 18B75, locale en-RO)
    • Flutter version 1.0.0 at /Users/tudor/dev/flutter
    • Framework revision 5391447fae (3 weeks ago), 2018-11-29 19:41:26 -0800
    • Engine revision 7375a0f414
    • Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    • Android SDK at /Users/tudor/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = /Users/tudor/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_152-release-1136-b06)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.1, Build version 10B61
    • ios-deploy 1.9.4
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 29.1.1
    • Dart plugin version 181.5656
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[✓] Connected device (1 available)
    • Tudor’s iPhone 7 • 6c6f39c58d86256962f6a336f8ebef46f202225e • ios • iOS 12.1.2

• No issues found!
```
Repository: TypeScript
Issue: Confusing enum reverse string lookup behaviour in strict mode
Labels: Suggestion,Domain: Error Messages,Experience Enhancement

## Summary

Code below.

Typescript in --strict mode will reject enum reverse lookups using arbitrary strings with this very confusing error message:
> Element implicitly has an 'any' type because index expression is not of type 'number'.

A workaround is to cast the string to a subset of all possible enum keys but that's impractical with large enums (or is there an easy way to say "any key of enum X" in TS?).

*My real world use case: I have a react app with a `<select>` filter on various items, and a bunch of `<option>` values, all of which are part of an integer enum. I have to use the string representation in the dom, so the state of the filter has to be the string representation. When I check the item's enum value I already know it can only be one of those enum members.*

This report is three-fold:

1. Is this behaviour intended? There are cases where it can definitely catch a reverse lookup that can fail.
2. If it is intended, then what is the correct way to declare that the lookup will always be valid? `let typeFilter: "FOO" | "BAR" = "FOO"` is impractical and increases risk of errors.
3. **Regardless of the above, the error message should be fixed**. The element highlighted (`typeFilter`) does not in fact have an "any" type, and `Type[typeFilter]` will not be `any` either (in fact, `Type[typeFilter] as Type` does not fix it). An error such as "Reverse lookup on enum Type may fail because typeFilter is of type 'string'" is much clearer already.

## Details

**TypeScript Version:**  3.2.2

**Search Terms:** enum reverse string lookup

**Code**

```ts
// test.ts
// Compile with `tsc --strict test.ts`
export enum Type {
	FOO = 0,
	BAR = 1,
}

const Test = () => {
	// Change the following line to `let typeFilter: "FOO" | "BAR" = "FOO";` and it will work
	let typeFilter = "FOO";

	if (Type[typeFilter] != Type.FOO) {
		return;
	}
};

export default Test;
```

**Actual behavior:**
```
test.ts:9:11 - error TS7015: Element implicitly has an 'any' type because index expression is not of type 'number'.

9  if (Type[typeFilter] != Type.FOO) {
            ~~~~~~~~~~


Found 1 error.
```

**Playground Link:** [Playground](http://www.typescriptlang.org/play/#src=export%20enum%20Type%20%7B%0D%0A%09FOO%20%3D%200%2C%0D%0A%09BAR%20%3D%201%2C%0D%0A%7D%0D%0A%0D%0Aconst%20Test%20%3D%20()%20%3D%3E%20%7B%0D%0A%09let%20typeFilter%20%3D%20%22FOO%22%3B%0D%0A%0D%0A%09if%20(Type%5BtypeFilter%5D%20!%3D%20Type.FOO)%20%7B%0D%0A%09%09return%3B%0D%0A%09%7D%0D%0A%7D%3B%0D%0A%0D%0Aexport%20default%20Test%3B)

**Related Issues:** Maybe #27297
Repository: angular
Issue: State transition to void triggered for animated children while still existing in DOM
Labels: type: bug/fix,area: animations,freq2: medium,P3

# 🐞 bug report

### Affected Package
The issue is caused by package `@angular/animation` (any version)

### Description
1. There is an array of numbers
2. There is a parent container that generates multiple child items with a ngFor loop using that array.
3. Each item gets its number from the array assigned.
3. Every item has an animation attached to visualize active or inactive states. The parent container has an animation attached to coordinate staggering of the children.
4. When removing an item by modifying the array of numbers the item is removed.
5. This usually works and the item disappears (no animation involved)

When the array contains identical numbers and you remove one of the duplicate numbers you run into a problem. As expected this will cause remaining siblings to move to the left but you will get a list of "dead" components— but only from the animation perspective as the child animation have been transitioned to state void while remaining safe & sound in the DOM. I can reproduce this problem in a small stackblitz where I go into more details by referring to parts of the demo.

## 🔬 Minimal Reproduction
Preview:
https://animation-dom-move-bug.stackblitz.io/

Source:
https://stackblitz.com/edit/animation-dom-move-bug

## 🔥 Exception or Error
My small [stackblitz demo](https://stackblitz.com/edit/animation-dom-move-bug) shows the error and you can reproduce it perfectly:

**Do this:** Click on "remove 2" and you will see what's happening in this gif.

![bug](https://user-images.githubusercontent.com/1701755/50223899-b819f080-039c-11e9-9723-0427bf6377b6.gif)

Yellow stands for state void. You can see a yellow to green animation at the beginning of the gif loop that's the transition (void => active). After clicking the remove button you will see yellow items. I call them dead. Still in DOM but in state void. Just look at the all yellow numbers after you clicked the remove button. Also look into the console, you will see plenty of state transitions from active to void which is wrong.

## 🌍  Your Environment
**Angular Version:**
Latest Angular 7, see the stackblitz demo.

**Anything else relevant?**
Here some related issues I think
#23534
#26078
Repository: rust
Issue: Suggest type or module with similar name when code is incorrect
Labels: C-enhancement,A-diagnostics,T-compiler,A-suggestion-diagnostics,D-papercut

Given the following code:

```rust
use std::ffi::CString;

fn main() {
    let s = Cstring::new("hello").unwrap();
}
```

rustc gives me this output:

```
error[E0433]: failed to resolve: use of undeclared type or module `Cstring`
 --> main.rs:4:13
  |
4 |     let s = Cstring::new("hello").unwrap();
  |             ^^^^^^^ use of undeclared type or module `Cstring`

warning: unused import: `std::ffi::CString`
 --> main.rs:1:5
  |
1 | use std::ffi::CString;
  |     ^^^^^^^^^^^^^^^^^
  |
  = note: #[warn(unused_imports)] on by default

error: aborting due to previous error

For more information about this error, try `rustc --explain E0433`.
```

when it should give something like this:

```
error[E0433]: failed to resolve: use of undeclared type or module `Cstring`
 --> main.rs:4:13
  |
4 |     let s = Cstring::new("hello").unwrap();
  |             ^^^^^^^ did you mean `CString`?
```

<!-- TRIAGEBOT_START -->

<!-- TRIAGEBOT_ASSIGN_START -->

<!-- TRIAGEBOT_ASSIGN_DATA_START$${"user":"phansch"}$$TRIAGEBOT_ASSIGN_DATA_END -->

<!-- TRIAGEBOT_ASSIGN_END -->
<!-- TRIAGEBOT_END -->
Repository: node
Issue: Makefile dependency tree is incomplete, makefiles do not build only as necessary
Labels: confirmed-bug,build

* Version: master
* Platform:Linux samtu 4.18.0-12-generic #13-Ubuntu SMP Wed Nov 14 15:17:05 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
* Subsystem: gyp/make

The makefiles generated by gyp are not working for development (they work better for single-shot CI builds). Perhaps I'm missing something, please tell me if I am, but I've done some asking around to people who know the gyp system, and have some agreement on these points.

- `make node; make node` Make should do *nothing* if no source code has been changed, but `make node` relinks both `node` *and* `cctest` (!?) every time it is run.

- `make -C out node` is faster, ~but~ and builds just node, not cctest, but it does it even if no source has changed. However, its build/dependency tree is incomplete! It doesn't run js2c so if any js source files are changed they will not be built-in with js2c. Fast and wrong is worse than slow.

- `make -C out/Release node` as above

- ` make -j4 node; make -j1 test` often required. parallel make is not working for test. Various symptoms of brokenness occur (irc has some discussion). Sounds like this could be related to the dependency relationships not being correctly specified, causing build rules to run in parallel when they cannot, and thus be racy.

- `./configure --shared-openssl-includes` will cause openssl include paths to be passed to dependencies that don't use openssl. This might appear harmless, but it (for example) causes ccache to rebuild icu, even though icu doesn't use openssl. Possible fix: https://github.com/nodejs/node/blob/eef6504cf7b95ada170ec9878089ce57fde551d8/common.gypi#L549-L560, add `OPENSSL_THREADS` to the else clause (I haven't tried yet).


Ninja notes:

Ninja (`./configure --ninja`) doesn't have the above problems for building, its dependency tree is correct (it builds nothing when nothing has changed, and it reruns js2c when js files have changed).

However, it is either incomplete or not integrated with the rest of the build (I'm not sure how its intended to work). It doesn't make the top-level `node` symlink (at least `test-doc` relies on this), so a `ln -s out/Release/node node` is required for `make test-doc`. As for `make test`, it won't use the ninja build output, because it relies on .PHONY targets, so it always (effectively) does a `make -C out all`.
Repository: TypeScript
Issue: Async Transformers
Labels: Suggestion,API,Awaiting More Feedback

I was using Compiler API and basically changed program.emit at host.afterProgramCreate just like examples and hooked my transformers into emit function. But one thing i couldn't find anywhere is a async transformer. Im using PostCSS and some other stuff like that and implementing those to a single typescript compiler but some plugins are async in postcss and i cant use them at the moment. Is there any way to implement this that im missing or undocumented ? And in case somebody offers to use webpack my code is mostly javascript based and i need really good static analysis for it with type data included that's also reason i use typescript's api instead of using babel which have those cases mostly covered with plugins. I'm implementing all-in-one solution for my company/community project so ideally it needs to be inside typescript compiler.
Repository: godot
Issue: Default implicit and explicit values both return null from a ShaderMaterial
Labels: bug,confirmed,topic:shaders

Godot 3.0.6
Godot 3.1 alpha3

This is a variant of  #17887, that I thought was fixed by #21806:

In my plugin I want to display parameters in a dialog (so not the inspector), based on shader material parameters, however these come as null if they were never set through the material, forcing me to spend time re-implement a workaround to handle default values manually for each case. In 3.0.6 that workaround is particularly tedious to write because I need to iterate the param list and check all types. Also, `hint_range` comes as a single string to reparse and default values are inaccessible.

```gdscript
extends Node

func _ready():
	var mat = ShaderMaterial.new()
	mat.shader = load("res://test.shader")
	
	# This one has an explicit default value in the shader
	var explicit = mat.get_shader_param("explicit")
	# This one has an implicit default value (usually zero)
	var implicit = mat.get_shader_param("implicit")

	# Both print null
	print("Explicit: ", explicit)
	print("Implicit: ", implicit)
```

[ShaderMaterialDefaultValue.zip](https://github.com/godotengine/godot/files/2696691/ShaderMaterialDefaultValue.zip)

In 3.1, the workaround would be simpler:
```gdscript
static func _get_shader_param(mat, name):
	var v = mat.get_shader_param(name)
	if v != null:
		return v
	return VisualServer.material_get_param_default(mat.get_rid(), name)
```
However it still returns null in both cases, despite the values showing correctly if I do the same actions in the inspector.
Repository: flutter
Issue: Show a warning if gradle is about to crash because of non-ascii characters
Labels: c: new feature,tool,t: flutter doctor,t: gradle,P2,team-tool,triaged-tool

A gradle bug causes the gradle daemon to crash if there are non-ascii characters in any environment variable and the locale is not properly set (https://github.com/gradle/gradle/issues/3117).
We bumped into this issue a few times on CI (#24935).

It would be useful for the flutter tool to detect this state and show a warning.

Repro steps (makes gradle crash):

**WARNING this puts gradle in a bad state on my machine and my only way out of it was rebooting, try only if you have time to reboot 😄**

```bash
unset LANG
export SOME_ENV="א"
flutter build apk
```
Repository: pytorch
Issue: JIT is not compatible with data parallel
Labels: oncall: jit

## 🐛 Bug

JIT is not compatible with data parallel. So no one can train any model using more than one GPU. 
Data parallel is such a fundamental module. It makes the JIT totally unpractical for training (except toy models), even in 1.0 **stable** version.

## To Reproduce

Steps to reproduce the behavior:

1. Use resnet 18 script module from https://github.com/pytorch/pytorch/blob/0b219538cfb70503baa74053d3e827951e0ea6f9/test/test_jit.py#L5882-L5983
1. `model = torch.nn.DataParallel(model)`
1. Get the following error

> Traceback (most recent call last):
>   File "train.py", line 459, in <module>
>     main()
>   File "train.py", line 333, in main
>     train(train_loader, model, criterion, optimizer, epoch)
>   File "train.py", line 394, in train
>     output = model(input)
>   File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 489, in __call__
>     result = self.forward(*input, **kwargs)
>   File "/usr/local/lib/python3.6/dist-packages/torch/nn/parallel/data_parallel.py", line 142, in forward
>     replicas = self.replicate(self.module, self.device_ids[:len(inputs)])
>   File "/usr/local/lib/python3.6/dist-packages/torch/nn/parallel/data_parallel.py", line 147, in replicate
>     return replicate(module, device_ids)
>   File "/usr/local/lib/python3.6/dist-packages/torch/nn/parallel/replicate.py", line 31, in replicate
>     replica._parameters = replica._parameters.copy()
> AttributeError: 'OrderedParameterDict' object has no attribute 'copy'

If I firstly run `model = torch.nn.DataParallel(model)` for a nn.Module, then trace it, although the code runs, the loss doesn't decrease.

<!-- If you have a code sample, error messages, stack traces, please provide it here as well -->

## Expected behavior

The code runs and the model gets trained

## Environment

PyTorch version: 1.0.0
Is debug build: No
CUDA used to build PyTorch: 9.0.176

OS: Ubuntu 16.04.4 LTS
GCC version: (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609
CMake version: version 3.5.1

Python version: 3.6
Is CUDA available: Yes
CUDA runtime version: Could not collect
GPU models and configuration: 
GPU 0: Tesla P40
GPU 1: Tesla P40
GPU 2: Tesla P40

Nvidia driver version: 390.77
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.7.0.5
/usr/lib/x86_64-linux-gnu/libcudnn_static_v7.a

Versions of relevant libraries:
[pip] Could not collect
[conda] Could not collect


## Additional context

Related issue: #12875 

Data parallel is such a fundamental module, I can't imagine JIT is not compatible with it and no official programmer have tested it. It makes the JIT totally unpractical for training (except toy models)