Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Modules name conflict during dynamic loading #6957
Original bug ID: 6957
It is hard to reduce this issue to a small test case, mostly because, it looks like that many different parts of infrastructure are involved. So, to reproduce, one need to install bap from opam.
A dynamically linked module accidentally accesses the same named module from the host program, thus provoking a segfault.
In BAP library we use dynamic loading to dynamically load program analysis plugins into our main application. Plugins are loaded with
In main application we have a filename
But if everything is left as it is, then when I load and execute the loaded code, the first field of the record is not a
It looks suspicious that the issue only manifests itself, when field records are marked as mutable. Maybe there is some optimization pass, that is responsible for that.
Steps to reproduce
$ opam install bap
$ tar xzvf segfault
$ bapbuild use.plugin
$ bap -luse /bin/true
Comment author: @ivg
yes, looks like another manifestation. We saw that previously, when we link plugin with the a library, that is already linked into a host program. We even created a workaround - our ocamlbuild plugin prevents from this, by excluding this libraries. (I wasn't sure that this was a bug).
It looks like that #4839 is about the same.