Git Product home page Git Product logo

Comments (12)

twe4ked avatar twe4ked commented on May 12, 2024

Looks like this is a regression.

$ hexyl
┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐
^C
$ hexyl --version
hexyl 0.3.0
$ brew upgrade hexyl
==> Upgrading 1 outdated package:
hexyl 0.3.0 -> 0.6.0
==> Upgrading hexyl
==> Downloading https://homebrew.bintray.com/bottles/hexyl-0.6.0.mojave.bottle.1.tar.gz
==> Downloading from https://akamai.bintray.com/99/99a3133f73538f29f0dc2a603f122b2c2165fdd53de0f2141fc0ebab086c22f2?__gda__=exp=1581631705~hmac=3d6116586601720ea23e57ef75b254d0f67b4fe494e7be2d3aeb175112ad9eb7&response-content-disposition=atta
######################################################################## 100.0%
==> Pouring hexyl-0.6.0.mojave.bottle.1.tar.gz
🍺  /usr/local/Cellar/hexyl/0.6.0: 5 files, 704.3KB
Removing: /usr/local/Cellar/hexyl/0.3.0... (5 files, 1.2MB)
==> Checking for dependents of upgraded formulae...
==> No dependents found!
$ hexyl
^C^C^C^C

from hexyl.

Qyriad avatar Qyriad commented on May 12, 2024

This affects me on Linux as well. Kernel 5.5.3 (Arch Linux), Hexyl 0.6.0.

from hexyl.

twe4ked avatar twe4ked commented on May 12, 2024

Looks like it was broken here 1903047. The handler gets called but the cancelled never gets loaded if read doesn't return (AFAICT).

from hexyl.

secworks avatar secworks commented on May 12, 2024

Not very good at reading Rust, but as far as I understand the logic flow that seems like a correct analysis.

from hexyl.

sharkdp avatar sharkdp commented on May 12, 2024

@twe4ked Yes, that is correct. The handler doesn't work because we are in the blocking read call. This can easily be verified by pressing Ctrl-C and then Enter.

Simply reverting that commit would be an easy fix for this issue, but make the #35 situation worse. However, this bug here is much more relevant. #35 is a "cosmetic" thing only.

from hexyl.

bjorn3 avatar bjorn3 commented on May 12, 2024

libc::read will return EINTR when a signal handler was called. The read method for stdio and files in libstd loops until it doesn't return EINTR anymore. Try using the raw libc::read function.

from hexyl.

sharkdp avatar sharkdp commented on May 12, 2024

@bjorn3: Thank you!
It looks like setting SA_RESTART in sigaction(3) would also work?

I'm currently looking into the signal_hook crate...

from hexyl.

sharkdp avatar sharkdp commented on May 12, 2024

No, I guess that wouldn't work. Unsetting SA_RESTART would work if it wouldn't be caught explicitly.

from hexyl.

secworks avatar secworks commented on May 12, 2024

Any new status on this issue? I can perform testing on MacOS if that is needed.

from hexyl.

sharkdp avatar sharkdp commented on May 12, 2024

I did not find any solution with signal_hook and I would like to refrain from using unsafe features (callibg libc::read directly).

I'm going to remove the signal handler completely, for now. This will fix this issue.

from hexyl.

sharkdp avatar sharkdp commented on May 12, 2024

fixed in v0.7.0

from hexyl.

secworks avatar secworks commented on May 12, 2024

Cool!

from hexyl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.