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

Divide by zero panic on first pasta created #107

Closed
goldstar611 opened this issue Nov 10, 2022 · 1 comment
Closed

Divide by zero panic on first pasta created #107

goldstar611 opened this issue Nov 10, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@goldstar611
Copy link

Using the recommended configuration on the command line, creating a pasta results in a divide by zero panic

~/Desktop $ ./microbin --editable --enable-burn-after --private --qr --highlightsyntax --bind 0.0.0.0 --port 8080 --public-path="http://0.0.0.0:8080"
2022-11-10T15:34:47 [INFO] - MicroBin starting on http://0.0.0.0:8080
2022-11-10T15:34:47 [INFO] - Starting 1 workers
2022-11-10T15:34:47 [INFO] - Actix runtime found; starting in Actix runtime
2022-11-10T15:34:50 [INFO] - 127.0.0.1 "GET / HTTP/1.1" 200 8030 "-" "browserUA" 0.000145
2022-11-10T15:34:50 [INFO] - 127.0.0.1 "GET /static/water.css HTTP/1.1" 200 22669 "http://0.0.0.0:8080/" "browserUA" 0.000093
2022-11-10T15:34:50 [INFO] - 127.0.0.1 "GET /static/logo.png HTTP/1.1" 200 4402 "http://0.0.0.0:8080/" "browserUA" 0.000031
2022-11-10T15:34:51 [INFO] - 127.0.0.1 "GET /info HTTP/1.1" 200 2295 "http://0.0.0.0:8080/" "browserUA" 0.000055
2022-11-10T15:34:51 [INFO] - 127.0.0.1 "GET /static/water.css HTTP/1.1" 200 22669 "http://0.0.0.0:8080/info" "browserUA" 0.000092
2022-11-10T15:34:51 [INFO] - 127.0.0.1 "GET /static/logo.png HTTP/1.1" 200 4402 "http://0.0.0.0:8080/info" "browserUA" 0.000024
2022-11-10T15:34:54 [INFO] - 127.0.0.1 "GET /pastalist HTTP/1.1" 200 1979 "http://0.0.0.0:8080/info" "browserUA" 0.000159
2022-11-10T15:34:54 [INFO] - 127.0.0.1 "GET /static/water.css HTTP/1.1" 200 22669 "http://0.0.0.0:8080/pastalist" "browserUA" 0.000065
2022-11-10T15:34:54 [INFO] - 127.0.0.1 "GET /static/logo.png HTTP/1.1" 200 4402 "http://0.0.0.0:8080/pastalist" "browserUA" 0.000020
2022-11-10T15:34:56 [INFO] - 127.0.0.1 "GET /info HTTP/1.1" 200 2295 "http://0.0.0.0:8080/pastalist" "browserUA" 0.000054
2022-11-10T15:34:56 [INFO] - 127.0.0.1 "GET /static/water.css HTTP/1.1" 200 22669 "http://0.0.0.0:8080/info" "browserUA" 0.000060
2022-11-10T15:34:56 [INFO] - 127.0.0.1 "GET /static/logo.png HTTP/1.1" 200 4402 "http://0.0.0.0:8080/info" "browserUA" 0.000022
2022-11-10T15:34:57 [INFO] - 127.0.0.1 "GET /pastalist HTTP/1.1" 200 1979 "http://0.0.0.0:8080/info" "browserUA" 0.000250
2022-11-10T15:34:57 [INFO] - 127.0.0.1 "GET /static/water.css HTTP/1.1" 200 22669 "http://0.0.0.0:8080/pastalist" "browserUA" 0.000051
2022-11-10T15:34:57 [INFO] - 127.0.0.1 "GET /static/logo.png HTTP/1.1" 200 4402 "http://0.0.0.0:8080/pastalist" "browserUA" 0.000062
2022-11-10T15:34:57 [INFO] - 127.0.0.1 "GET / HTTP/1.1" 200 8030 "http://0.0.0.0:8080/pastalist" "browserUA" 0.000072
2022-11-10T15:34:57 [INFO] - 127.0.0.1 "GET /static/water.css HTTP/1.1" 200 22669 "http://0.0.0.0:8080/" "browserUA" 0.000065
2022-11-10T15:34:57 [INFO] - 127.0.0.1 "GET /static/logo.png HTTP/1.1" 200 4402 "http://0.0.0.0:8080/" "browserUA" 0.000027
thread 'actix-rt|system:0|arbiter:0' panicked at 'attempt to divide by zero', src/util/animalnumbers.rs:20:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'actix-rt|system:0|arbiter:0' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', src/endpoints/create.rs:40:41
thread 'actix-rt|system:0|arbiter:0' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', src/endpoints/create.rs:40:41

Every request there after results in

thread 'actix-rt|system:0|arbiter:0' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', src/endpoints/info.rs:20:41

I just downloaded the latest release from github:

Version | 1.2.0-20221107
-- | --
Status | OK
Pastas | 1
@goldstar611
Copy link
Author

I think it's a 32 bit issue. I can reproduce this on the linux-i686 build and linux-armv7 build but not the x86_64 build. Hope that helps!

@szabodanika szabodanika added the bug Something isn't working label Nov 11, 2022
mikedamm added a commit to mikedamm/microbin that referenced this issue Jul 8, 2024
szabodanika added a commit that referenced this issue Oct 24, 2024
fix: division by zero on 32-bit platform (#107, #118)
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

2 participants