[erlang-questions] Intrusive function intercept

Geoff Cant nem@REDACTED
Thu Oct 10 21:47:55 CEST 2013

The 'int' module in the debugger application might be able to help here. It performs the instrumentation (re-compiles your module from debug_info[1] with breakpoints and so on) and manages the execution of instrumented code for you.


I think that using 'int' as the basis for building a production system is crazy, but it'd be interesting to try out.

[1] ALWAYS compile with debug_info.[2]
[2] Why is that not the default? I have never not wanted it.

On 2013-10-10, at 02:13 , Richard Carlsson <carlsson.richard@REDACTED> wrote:

> On 2013-10-10 10:54 , Tyron Zerafa wrote:
>> Yes, we can change the code of the /test/ function and use messages;
>> however I was wondering whether there is another approach. Our idea is
>> to build a resource access control system which authorizes access to
>> resources. We came up with the following implementation options:
>>  1) change the Erlang/OTP libraries - ruled out (not an option)
>>  2) perform checks before each access - will have to change our current
>> code and add these checks
>>  3) using monitoring as described in the previous post - monitoring
>> process performs checks and only allow processes to proceed if they've
>> got the correct privilieges
> If you're not afraid of getting down and dirty, there's another possibility that doesn't require any source code changes, and which guarantees that you check all resource accesses: rewrite the BEAM bytecode of modules at load time, inserting checks automatically.
>    /Richard

More information about the erlang-questions mailing list