Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examples/unixfs-file-cid: io.Copy is never completed when read a single char-filled contents #430

Open
tmrkw1497 opened this issue Aug 14, 2023 · 1 comment
Assignees
Labels
kind/bug A bug in existing code (including security flaws) need/analysis Needs further analysis before proceeding P1 High: Likely tackled by core team if no one steps up

Comments

@tmrkw1497
Copy link

I modified unixfs-file-cid example program so that it could distribute files instead of strings. And, I try to distribute any files with a modified example program. When I try to do it with the same char-filled file (e.g. 0x00, 0x01 filled), the sample receiver program had never completed. In the same program, I can distribute random chars-filled files.

Expected Behavior

I can download and display the same char-filled file.

Current Behabior

io.Copy is never complete.

if _, err := io.Copy(&buf, f); err != nil {

steps to reproduce

$ git clone https://github.com/ipfs/boxo.git
$ cd boxo/examples
$ vim unixfs-file-cid/main.go # edit code
$ go run unixfs-file-cid/main.go

other terminal

$ cd boxo/examples
$ go run unixfs-file-cid/main.go -d "peer address"

I modified it.
https://github.com/ipfs/boxo/blob/main/examples/unixfs-file-cid/main.go#L145-L149

fileReader,err:= os.Open("file path")
if err!=nil{
return cid.Undef, nil, err
}

cid should be changed.

const fileCid = "bafybeiecq2irw4fl5vunnxo6cegoutv4de63h7n27tekkjtak3jrvrzzhe"

I made file this command (the file should be of some size)

$ dd if=/dev/zero of="file path" bs=1G count=1

Environment

  • go version go1.19.12 linux/amd64
  • ubuntu 22.10
  • use boxo which was pulled from master branch (v.0.11.0)
@tmrkw1497 tmrkw1497 added the need/triage Needs initial labeling and prioritization label Aug 14, 2023
@welcome
Copy link

welcome bot commented Aug 14, 2023

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

@aschmahmann aschmahmann added need/analysis Needs further analysis before proceeding P1 High: Likely tackled by core team if no one steps up kind/bug A bug in existing code (including security flaws) and removed need/triage Needs initial labeling and prioritization labels Aug 21, 2023
@aschmahmann aschmahmann self-assigned this Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) need/analysis Needs further analysis before proceeding P1 High: Likely tackled by core team if no one steps up
Projects
No open projects
Status: No status
Development

No branches or pull requests

2 participants