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

linux: thread 'main' panicked at 'attempt to subtract with overflow' #82

Closed
parkr opened this issue Jan 31, 2018 · 5 comments
Closed

linux: thread 'main' panicked at 'attempt to subtract with overflow' #82

parkr opened this issue Jan 31, 2018 · 5 comments

Comments

@parkr
Copy link

parkr commented Jan 31, 2018

Hi! I just pulled & re-compiled at 5f7b361 and got a funky error! Looks like something funky with rbspy::SampleTime::get_sleep_time – maybe related to #79?

~/rbspy$ git rev-parse HEAD
5f7b3615277978d8e50dc335cdfdbb4910e8ddc9
~/massive-jekyll-site$ rustc --version
rustc 1.23.0 (766bd11c8 2018-01-01)
~/rbspy$ which ruby
/usr/bin/ruby
~/massive-jekyll-site$ ruby --version
ruby 2.3.3p222 (2016-11-21) [x86_64-linux-gnu]
~/massive-jekyll-site$ RUST_BACKTRACE=1 ~/rbspy/target/debug/rbspy record /home/parker/jekyll/exe/jekyll build
Recording data to /home/parker/.cache/rbspy/records/rbspy-2018-01-31-Jgn67RAD6i.txt
Press Ctrl+C to stop
Configuration file: none
            Source: /home/parker/massive-jekyll-site
       Destination: /home/parker/massive-jekyll-site/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
thread 'main' panicked at 'attempt to subtract with overflow', src/main.rs:224:9
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at /checkout/src/libstd/sys_common/backtrace.rs:68
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/backtrace.rs:57
             at /checkout/src/libstd/panicking.rs:381
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:397
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:577
   5: std::panicking::begin_panic
             at /checkout/src/libstd/panicking.rs:538
   6: std::panicking::begin_panic_fmt
             at /checkout/src/libstd/panicking.rs:522
   7: rust_begin_unwind
             at /checkout/src/libstd/panicking.rs:498
   8: core::panicking::panic_fmt
             at /checkout/src/libcore/panicking.rs:71
   9: core::panicking::panic
             at /checkout/src/libcore/panicking.rs:51
  10: rbspy::SampleTime::get_sleep_time
             at src/main.rs:224
  11: rbspy::record
             at src/main.rs:292
  12: rbspy::do_main
             at src/main.rs:138
  13: rbspy::main
             at src/main.rs:169
  14: __rust_maybe_catch_panic
             at /checkout/src/libpanic_unwind/lib.rs:101
  15: std::rt::lang_start
             at /checkout/src/libstd/panicking.rs:459
             at /checkout/src/libstd/panic.rs:365
             at /checkout/src/libstd/rt.rs:58
  16: main
  17: __libc_start_main
  18: _start
@jvns
Copy link
Collaborator

jvns commented Jan 31, 2018

thanks for the report! let me know if you have thoughts about the approach to fix it in #83

@parkr
Copy link
Author

parkr commented Jan 31, 2018

When I apply #83, it works!

parker@kondwani:~/massive-jekyll-site$ RUST_BACKTRACE=1 ~/rbspy/target/debug/rbspy record /home/parker/jekyll/exe/jekyll build
Recording data to /home/parker/.cache/rbspy/records/rbspy-2018-01-31-5wJJnuSV30.txt
Press Ctrl+C to stop
Behind expected sample time by 210183 nanoseconds, results may be inaccurate. Try sampling at a lower rate
Configuration file: none
            Source: /home/parker/massive-jekyll-site
       Destination: /home/parker/massive-jekyll-site/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
                    done in 54.053 seconds.
 Auto-regeneration: disabled. Use --watch to enable.
Writing flamegraph to /home/parker/.cache/rbspy/records/rbspy-2018-01-31-5wJJnuSV30.svg

By the way I setup a simple static file server at https://rbspy.parkermakes.tools so you can view all my profiles! The one above is at: https://rbspy.parkermakes.tools/rbspy-2018-01-31-5wJJnuSV30.svg

@jvns jvns closed this as completed in #83 Jan 31, 2018
@jvns
Copy link
Collaborator

jvns commented Jan 31, 2018

that's so cool! how is hunting for possible perf improvements in jekyll going?

@parkr
Copy link
Author

parkr commented Jan 31, 2018

how is hunting for possible perf improvements in jekyll going?

good! i managed to take a site with 10,000 posts from 150s down to 54s, based on this: https://rbspy.parkermakes.tools/rbspy-2018-01-30-o4qFcKDwSo.svg

@jvns
Copy link
Collaborator

jvns commented Jan 31, 2018

whoa congratulations!! would be curious to see a link to a PR if you have one at some point, i'm collecting stories at #62

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants