sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: go
Issue: crypto/cipher: BlockMode and HSMs
Labels: NeedsInvestigation

I am a maintainer of a Go package which provides access to keys held in PKCS#11 HSMs to Go programs, using (as far as possible) native Go crypto APIs.

For asymmetric keys, this was a pleasant experience. It was straightforward to expose ECDSA keys via [crypto.Signer](https://golang.org/pkg/crypto/#Signer). The interface was obviously designed with HSMs in mind (and we appreciate the thought l-)

Currently I am adding support for symmetric keys. This can be made to work but certain operations are very slow, due to a mismatch between the PKCS#11 API and the Go [crypto/cipher](https://golang.org/pkg/crypto/cipher) APIs.

Specifically, to efficiently perform 'bulk' crypto operations, the PKCS#11 API requires a sequence of three calls:
1. `C_EncryptInit`
2. `C_EncryptUpdate` (any number of times)
3. `C_EncryptFinal`

Even if the mode in question does not produce any ciphertext in the call to `C_EncryptFinal`, it is necessary to call it in order to release resources.

However, `cipher.Block` and `cipher.BlockMode` provide no way for the caller to signal that they are finished. Essentially they lack a `Close` method. So an implementation of either of these interfaces that uses an HSM is not possible.

It is possible, of course, for a `cipher.Block` to encrypt a single block and clean up after itself (and this is what I've done). However using such an implementation from [cipher.NewCBCEncrypter](https://golang.org/pkg/crypto/cipher/#NewCBCEncrypter) can be _hundreds_ of times slower than an idiomatic PKCS#11-aware implementation.

My questions/requests in this issue are:
1. Is there any possibility of adding `Close()` methods to the existing `cipher.Block` and `cipher.BlockMode` interfaces?
2. Failing that is there any way for an implementation to detect that its object is no longer referenced and the underlying resources can be released? i.e. something analogous to, or attacking the same problem as, a C# finalizer?

See https://github.com/thalesignite/crypto11/issues/6 for additional information, although I believe I've captured everything relevant above.

### What version of Go are you using (`go version`)?

`go version go1.10.3 linux/amd64`

### Does this issue reproduce with the latest release?

Yes

### What operating system and processor architecture are you using (`go env`)?

```
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/rjk/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/rjk/go"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
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"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build914934708=/tmp/go-build -gno-record-gcc-switches"
```
Repository: TypeScript
Issue: Replace any by unknown in definition files
Labels: Suggestion,Awaiting More Feedback

Since the new `unknown` type was added, it makes sense to replace a lot (if not all) usage of `any` in the definition files with `unknown`. For example:

```typescript
Array.isArray(a: unknown): a is unknown[];
JSON.parse(a: string): unknown;
```

However, this change will cause many errors in projects currently using the fact that the returned types are not type-checked. This means that the change could be controversial.
Repository: go
Issue: cmd/go: cache not invalidated if testdata files are changed while the test is running
Labels: NeedsInvestigation

I was editing `cmd/go/testdata/mod_test.txt` for #26722, and saw an unexpected `(cached)` test result.

I run tests pretty aggressively while editing, so I suspect that I saved the file while a previous test run was in progress. We appear to have cached the result based on the contents of the `testdata` directory after the run completed, not the contents at the start of the run.

```
~/go/src$ go test cmd/go -run=TestScript
ok      cmd/go  (cached)

~/go/src$ GODEBUG=gocacheverify=1 go test cmd/go -run=TestScript
go test proxy starting
go test proxy running at GOPROXY=http://127.0.0.1:38657/mod
go proxy: no archive w.1 v1.2.0
go proxy: no archive x.1 v1.0.0
go proxy: no archive z.1 v1.2.0
go proxy: no archive golang.org/x/text/language 14c0d48
go proxy: no archive golang.org/x/text/language 14c0d48
go proxy: no archive golang.org/x/text/language 14c0d48
go proxy: no archive golang.org/x/text/foo 14c0d48
go proxy: no archive sub.1 v1.0.0
go proxy: no archive badsub.1 v1.0.0
go proxy: no archive versioned.1 v1.0.0
go proxy: no archive versioned.1 v1.1.0
--- FAIL: TestScript (0.00s)
    --- FAIL: TestScript/mod_test (1.28s)
        script_test.go:150:
            # A test in the module's root package should work. (1.107s)
            # A test with the "_test" suffix in the module root should also work. (0.171s)
            > cd ../b/
            $WORK/gopath/src/b
            > go test
            [stderr]
            build github.com/user/b_test: cannot find module for path github.com/user/b_test
            [exit status 1]
            FAIL: testdata/script/mod_test.txt:10: unexpected command failure

FAIL
FAIL    cmd/go  9.231s

~/go/src$ go test cmd/go -run=TestScript
ok      cmd/go  (cached)

~/go/src$ go version
go version devel +fc1a18c452 Fri Aug 3 11:36:32 2018 -0400 linux/amd64
```
Repository: go
Issue: x/build: add Fedora builder
Labels: help wanted,Builders,FeatureRequest,new-builder

We have a Debian-sid builder. Also add Fedora?

Would've helped with https://go-review.googlesource.com/c/go/+/127895 (for #26369)
Repository: rust
Issue: Allow destructuring parameters in trait function declarations
Labels: C-feature-request

The current syntax rules do not allow for trait functions to destructure parameters:
```
#![allow(unused)]

// This works
fn foo((x, y): (i32, i32)) {
}

trait Bar {
    // This does not work
    fn bar((x, y): (i32, i32));
}
```
[Playground](https://play.rust-lang.org/?gist=ce092e0146354cbbf09319117a706761&version=stable&mode=debug&edition=2015)
Compiling the above outputs this:
```
error: expected one of `)` or `,`, found `:`
 --> src/main.rs:7:18
  |
7 |     fn bar((x, y): (i32, i32));
  |                  ^ expected one of `)` or `,` here

error: expected one of `!`, `&&`, `&`, `(`, `)`, `*`, `<`, `?`, `[`, `_`, `dyn`, `extern`, `fn`, `for`, `impl`, `unsafe`, or lifetime, found `:`
 --> src/main.rs:7:18
  |
7 |     fn bar((x, y): (i32, i32));
  |                  ^ expected one of 17 possible tokens here

error[E0601]: `main` function not found in crate `playground`
  |
  = note: consider adding a `main` function to `src/main.rs`
```
The destructuring of trait function parameters should be allowed for consistency and readability.
Repository: rust
Issue: MetaItem fails to parse global paths
Labels: A-attributes,A-parser,T-compiler,C-bug

```rust
#[my_attr(::foo::bar)]
```
Does not parse as a `MetaItemKind::List` if the first element begins with a `::`. If you remove the leading `::` it parses correctly.
Repository: pytorch
Issue: [Caffe2] AVX not enabled for pytorch/caffe2
Labels: caffe2

## Issue description

1. pytorch's CMakeLists.txt and change Line 113
option(USE_NATIVE_ARCH "Use -march=native" ON)

2. Source code compilation of pytorch

export CMAKE_PREFIX_PATH=/Users/llv23/miniconda3
MACOSX_DEPLOYMENT_TARGET=10.13 CC=clang CXX=clang++ python setup.py install

also try with
cmake -DUSE_NATIVE_ARCH=ON ..
make install

3. run

python caffe2/python/examples/char_rnn.py --train_data shakespeare.txt

Orlando:examples llv23$ python char_rnn.py --train_data shakespeare.txt
If you are using homebrew leveldb on a Mac OS, you might see an error warning you that malloc_zone_unregister() failed. This is not a caffe2 issue but is due to the homebrew leveldb having an incompatible memory allocator. It does not affect usage.
E0804 13:32:58.712774 2730062720 init_intrinsics_check.cc:43] CPU feature avx is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
E0804 13:32:58.713579 2730062720 init_intrinsics_check.cc:43] CPU feature avx2 is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
E0804 13:32:58.713604 2730062720 init_intrinsics_check.cc:43] CPU feature fma is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
Input has 62 characters. Total input size: 99993
DEBUG:char_rnn:Start training
DEBUG:char_rnn:Training model
Characters Per Second: 3381
Iterations Per Second: 135
---------- Iteration 500 ----------

