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

panic: strings: negative Repeat count on HMR #440

Closed
2 tasks done
JamesPHoughton opened this issue Nov 16, 2023 · 1 comment
Closed
2 tasks done

panic: strings: negative Repeat count on HMR #440

JamesPHoughton opened this issue Nov 16, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@JamesPHoughton
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

When make a change to the code in dev, the server crashes instead of successfully propagating changes to the page:

panic: strings: negative Repeat count

goroutine 52 [running]:
strings.Repeat({0x102fea100?, 0x14000f9a2a0?}, 0xe?)
        /usr/local/go/src/strings/strings.go:538 +0x394
github.com/empiricaly/empirica/internal/term.(*UI).printRefresh(0x14000ab1ea8?, {0x102ec39ba, 0x6})
        /build/internal/term/term.go:89 +0x468
github.com/empiricaly/empirica/internal/term.(*UI).process(0x14000321f80, {0x60?, {0x0?, 0x0?}, 0x14000033640?})
        /build/internal/term/term.go:230 +0x434
github.com/empiricaly/empirica/internal/term.(*UI).run(0x14000321f80)
        /build/internal/term/term.go:206 +0x3c
created by github.com/empiricaly/empirica/internal/term.(*UI).Start
        /build/internal/term/term.go:35 +0x60

Looks like there needs to be a check on this line to make sure that the passed parameter is positive:
https://github.com/empiricaly/empirica/blob/1d91ea7b31b3164083f62c45fff39fda84bf06f5/internal/term/term.go#L89C3-L89C3

Steps To Reproduce

No response

Empirica Version

Version: v1.8.5
SHA:     1d91ea7
Branch:  main
Time:    2023-11-16T03:03:22Z

Client:  1.8.5
Server:  1.8.5

What OS are you seeing the problem on?

macOS

What browser are you seeing the problem on?

Chrome

Relevant log output

No response

Anything else?

I'm having trouble recreating the bug in a clean environment, partly because i don't know what log attempt is trying to display. @npaton, sent this to you in slack, but just moving it here to make tracking easier. I'll take a crack at a patch.

Code of Conduct

  • I agree to follow this project's Code of Conduct
@JamesPHoughton JamesPHoughton added the bug Something isn't working label Nov 16, 2023
@JamesPHoughton
Copy link
Contributor Author

This occured because I am piping logs to a file. You can replicate the error by starting the template experiment with the following command, and then making a display change.

> empirica 2>&1 | tee ./.empirica/empirica.log

The file doesn't have a column width, so the value mentioned above was going negative.

Taking out the extra log piping solves the problem, so this is low priority.

@npaton npaton closed this as completed in 54bd491 Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant