sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: opencv
Issue: Android CameraGLRenderBase/CameraGLSurfaceView crash on application pause/exit due to invalid EGL context.
Labels: bug,platform: android

##### System information (version)
- OpenCV => 3.4.1
- Operating System / Platform => Windows 64 Bit
- Compiler => Android Studio 3.1 (Clang NDK 16)

##### Detailed description

My Android activity creates a GL surface view that derives from CameraGLSurfaceView. During execution everything works as expected, but when I switch to another running app, forcing the activity to pause, the activity crashes. Logcat indicates that a thread was trying to work with an EGL context that didn't exist.

##### Steps to reproduce

1. Using Android Studio, create an Android app based on [OpenCV Android Tutorial 4]( https://github.com/opencv/opencv/blob/master/samples/android/tutorial-4-opencl/src/org/opencv/samples/tutorial4/MyGLSurfaceView.java).

1. Install and run the app on your phone.

1. Use Android Studio's Logcat view to inspect the applications log while it executes.

1. Press the Android app switching button.

1. Your list of running applications appear.

1. After a few short moments, your app crashes.

1. Verify with Logcat that an EGL context error occurred.

##### Fix

The crash is caused by trying to access the EGL context from different threads. It happens in CameraGLRenderBase's updateState method. It typically calls doStart in the correct thread (the GLThread), but doStop sometimes gets called from the main thread. The solution entails doing proper thread management.

To solve the problem, the code can be changed in the following ways (using Kotlin in this example):

1. CameraGLRenderBase: 

   ```.kt
    @MainThread
    @Synchronized
    fun enableView() {
        mEnabled = true
        mView.queueEvent( { updateState() } ) // this is the fix
    }
    ...
    @MainThread
    @Synchronized
    fun disableView() {
        mEnabled = false
        mView.queueEvent( { updateState() } ) // this is the fix
    }
    ...
    @WorkerThread
    protected fun updateState() {
        ... // keep body as is
    }

    @WorkerThread
    @Synchronized
    protected open fun doStart() {
        ... // keep body as is
    }

    @WorkerThread
    protected open fun doStop() {
        ... // keep body as is
    }
    ...
    @MainThread
    fun onPause() {
        mHaveSurface = false
        mView.queueEvent( { updateState() } ) // this is the fix
        mCameraHeight = -1
        mCameraWidth = mCameraHeight
    }
    ...
    @WorkerThread
    override fun onSurfaceChanged(gl: GL10, surfaceWidth: Int, surfaceHeight: Int) {
        ... // keep body as is
    }
   ```

1. CameraGLSurfaceView.java: Call setCameraIndex after setRenderer is called. This will satisfy the conditions for the mView.queueEvent function.
Repository: rust
Issue: Keeping references to #[thread_local] statics is allowed across yields.
Labels: C-enhancement,P-medium,A-borrow-checker,T-compiler,I-unsound,A-coroutines,F-coroutines,requires-nightly,F-thread_local,S-bug-has-test

*This does not affect stabilization of `async fn` unless `#[thread_local]` is also stabilized*

[Try on playground](https://play.rust-lang.org/?gist=8cf0763bd1ca6107622592a751c565d0&version=nightly):
```rust
#![feature(generators, generator_trait, thread_local)]

use std::ops::Generator;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::thread;

#[thread_local]
static FOO: AtomicUsize = AtomicUsize::new(0);

fn foo() -> impl Generator<Yield = (String, usize), Return = ()> {
    static || {
        let x = &FOO;
        loop {
            let s = format!("{:p}", x);
            yield (s, x.fetch_add(1, Ordering::SeqCst));
        }
    }
}

fn main() {
    unsafe {
        let mut g = thread::spawn(|| {
            let mut g = foo();
            println!("&FOO = {:p}; resume() = {:?}", &FOO, g.resume());
            g
        }).join().unwrap();
        println!("&FOO = {:p}; resume() = {:?}", &FOO, g.resume());
        thread::spawn(move || {
            println!("&FOO = {:p}; resume() = {:?}", &FOO, g.resume());
        }).join().unwrap();
    }
}
```
Sample output:
```
&FOO = 0x7f48f9bff688; resume() = Yielded(("0x7f48f9bff688", 0))
&FOO = 0x7f48fafd37c8; resume() = Yielded(("0x7f48f9bff688", 1))
&FOO = 0x7f48f9bff688; resume() = Yielded(("0x7f48f9bff688", 0))
```
You can see by the pointer addresses and values inside `FOO` that the same location was reused for the second child thread (it's a bit harder to show a crash) - this is clearly an use-after-free.
If we had in-language `async`, the same problem could be demonstrated using those.

In non-generator functions, such references have function-local lifetimes and cannot escape.
With the stable `thread_local!` from `libstd`, user code gets access to the reference in a (non-generator/async) closure, which also doesn't allow escaping the reference.

cc @alexcrichton @withoutboats @Zoxc
Repository: material-ui
Issue: [Accordion] Mobile performance
Labels: performance,component: Collapse,component: accordion

<!--- Provide a general summary of the issue in the Title above -->

On Mobile Devices the Expansion Panel is rather slow/feels sluggish when opening/closing it.

<!--
    Thank you very much for contributing to Material-UI by creating an issue! ❤️
    To avoid duplicate issues we ask you to check off the following list.
-->

<!-- Checked checkbox should look like this: [x] -->
- [X] I have searched the [issues](https://github.com/mui-org/material-ui/issues) of this repository and believe that this is not a duplicate.

## Expected Behavior
<!---
    If you're describing a bug, tell us what should happen.
    If you're suggesting a change/improvement, tell us how it should work.
-->

When i open/close an expansion panel on a mobile device, then the open/close animation for the expansion panel should be fluid and not sluggish.

## Current Behavior
<!---
    If describing a bug, tell us what happens instead of the expected behavior.
    If suggesting a change/improvement, explain the difference from current behavior.
-->

When i open/close an expansion panel on a mobile device, then the animation of opening/closing the control should be fluid/feel fluid

## Steps to Reproduce (for bugs)
<!---
    Provide a link to a live example (you can use codesandbox.io) and an unambiguous set of steps to reproduce this bug.
    Include code to reproduce, if relevant (which it most likely is).

    This codesandbox.io template _may_ be a good starting point:
    https://codesandbox.io/s/github/mui-org/material-ui/tree/v1-beta/examples/create-react-app


    If YOU DO NOT take time to provide a codesandbox.io reproduction, should the COMMUNITY take time to help you?

-->

1. Simply visit https://material-ui.com/demos/expansion-panels/ on a mobile device and open/close an expansion panel, then you should be able to see it yourself
2. I also tested the expansion panel of https://material.angular.io/components/expansion/overview on my mobile phone there i don't have the problem that the open/close animation is slow/sluggish

## Context
<!---
    How has this issue affected you? What are you trying to accomplish?
    Providing context helps us come up with a solution that is most useful in the real world.
-->

Currently this issue affects mobile users of material ui.

## Your Environment
<!--- Include as many relevant details about the environment with which you experienced the bug. -->

| Tech         | Version |
|--------------|---------|
| Material-UI  | v1.0.0-beta.40  |
| React        |  16.3.0 |
| browser      |  Mobile Chrome |
| Mobile Device          | Huawei P10 |

### Benchmarks

- https://www.stefanjudis.com/snippets/how-to-animate-height-with-css-grid/
Repository: rust
Issue: rustdoc: transitive Drop indicators should be shown
Labels: T-rustdoc,C-enhancement,A-destructors

A type can contain types implements `Drop` but doesn't implement Drop itself; I'll call this "transitive Drop" below.

Such types doesn't explicitly implement drop, but still have destructors run. We should indicate this in some way; for example, `Drop` has a meaning in futures (cancellation), but we can't see that currently through the docs; documenting transitive Drop will help the understanding.
Repository: TypeScript
Issue: In JS, multiple prototype assignments give duplicate identifier error
Labels: Bug,Domain: JavaScript

```js
function A() {
    this.x = 1
}
function Am(n) { }
if (!!!true) {
    A.prototype.m = Am
}
else {
    A.prototype.m = function() { }
}
```

**Expected behavior:**
Multiple assignments should be allowed, but there should a type error on the second assignment because the types of `m` do not match.

**Actual behavior:**
Duplicate identifier error on both declarations of `m`.
Repository: nvm
Issue: What is NVM? in README.md for newbies
Labels: informational

I was just thinking there should be a link to an article or website that explains what NVM is, why use NVM, example use cases for NVM, description of all NVM terminology, etc.

I have found the following links to assist with this but it would definitely be best coming from one of the core developers and/or core contributors. 

- Using Node Version Manager (NVM) to Manage Multiple Node.js Versions - http://codetheory.in/using-node-version-manager-nvm-to-manage-multiple-node-js-versions/
- Managing Node.js Versions with nvm - https://davidwalsh.name/nvm
- Installing Node.js Using Node Version Manager (nvm) - https://medium.com/@richardkall/installing-node-js-using-node-version-manager-nvm-c21546a613bc
- Comprehensive Node Version Manager (NVM) Tutorial - https://www.keycdn.com/blog/node-version-manager/
- How to Install NVM (Node Version Manager) for Node.js on Ubuntu 12.04 LTS - https://www.liquidweb.com/kb/how-to-install-nvm-node-version-manager-for-node-js-on-ubuntu-12-04-lts/
Repository: rust
Issue: `extern type` cannot support `size_of_val` and `align_of_val`
Labels: C-enhancement,T-lang,disposition-merge,finished-final-comment-period

Based on discussion on https://github.com/rust-lang/rust/issues/43467 and in @rust-lang/lang meetings, an opaque `extern type` type cannot support `size_of_val` or `align_of_val`. We believe that we should panic or abort in this case. We also believe that we should have a compile-time lint that detects this whenever possible, since at some level the compiler should know at compile time if code invokes `size_of_val` or `align_of_val` on an `extern type`.

I've opened this separate issue to document that decision, and will propose FCP on it to give time for final comments.
Repository: go
Issue: cmd/objdump: symbolization of global variable doesn't work for shared objects
Labels: help wanted,NeedsInvestigation,compiler/runtime

### What operating system and processor architecture are you using (`go env`)?
darwin/amd64

### What did you do?
```
package main

var X int

//go:noinline
func F() { X = 5 }

func main() { F() }
```

```
$ go build p
$ go tool objdump -s "\.F$" p 
TEXT main.F(SB) /tmp/p2/src/p/p.go
  p.go:6		0x104b3a0		48c7050553070005000000	MOVQ $0x5, main.X(SB)	
  p.go:6		0x104b3ab		c3			RET			
  :-1			0x104b3ac		cc			INT $0x3		
  :-1			0x104b3ad		cc			INT $0x3		
  :-1			0x104b3ae		cc			INT $0x3		
  :-1			0x104b3af		cc			INT $0x3
```
The address of global variable is symbolized (`main.X(SB)`), which is nice.

But this is not correct for shared objects, e.g. plugin:
```
$ go build -buildmode=plugin p
$ go tool objdump -s "\.F$" p.so 
TEXT _p.F(SB) /tmp/p2/src/p/p.go
  p.go:6		0x44670			4c8b3dc1090000		MOVQ __cgo_yield+200(SB), R15	
  p.go:6		0x44677			49c70705000000		MOVQ $0x5, 0(R15)		
  p.go:6		0x4467e			c3			RET				
  :-1			0x4467f			cc			INT $0x3
```

Note the `__cgo_yield+200(SB)`, which should actually be X in the GOT, like what `compile -S` prints
```
	0x0000 00000 (/tmp/p2/src/p/p.go:6)	MOVQ	"".X@GOT(SB), R15
	0x0007 00007 (/tmp/p2/src/p/p.go:6)	MOVQ	$5, (R15)
```

cc @aarzilli
Repository: tensorflow
Issue: [feature] js_func (for javascript) equivalent of py_func
Labels: stat:awaiting tensorflower,type:feature

### System information
- **Have I written custom code (as opposed to using a stock example script provided in TensorFlow)**:
n/a
- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**:
iOS, Android
- **TensorFlow installed from (source or binary)**:
n/a
- **TensorFlow version (use command below)**:
n/a
- **Python version**: 
n/a
- **Bazel version (if compiling from source)**:
n/a
- **GCC/Compiler version (if compiling from source)**:
n/a
- **CUDA/cuDNN version**:
n/a
- **GPU model and memory**:
n/a
- **Exact command to reproduce**:
n/a

### Describe the problem
I suggest adding a `js_func` that allows defining nodes in javascript. This would be similar to the existing `py_func`. There are many systems (ie iOS and Android) that have JS runtimes but do not have python runtimes.
Repository: vscode
Issue: Launch task directly into split terminal
Labels: feature-request,api,tasks,api-finalization

Issue Type: <b>Feature Request</b>

The integrated terminal split panes should support launching a task from the command palette into a split terminal panel. 

Here is the current workflow
1. Launch a long-running task from command palette by typing `ctrl+p -> task first-watcher-task -> enter`. (A new terminal window appears, running the task).
2. Click the split terminal button to create a split terminal.
3. In the split terminal, type the arguments for the second task and run it by pressing the enter key in the terminal. Can't run  `ctrl+p -> task second-watcher-task -> enter` because that would open a whole new terminal section of its own.

Here is the desired workflow
1. Launch a long-running task from command palette by typing `ctrl+p -> task some-watcher-task -> enter`. (A new terminal window appears, running the task).
2. Launch the second long-running task from comand palette by typing `ctrl+p -> task second-watcher-task -> enter`. Somehow, this task runs in a second panel of the split terminal, based on some extra command, a task configuration setting, or perhaps by having focus in an already opened split terminal.

VS Code version: Code - Insiders 1.22.0-insider (81335051b2d1460112905c2bce23c205e7cdd231, 2018-04-03T01:09:54.914Z)
OS version: Windows_NT x64 6.1.7601


<!-- generated by issue reporter -->
Repository: TypeScript
Issue: Cannot Load Custom Definition File in Repository
Labels: Suggestion,Help Wanted,Good First Issue,Domain: Error Messages,PursuitFellowship


<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
**TypeScript Version:**  2.8.1

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:** Definition File, Ambient type
**Detail**
I am importing a JavaScript library that doesn't have any definition file. I want to create a custom definition file that I place in my repository. I want TypeScript to read this definition file.

I have tried many combination of tsconfig.json (typeRoot, include, path, baseUrl, etc.) Without being successful. I also moved the definition folder under `src`, and renamed the definition file to index.d.ts (inside a folder with the name of the library) without any success.

**Code**
Small complete repro here: https://github.com/MrDesjardins/importdefinitionfiles

```ts
// main.ts:
import MessageFormat from "messageformat"; // Doesn't have type
// messageformat.d.ts:
declare module messageformat {
    export type Msg = (params: {}) => string;
    export interface MessageFormat {
        new(message: string): any;
        compile: (messageSource: string) => Msg;
    }
}
```

**Expected behavior:** TypeScript to find the definition file and to use it without having a compilation error.

**Actual behavior:** Error message
``` 
Could not find a declaration file for module 'messageformat'. '/Users/pdesjardins/code/perso/importdefinitionfiles/node_modules/messageformat/lib/messageformat.js' implicitly has an 'any' type.
  Try `npm install @types/messageformat` if it exists or add a new declaration (.d.ts) file containing `declare module 'messageformat';`

1 import MessageFormat from "messageformat";
``` 
**Playground Link:** https://github.com/MrDesjardins/importdefinitionfiles

**Related Issues:**
Repository: TypeScript
Issue: Support locally scoped type alias nodes
Labels: Suggestion,In Discussion

We mentioned this at a previous design meeting while discussing conditional types but I don't think an issue was opened for it (nor can I find mention of it within some design meeting notes). We think it'd be useful for both conditional types (to make a bare type reference/parameter) and in complex types (to reduce duplication) to enable a kind of type-alias-as-a-type-node syntax. Something that allows rewriting code like this:

```ts
type Foo<T, K extends string, TVal extends T[K] = T[K]> = TVal extends string ? {x: TVal} : never;
```

as

```ts
type Foo<T, K extends string> = type TVal = T[K] in TVal extends string ? {x: TVal} : never;
```

or

```ts
type MyBox<T, K extends keyof T = keyof T, TVal extends T[K] = T[K]> = {
  host: T,
  getValue(k: K): TVal,
  setValue(k: K, v: TVal): TVal
};
```

as

```ts
type MyBox<T> = type K = keyof T, TVal = T[K] in {
  host: T,
  getValue(k: K): TVal,
  setValue(k: K, v: TVal): TVal
};
```

this allows elision of unnecessary information (no need to write both a constraint and identical default), and prevents usages from accidentally providing an extra type parameter when they shouldn't (because the defaulted parameter was used effectively as a const). I believe @bterlson had mentioned wanting something like this in-person, too.

As for proposed syntax, I'd say:

* A `LocalTypeAlias` is a `TypeNode` (so is valid anywhere a `TypeNode` is).
* A `LocalTypeAlias`  is parsed as a required `type` keword, then a comma separated list of `LocalTypeAliasAssignment`s (with at least one element) - the type assignment list, followed by `in` and an arbitrary `TypeNode` - the subject of the assignments.
* A `LocalTypeAliasAssignment` is an `Identifier` followed by `=` followed by a `TypeNode`. (does this need to be restricted to parse in a human-understandable way?)

For semantics:
* A `LocalTypeAlias` is a local scope around its subject type node. It binds a declaration for a type parameter for each identifier in each assignment in its type alias assignment list, constrained to the assigned value, and establishes a `TypeMapper` to map those type parameters to their assigned value as well (similar to an instantiated generic type alias). (Should they be allowed to be mutually referential? Other parameter lists are, so I don't see why not.) These aliases are made to be type parameters (and not raw aliases like a nongeneric type alias declaration) so they interact favorably with conditional types - eg, they are a way to force a conditional type to iterate over a union for any type node without introducing another top-level alias.

Thoughts?
Repository: pytorch
Issue: [feature request] Include libomp support (macOS)
Labels: module: build,triaged,module: macos

The standard way to link OpenMP while using Apple Clang on macOS seems to be by using [libomp](https://openmp.llvm.org/), which is a bottle available in [brew](https://github.com/Homebrew/homebrew-core/blob/master/Formula/libomp.rb). Apple doesn't seem to include libomp in their version of the compiler, but this bottle fixes that. It seems as though CMake does not pick up  libomp however, even when following the instructions in the formula. It could be an error on my side however. This [guide](https://iscinumpy.gitlab.io/post/omp-on-high-sierra/) might also be of interest. 


cc @malfet @seemethere @walterddr
Repository: vscode
Issue: Make telemetry Data opt-in
Labels: under-discussion

<!-- Do you have a question? Please ask it on https://stackoverflow.com/questions/tagged/vscode. -->

<!-- Use Help > Report Issue to prefill these. -->
- VSCode Version: 1.22.1
- OS Version: Windows 10

Steps to Reproduce:

1. Start VS Code 1.22.1 for the first time
2. Now a notification pops up that tells me, that telemetry data is collected and I can opt-out

<!-- Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes

1. I am not sure about this but I don't think collecting telemtry data by default will conform to the General Data Protection Regulation of the EU that becomes effective in May 2018. It would be better to disable it per default and tell the user to enable it if he want's to share data with you.

2. When I checked the privacy policy linked in the notification popup (https://privacy.microsoft.com/en-us/privacystatement) I can't find anything about the data collected by vs code. This is a very important information. This can be a big showstopper for using vscode in some companies, wen data is sent and nobody knows what data this is.
Repository: flutter
Issue: How to write custom ImageFilters?
Labels: c: new feature,framework,engine,a: images,P2,team-engine,triaged-engine

I'm interested in writing custom ImageFilters as a possible approach to a photo filter application, as well as other possible use-cases.

I see that the current options for ImageFilter are bounded and that they're implemented in native land.

Is it even possible to write new ImageFilters, either in Dart or on the native side?  If so, are there any resources to help figure out how to do that?
Repository: flutter
Issue: flutter install -d all doesn't work to install on all devices even tho it says to.
Labels: c: new feature,tool,a: quality,P3,team-tool,triaged-tool

```
$ flutter devices
2 connected devices:

KFSUWI                    • G000NQ0373110E58 • android-arm64 • Android 5.1.1 (API 22)
Android SDK built for x86 • emulator-5554    • android-x86   • Android P (API 27) (emulator)

$ flutter install
More than one device connected; please specify a device with the '-d <deviceId>' flag, or use '-d all' to act on all devices.

KFSUWI                    • G000NQ0373110E58 • android-arm64 • Android 5.1.1 (API 22)
Android SDK built for x86 • emulator-5554    • android-x86   • Android P (API 27) (emulator)
No target device found

$ flutter install -d all
More than one device connected; please specify a device with the '-d <deviceId>' flag.

KFSUWI                    • G000NQ0373110E58 • android-arm64 • Android 5.1.1 (API 22)
Android SDK built for x86 • emulator-5554    • android-x86   • Android P (API 27) (emulator)
No target device found
```

This was on windows with an emulator and an amazon fire