Both 2 cases, I meet with warning:

0804 13:32:58.712774 2730062720 init_intrinsics_check.cc:43] **CPU feature avx is present on your machine, but the Caffe2 binary is not compiled with it**. It means you may not get the full speed of your CPU.

## System Info

Orlando:utils llv23$ python collect_env.py 
Collecting environment information...
PyTorch version: 0.5.0a0+ed86405
Is debug build: No
CUDA used to build PyTorch: 9.2

OS: Mac OSX 10.13.6
GCC version: Could not collect
CMake version: version 3.11.3

Python version: 3.6
Is CUDA available: Yes
CUDA runtime version: 9.2.148
GPU models and configuration: Could not collect
Nvidia driver version: Could not collect
cuDNN version: Probably one of the following:
/usr/local/cuda/lib/libcudnn.7.dylib
/usr/local/cuda/lib/libcudnn.dylib
/usr/local/cuda/lib/libcudnn_static.a

Versions of relevant libraries:
[pip] Could not collect
[conda] pytorch                   0.4.0           py36_cuda0.0_cudnn0.0_1    pytorch
[conda] torch                     0.5.0a0+ed86405           <pip>
[conda] torch                     0.5.0a0+1b9d599           <pip>
[conda] torchvision               0.2.1                    py36_1    pytorch
Repository: godot
Issue: Line edits in settings config dialog resets cursor position on save.
Labels: bug,topic:editor,usability

