SRI-CSL/OCCAM

Specialization fails to complete with configuration priming: memcached

Closed this issue · 3 comments

I encounter an error when I run slash with configuration priming on memcached-1.4.4. The tar file for memcached-1.4.4, make file to get bitcode, OCCAM log file, and manifest file is included in the zip: memcached_config_issue.zip

The issue can be reproduced in the following way:

  1. make (this might require installing libevent i.e. apt-get install libevent-dev)
  2. slash --work-dir=slash_config --enable-config-prime --disable-inlining --inter-spec-policy=none --intra-spec-policy=onlyonce --use-pointer-analysis memcached.manifest

Note: The specialization is successful if we don't use the --enable-config-prime flag with slash.
Error:

Traceback (most recent call last):
File "/home/vagrant/.local/bin/slash", line 33, in
sys.exit(load_entry_point('razor==1.1.2', 'console_scripts', 'slash')())
File "/home/vagrant/.local/lib/python3.6/site-packages/razor/slash.py", line 103, in entrypoint
return Slash(sys.argv).run() if utils.checkOccamLib() else 1
File "/home/vagrant/.local/lib/python3.6/site-packages/razor/slash.py", line 368, in run
passes.config_prime(pre, post, list(), dynamic_args)
File "/home/vagrant/.local/lib/python3.6/site-packages/razor/passes.py", line 434, in config_prime
driver.previrt(input_file, output_file, args)
File "/home/vagrant/.local/lib/python3.6/site-packages/razor/driver.py", line 75, in previrt
return run(config.get_llvm_tool('opt'), args, **opts)
File "/home/vagrant/.local/lib/python3.6/site-packages/razor/driver.py", line 173, in run
raise ex
razor.driver.ReturnCode: /usr/lib/llvm-10/bin/opt -load=/home/vagrant/occam/lib/libSeaDsa.so -load=/home/vagrant/occam/lib/libprevirt.so /home/vagrant/realTrimmer/Trimmer/examples/memcached-1.4.4/slash_onlyonce/memcached.a.bc -o=/home/vagrant/realTrimmer/Trimmer/examples/memcached-1.4.4/slash_onlyonce/memcached.a.cp.bc -O1 -Pconfig-prime -Pconfig-prime-unknown-args=2
returned -11

Same problem as issue #43

This should be fixed in commit c3069fb

EDIT: There seems to be an issue with the make file here that is causing the error. The specialization works with the Makefile for memcached at examples/trimmer/memcached in the OCCAM-Benchmarks repo. The comment below can be ignored.

memcached is working with the manifest file provided in the original post. However, specialization fails when I change the manifest to this:

{"binary": "memcached_fin", "native_libs":[], "name": "memcached", "static_args": ["-m", "64","-l"], "dynamic_args": "1", "modules": [], "ldflags": ["-levent","-lpthread","-O3"], "main": "memcached.bc"}

I am attaching the new logs and manifest file along with the make and tar file here. The issue can be reproduced in the following way:

  1. make (this might require installing libevent i.e. apt-get install libevent-dev)
  2. slash --work-dir=slash_config --enable-config-prime --disable-inlining --inter-spec-policy=none --intra-spec-policy=onlyonce --use-pointer-analysis memcached.manifest

Note: The specialization is successful if we don't use the --enable-config-prime flag with slash.

Error:
Traceback (most recent call last): File "/home/vagrant/.local/bin/slash", line 33, in <module> sys.exit(load_entry_point('razor==1.1.2', 'console_scripts', 'slash')()) File "/home/vagrant/.local/lib/python3.6/site-packages/razor/slash.py", line 103, in entrypoint return Slash(sys.argv).run() if utils.checkOccamLib() else 1 File "/home/vagrant/.local/lib/python3.6/site-packages/razor/slash.py", line 368, in run passes.config_prime(pre, post, len(static_args) + 1, dynamic_args) File "/home/vagrant/.local/lib/python3.6/site-packages/razor/passes.py", line 436, in config_prime driver.previrt(input_file, output_file, args) File "/home/vagrant/.local/lib/python3.6/site-packages/razor/driver.py", line 75, in previrt return run(config.get_llvm_tool('opt'), args, **opts) File "/home/vagrant/.local/lib/python3.6/site-packages/razor/driver.py", line 173, in run raise ex razor.driver.ReturnCode: /usr/lib/llvm-10/bin/opt -load=/home/vagrant/occam/lib/libSeaDsa.so -load=/home/vagrant/occam/lib/libprevirt.so /home/vagrant/issue_examples/occam_issues/memcached/slash_config/memcached.a.bc -o=/home/vagrant/issue_examples/occam_issues/memcached/slash_config/memcached.a.cp.bc -O1 -Pconfig-prime -Pconfig-prime-index-first-unknown-arg=4 -Pconfig-prime-unknown-args=1 returned -11