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

Benchmark "HashMapBench/HashRemove" segfaults. #2313

Closed
xi2 opened this issue Oct 27, 2017 · 7 comments · Fixed by #2383
Closed

Benchmark "HashMapBench/HashRemove" segfaults. #2313

xi2 opened this issue Oct 27, 2017 · 7 comments · Fixed by #2383
Assignees

Comments

@xi2
Copy link

xi2 commented Oct 27, 2017

Hi. Just trying out Pony and I noticed that on my machine one of the benchmarks segfaults.

$ ./build/release/libponyrt.benchmarks --benchmark_filter='HashMapBench/HashRemove'
Run on (4 X 1245.56 MHz CPU s)
2017-10-27 19:20:01
***WARNING*** CPU scaling is enabled, the benchmark real time measurements may be noisy and will incur extra overhead.
Benchmark                                     Time           CPU Iterations
---------------------------------------------------------------------------
Segmentation fault

Git bisect tells me that dbd777a introduced this.

My system:

$ ponyc --version
0.20.0-0b2a2d2 [release]
compiled with: llvm 3.9.1 -- cc (Debian 4.9.2-10) 4.9.2
$ uname -a
Linux pc 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2+deb8u5 (2017-09-19) x86_64 GNU/Linux

Hope this is helpful.

@SeanTAllen
Copy link
Member

Very helpful. Thank you @xi2.

@SeanTAllen
Copy link
Member

@xi2 what commands did you run to build and run the benchmark?

@SeanTAllen
Copy link
Member

@Praetonus did you see this?

@xi2
Copy link
Author

xi2 commented Nov 5, 2017

@SeanTAllen, to build I just ran make on it's own, which built the compiler and the benchmarks. To run the specific benchmark that crashes I ran

./build/release/libponyrt.benchmarks --benchmark_filter='HashMapBench/HashRemove'

As well as the system info I gave earlier, I can say that I am using a debian "Jessie" system (not the current stable, but the one before). LLVM 3.9.1 was built from source with the following build commands

cmake -DCMAKE_BUILD_TYPE=MinSizeRel ..
make -j4

If you cannot reproduce and would like me to try anything else (e.g. different LLVM build options), please ask.

@xi2
Copy link
Author

xi2 commented Nov 5, 2017

I should also say that running ./build/release/libponyrt.benchmarks alone, the other benchmarks run fine up until the one that crashes. The last one that passes OK before the crash is HashMapBench/HashPutNewResize/1/0.

@SeanTAllen
Copy link
Member

I'm on OSX, El Capitan. I get:

➜  ponyc-release-clean ./build/release/libponyrt.benchmarks --benchmark_filter='HashMapBench/HashRemove'                                         git:sean-runtime-backpressure
Run on (8 X 2800 MHz CPU s)
dyld: lazy symbol binding failed: Symbol not found: _clock_gettime
  Referenced from: /usr/local/opt/[email protected]/lib/libc++.1.dylib
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _clock_gettime
  Referenced from: /usr/local/opt/[email protected]/lib/libc++.1.dylib
  Expected in: /usr/lib/libSystem.B.dylib

[1]    182 trace trap  ./build/release/libponyrt.benchmarks

which is... interesting.

@Praetonus
Copy link
Member

Duh, I forgot to take the size of the types into account when replacing new by ponyint_pool_alloc_size. Will make a fix.

Praetonus pushed a commit to Praetonus/ponyc that referenced this issue Nov 28, 2017
This fixes an oversight from dbd777a where allocation sizes weren't
adapted when replacing `new` with `ponyint_pool_alloc_size`.

Closes ponylang#2313.
Praetonus pushed a commit that referenced this issue Nov 29, 2017
This fixes an oversight from dbd777a where allocation sizes weren't
adapted when replacing `new` with `ponyint_pool_alloc_size`.

Closes #2313.
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

Successfully merging a pull request may close this issue.

3 participants