**Godot version:**
3.1-dev


**OS/device including version:**
Fedora 28 64-bit


**Issue description:**
When typing into a line edit in the settings editor (such as "exec_flags" for external editor) and pause, the settings config dialog will call _settings_save and rebuild the UI causing the cursor to start at position 0. So, either type your thing very fast or prepare to be very annoyed.


**Steps to reproduce:**
Editor Settings -> Text Editor -> External type into exec_flags and wait for 1.5s.


** More info **
In 3.0.6 this is not the behaviour, perhaps because it only saves on close instead of on the 1.5 timeout? I much prefer save on close anyway, but if you have save every 1.5 seconds it's not a very good idea to rebuild the UI tree from scratch and updating it because it resets user interaction with the controls (such as cursor position while editing line text).

I also saw there was commented code for "ok" and "cancel" buttons, that sounds like a good idea to have for the settings.
Repository: flutter
Issue: Text/TextSpan superscript on top (like HTML ruby tag) for phonetic pronunciations
Labels: c: new feature,framework,engine,a: typography,P2,team-engine,triaged-engine

<!-- Thank you for using Flutter!

     Please check out our documentation first:
      * https://flutter.io/
      * https://docs.flutter.io/

     If you can't find the answer there, please consider asking a question on
     the Stack Overflow Web site:
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     Please don't file a GitHub issue for support requests. GitHub issues are
     for tracking defects in the product. If you file a bug asking for help, we
     will consider this a request for a documentation update.

