SRI-CSL / OCCAM

OCCAM: Object Culling and Concretization for Assurance Maximization
BSD 3-Clause "New" or "Revised" License
26 stars 10 forks source link

Specialization fails to complete with configuration priming: thttpd #45

Closed mudbri closed 3 years ago

mudbri commented 3 years ago

I encounter a linking error when I run slash with configuration priming on thttpd-2.25. There is no linking error if configuration priming has not been enabled. The tar file for thttpd-2.25, make file to get bitcode (along with patch), configuration file for thttpd, OCCAM log file, and manifest file is included in the zip: thttpd_config_issue.zip

The issue can be reproduced in the following way:

  1. make
  2. In static_args option in thttpd.manifest, correct the path for thttpd configuration file. The configuration file (thttpd.conf) has been included in the zip
  3. slash --work-dir=slash_config --disable-inlining --enable-config-prime --inter-spec-policy=none --intra-spec-policy=onlyonce --use-pointer-analysis thttpd.manifest

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

FAILED. Modify the manifest to add libraries and/or linker flags.

Traceback (most recent call last): File "/home/vagrant/.local/lib/python3.6/site-packages/razor/slash.py", line 565, in link driver.linker(final_module, final_libs, binary, linker_args) File "/home/vagrant/.local/lib/python3.6/site-packages/razor/driver.py", line 120, in linker return run('clang++', args) 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/clang++ /home/vagrant/realTrimmer/Trimmer/examples/thttpd-2.25b/slash_config/thttpd.a.cp.i.p.i.h.x.bc -o thttpd_fin -lcrypt -O3 returned 1

caballa commented 3 years ago

The manifest file is missing.

mudbri commented 3 years ago

The manifest file is missing.

I have updated the link. The zip now contains the manifest file

caballa commented 3 years ago

I cannot reproduce this bug after my last commit. That commit might have solved the problem but you mention a linking error and my commit doesn't seem related.

Can you try again?

slash --work-dir=slash_config --disable-inlining --enable-config-prime --inter-spec-policy=none --intra-spec-policy=onlyonce --use-pointer-analysis thttpd\
.manifest
[24/06/2021 09:49:47] Starting Computing interfaces...
done
[24/06/2021 09:49:47] Starting Internalizing wrt interfaces...
done
[24/06/2021 09:49:47] Started global fixpoint ......
[24/06/2021 09:49:47] Starting Intra-module specialization/optimization...
        Module: /homes/jorge/Repos/OCCAM-10/issue45/slash_config/thttpd.a.cp.i.bc
        Intra-specialization policy=onlyonce
        intra module optimization finished succesfully
        resolved indirect calls finished succesfully
        intra-module specialization finished
done
Skipped inter-module specialization
[24/06/2021 09:49:48] Starting Computing interfaces...
done
[24/06/2021 09:49:48] Starting Internalizing wrt interfaces...
done
[24/06/2021 09:49:49] Starting Hides exported functions that are not referenced from outside the module...
done
[24/06/2021 09:49:49] Finished global fixpoint....
[24/06/2021 09:49:49] Starting Stripping symbols...
done

Linking ...

clang++ /homes/jorge/Repos/OCCAM-10/issue45/slash_config/thttpd.a.cp.i.p.i.h.x.bc  -o thttpd_fin -lcrypt -O3

done.

I also attach the log file. occam.log

mudbri commented 3 years ago

The error does seem to have been fixed through the latest commit. I do not encounter the linking error now. Thanks!