[erlang-bugs] Trace bug?

Mikael Pettersson mikpelinux@REDACTED
Wed Jun 4 13:12:16 CEST 2014


Lukas Larsson writes:
 > Hello Robert and Tony,
 > 
 > Thanks for reporting and tracking this down. It seems to be a bug that 
 > was introduced in R16B.
 > 
 > I've written a fix for it that probably will be part of Erlang/OTP 17.1.

Do you have a pointer to this fix?  We need to backport it to R16B.

/Mikael

 > 
 > Lukas
 > 
 > On 02/06/14 17:11, Tony Rogvall wrote:
 > > in bif.c:1885 (r17)
 > >
 > > The code will only call the trace_send function if the name is NOT registered.
 > > Not sure how nor why.
 > >
 > > When NO process is registered to x (yield badarg)
 > >
 > >> erlang:trace(spawn(fun() -> x ! message end), true, [send]).
 > > 2> flush().
 > > Shell got {trace,<0.45.0>,send,message,x}
 > > ok
 > >
 > > When process is registered to x:
 > >
 > > register(x, self()).
 > >> erlang:trace(spawn(fun() -> x ! message end), true, [send]).
 > > 1
 > > 11> flush().
 > > Shell got message
 > > ok
 > >
 > > Feature?
 > >
 > > ;-)
 > >
 > > /Tony
 > >
 > >
 > > On 2 jun 2014, at 16:50, Robert Virding <rvirding@REDACTED> wrote:
 > >
 > >> No, answers?
 > >>
 > >> Robert
 > >>
 > >>
 > >>
 > >> On 30 May 2014 23:18, Robert Virding <rvirding@REDACTED> wrote:
 > >> Can anyone tell me if this is a bug? If not how do I get around it in simple way?
 > >>
 > >> Robert
 > >>
 > >>
 > >>
 > >> On 27 May 2014 17:45, Robert Virding <rvirding@REDACTED> wrote:
 > >> We have discovered strange behaviour when tracing message sends. We turn on tracing message send for a process. In R16 and 17 it seems like there is no trace message when sending to a registered process name, while sending to a pid generates a trace message as it should. In R15 however you get a trace message both sending to a registered name and hen sending to a pid. Is this a bug or is it a new undocumented feature?
 > >>
 > >> As an example I include simple program in which worker sends a message to a registered server and the server replies by sending the worker pid. Here are outputs when running in 17:
 > >>
 > >> Erlang/OTP 17 [erts-6.0] [source-07b8f44] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
 > >>
 > >> Eshell V6.0  (abort with ^G)
 > >> 1> c(trace_procs).
 > >> {ok,trace_procs}
 > >> 2> trace_procs:start().
 > >> trace_procs 7 Server: '<0.39.0>'
 > >> trace_procs 10 Worker: '<0.40.0>'
 > >> trace_procs 34 Message: '{trace,<0.39.0>,send,answer,<0.40.0>}'
 > >> trace_procs 34 Message: '{trace,<0.39.0>,send,answer,<0.40.0>}'
 > >> trace_procs 34 Message: '{trace,<0.39.0>,send,answer,<0.40.0>}'
 > >> trace_procs 34 Message: '{trace,<0.39.0>,send,answer,<0.40.0>}'
 > >> trace_procs 34 Message: '{trace,<0.39.0>,send,answer,<0.40.0>}'
 > >>
 > >> and in R15:
 > >>
 > >> Erlang R15B03 (erts-5.9.3.1) [source] [64-bit] [smp:4:4] [async-threads:0] [hipe] [kernel-poll:false]
 > >>
 > >> Eshell V5.9.3.1  (abort with ^G)
 > >> 1> c(trace_procs).
 > >> {ok,trace_procs}
 > >> 2> trace_procs:start().
 > >> trace_procs 7 Server: '<0.38.0>'
 > >> trace_procs 10 Worker: '<0.39.0>'
 > >> trace_procs 34 Message: '{trace,<0.39.0>,send,{request,<0.39.0>},server}'
 > >> trace_procs 34 Message: '{trace,<0.38.0>,send,answer,<0.39.0>}'
 > >> trace_procs 34 Message: '{trace,<0.39.0>,send,{request,<0.39.0>},server}'
 > >> trace_procs 34 Message: '{trace,<0.38.0>,send,answer,<0.39.0>}'
 > >> trace_procs 34 Message: '{trace,<0.39.0>,send,{request,<0.39.0>},server}'
 > >> trace_procs 34 Message: '{trace,<0.38.0>,send,answer,<0.39.0>}'
 > >> trace_procs 34 Message: '{trace,<0.39.0>,send,{request,<0.39.0>},server}'
 > >>
 > >> What gives?
 > >>
 > >> Robert
 > >>
 > >>
 > >>
 > >> _______________________________________________
 > >> erlang-bugs mailing list
 > >> erlang-bugs@REDACTED
 > >> http://erlang.org/mailman/listinfo/erlang-bugs
 > > "Installing applications can lead to corruption over time. Applications gradually write over each other's libraries, partial upgrades occur, user and system errors happen, and minute changes may be unnoticeable and difficult to fix"
 > >
 > >
 > >
 > > _______________________________________________
 > > erlang-bugs mailing list
 > > erlang-bugs@REDACTED
 > > http://erlang.org/mailman/listinfo/erlang-bugs
 > >
 > 
 > _______________________________________________
 > erlang-bugs mailing list
 > erlang-bugs@REDACTED
 > http://erlang.org/mailman/listinfo/erlang-bugs

-- 



More information about the erlang-bugs mailing list