-->
A ruby annotation in HTML:
``` 
<ruby>
漢 <rt> ㄏㄢˋ </rt>
</ruby> 
```
will produce a text that has a small text on top of it. Like this:
![screen shot 2018-08-04 at 7 16 13 pm](https://user-images.githubusercontent.com/14177437/43675542-e247b4e6-981c-11e8-9580-df924d6fa169.png)
[see more](https://www.w3schools.com/tags/tag_ruby.asp)

Basically, I need to display a paragraph that contains some words like this.
How can I archive this with Flutter?
Repository: flutter
Issue: fit: BoxFit.cover : gets applied to FadeInImage's placeholder
Labels: c: new feature,framework,P2,team-framework,triaged-framework

when i use fit: BoxFit.cover in FadeInImage.assetNetwork the BoxFit.cover gets applied to the image and the placeholder is that an Intended behaviour? Is it possible to apply it only to the image and not to the placeholder?

Flutter (Channel beta, v0.5.1, on Mac OS X 10.13.6 17G65, locale en-US)
Repository: godot
Issue: Calling base `_init` yields confusing error
Labels: enhancement,topic:gdscript,usability

Godot 3.0.6
Windows 10 64 bits

```gdscript
class Test:
	func _init(a, b, c, d):
		print("Test ", a, b, c, d)

class TestDerived extends Test:
	func _init(a, b, c, d):
		._init(a, b, c, d)
		print("TestDerived ", a, b, c, d)
```

Try instancing `TestDerived`, it will fail at calling the base `_init`:
```
SCRIPT ERROR: TestDerived._init: Invalid call to function '_init'. Expected 4 arguments.
```

EDIT
just saw that I'm supposed to use this instead:
http://docs.godotengine.org/en/3.0/getting_started/scripting/gdscript/gdscript_basics.html#class-constructor
Not sure why GDScript works in such a specific way for `_init`, but the error I got is very confusing.
Repository: neovim
Issue: teardown: race between options setup and exit_event
Labels: bug,test,event-loop

Sometimes the asan CI job fails like this (e.g. [here](https://github.com/neovim/neovim/pull/7813#issuecomment-380949586) and [here](https://github.com/neovim/neovim/pull/8088#issuecomment-376312511)):

```
= =================================================================
= ==16820==ERROR: AddressSanitizer: SEGV on unknown address 0x000001baab50 (pc 0x00000044f3a1 bp 0x000000000001 sp 0x7fff7ddb6a60 T0)
=     #4 0xfbfae4 in xfree /home/travis/build/neovim/neovim/build/../src/nvim/memory.c:134:3
=     #5 0x120e948 in free_string_option /home/travis/build/neovim/neovim/build/../src/nvim/option.c:2207:5
=     #6 0x120de3d in free_all_options /home/travis/build/neovim/neovim/build/../src/nvim/option.c:923:9
=     #7 0xfc2441 in free_all_mem /home/travis/build/neovim/neovim/build/../src/nvim/memory.c:622:3
=     #8 0x12bbe6c in mch_exit /home/travis/build/neovim/neovim/build/../src/nvim/os_unix.c:153:3
=     #9 0x1092cc3 in exit_event /home/travis/build/neovim/neovim/build/../src/nvim/msgpack_rpc/channel.c:542:5
=     #10 0xa6b2d3 in multiqueue_process_events /home/travis/build/neovim/neovim/build/../src/nvim/event/multiqueue.c:150:7
=     #11 0xa64e2f in loop_poll_events /home/travis/build/neovim/neovim/build/../src/nvim/event/loop.c:65:3
=     #12 0x12a4ec0 in os_breakcheck /home/travis/build/neovim/neovim/build/../src/nvim/os/input.c:162:5
...
=     #18 0x1379f20 in vim_regexec_both /home/travis/build/neovim/neovim/build/../src/nvim/regexp.c:7250:16
=     #19 0x137ac07 in vim_regexec_nl /home/travis/build/neovim/neovim/build/../src/nvim/regexp.c:7302:10
=     #20 0x910f2b in f_split /home/travis/build/neovim/neovim/build/../src/nvim/eval.c:15673:17
...
=     #41 0xcf8ff6 in apply_autocmds /home/travis/build/neovim/neovim/build/../src/nvim/fileio.c:6576:10
=     #42 0x1168c78 in normal_check_text_changed 
...
=     #46 0xea98a2 in main /home/travis/build/neovim/neovim/build/../src/nvim/main.c:566:3
```

Possible cause:

- `free_all_options` is free'ing something before it was alloc'd. 
    - ~~Options init isn't complete?~~ (No: init completed, `main.c` reached `normal_enter()`) 
- stdio RPC channel was closed (so `rpc_close` schedules `exit_event`)
    - was this because the client died from a invalid message?
-  `exit_event` is scheduled on `main_loop.fast_events`. 
    - would `main_loop.events` defer it? (**Edit:** yes, but it leads to hangs: https://github.com/neovim/neovim/pull/8814#issue-206215384)
    - Or do we need something like `stuffReadbuff(":qall!\n")`?
Repository: rust
Issue: Generalize StableHashingContext as a trait
Labels: C-enhancement,T-compiler,A-const-eval

### Background
PR #52475 improves the infinite loop detection algorithm during compile time evaluation, the algorithm relies on `HashStable` to detect whether two evaluation contexts are potentially identical as an optimization to avoid unnecessarily cloning the entire evaluation context.

### The Problem
The current implementation of `HashStable` throughout the compiler relies on a hashing context represented by `StableHashingContext`. This context however provides no way to resolve `AllocId`s to `Allocations`, so the implementation of `HashStable` for `AllocId` relies on the 
[global `TyCtxt::alloc_map`](https://github.com/rust-lang/rust/blob/master/src/librustc/ich/impls_ty.rs#L420), thus bypassing the current transient allocations in `Memory`. This has the inconvenient side effect of increasing the probability of hash conflicts, thus increasing the probability of unnecessarily cloning the evaluation context.

### The Solution

@oli-obk [suggested](https://github.com/rust-lang/rust/pull/52626#issuecomment-408854349) `StableHashingContext` could be generalized as a trait that could be implemented for `Memory`, which would provide a way to directly resolve `AllocId`s.
Repository: flutter
Issue: Material Stepper navigation customization
Labels: c: new feature,framework,f: material design,P3,team-design,triaged-design

There's no way to manipulate the "Continue" and "Cancel" buttons in Material Stepper. If the developer want to control Stepper navigation in another way, it's not possible to turn the default navigation on/off nor to hook into Continue and Cancel buttons to control its behavior.

I did a patch for a specific project, where I wanted to completely hide the buttons, but I'm wondering if it would be better to add more advanced controls, like letting it show both buttons or just one, and making this possible inside each Step, instead of making it default on or off for the Stepper.

This could work together with horizontal implementation and buttons customization mentioned in #11133

Any thoughts on this?
Repository: go
Issue: x/build/cmd/gopherbot: add author to issue notification comments
Labels: help wanted,Builders,NeedsFix,FeatureRequest

gopherbot generates the "CL mentions this issue" issue comments:

https://github.com/golang/build/blob/4639cd3919e4243a672a11a56543004bf1778326/cmd/gopherbot/gopherbot.go#L811

It currently includes a link to the CL and the CL title. It'd be nice if it also included the CL author's name or handle. Maybe: "Change `<link>` by `<author>` mentions this issue: `<title>`".
Repository: rust
Issue: Segfault in rustc while cross-compiling core
Labels: I-crash,T-compiler,O-NVPTX,C-bug

I'm trying to compile the kernel code from [japaric/nvptx](https://github.com/japaric/nvptx) to PTX. This requires cross-compiling the `core` crate. When I run the command to do this, `rustc` crashes with a segfault. I'm using `cargo-xbuild` because `xargo` doesn't seem to work anymore.

` cargo xbuild --target nvptx64-nvidia-cuda.json --verbose`

Output:

```
   Compiling core v0.0.0 (file:///home/brook/.rustup/toolchains/nightly-2018-04-10-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore)
     Running `rustc --crate-name core /home/brook/.rustup/toolchains/nightly-2018-04-10-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/lib.rs --crate-type lib --emit=dep-info,link -C opt-level=3 --sysroot /mnt/c/Users/Brook/workspace/nvptx/kernel/target/sysroot -Z force-unstable-if-unmarked -C metadata=4bb3cbb45694acfc -C extra-filename=-4bb3cbb45694acfc --out-dir /tmp/xargo.pCW5tJxxVfmO/target/nvptx64-nvidia-cuda/release/deps --target /mnt/c/Users/Brook/workspace/nvptx/kernel/nvptx64-nvidia-cuda.json -C incremental=/tmp/xargo.pCW5tJxxVfmO/target/nvptx64-nvidia-cuda/release/incremental -L dependency=/tmp/xargo.pCW5tJxxVfmO/target/nvptx64-nvidia-cuda/release/deps -L dependency=/tmp/xargo.pCW5tJxxVfmO/target/release/deps`
error: Could not compile `core`.

Caused by:
  process didn't exit successfully: `rustc --crate-name core /home/brook/.rustup/toolchains/nightly-2018-04-10-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/lib.rs --crate-type lib --emit=dep-info,link -C opt-level=3 --sysroot /mnt/c/Users/Brook/workspace/nvptx/kernel/target/sysroot -Z force-unstable-if-unmarked -C metadata=4bb3cbb45694acfc -C extra-filename=-4bb3cbb45694acfc --out-dir /tmp/xargo.pCW5tJxxVfmO/target/nvptx64-nvidia-cuda/release/deps --target /mnt/c/Users/Brook/workspace/nvptx/kernel/nvptx64-nvidia-cuda.json -C incremental=/tmp/xargo.pCW5tJxxVfmO/target/nvptx64-nvidia-cuda/release/incremental -L dependency=/tmp/xargo.pCW5tJxxVfmO/target/nvptx64-nvidia-cuda/release/deps -L dependency=/tmp/xargo.pCW5tJxxVfmO/target/release/deps` (signal: 11, SIGSEGV: invalid memory reference)
error: `"cargo" "rustc" "-p" "core" "--release" "--manifest-path" "/tmp/xargo.pCW5tJxxVfmO/Cargo.toml" "--target" "nvptx64-nvidia-cuda.json" "-v" "--" "--sysroot" "/mnt/c/Users/Brook/workspace/nvptx/kernel/target/sysroot" "-Z" "force-unstable-if-unmarked"` failed with exit code: Some(101)
note: run with `RUST_BACKTRACE=1` for a backtrace
```

The important bit is: `(signal: 11, SIGSEGV: invalid memory reference)`. I've tried this under Windows, WSL and MINGW (as well as a second machine running Arch Linux), it's completely consistent.

Version: `cargo 1.29.0-nightly (15433e8cc 2018-08-02)` (I have also seen a similar crash with 2018-04-04).

I've tried to build a version of rustc with debug symbols so that I could collect more information, but have been unable to get a working build.
Repository: scrcpy
Issue: Ninja build fails when server build folder is globally overriden
Labels: build

There is possibility to set build directory for gradle projects globally so build artifacts may be stored in other place. (see project.buildDir from https://docs.gradle.org/current/userguide/writing_build_scripts.html). As result path to server apk file  in server/scripts/build-wrapper.sh script is invalid.

Reproduction
1. Set global build dir for gradle (in init.gradle)
```
def configProject(p, buildDir) {
    p.buildDir = "${buildDir}/${p.name}"  
    p.subprojects { s ->
        configProject(s, "${p.buildDir}")
    }
}

def buildDir = 'YOUR_BUILD_PATH'
if (!buildDir?.trim()) {
    buildDir = "build"
}

gradle.projectsLoaded {
    if (ext.has("group")) {
        buildDir += "/${ext.group}"
    }
    configProject(rootProject, buildDir)
}
```
2. Run ninja build and observe

I know that this is not typical user case but still should be handled.