GS application

Klacke klacke@REDACTED
Wed Oct 25 11:37:52 CEST 2000


> you have an error in your code. What happens is that a new process is
> spawned, but it crashes when executing .
> 
> gs:draw_line(Win, solid, 2, Path) 
> 
> Which does not exist.
> 
> The error is not detected at compile time because Erlang modules are
> compiled on a stand alone basis and not linked to each other. 
> 
> You can easily find the error by calling internal/0 directly from the
> shell
> 6> line2:internal().
> ** exited: {undef,{gs,draw_line,


It can be a bit confusing for newbies with processes that silently crash.
If we first start sasl ( application:start(sasl) ), and then instead 
of spawn call, proc_lib:spaw/3, we get a nice error printout on the tty.

=CRASH REPORT==== 25-Oct-2000::11:33:59 ===
  crasher:
    pid: <0.61.0>
    registered_name: []
    error_info: {undef,[{gs,draw_line,
                             [{7,<0.31.0>},
                              solid,
                              2,
                              [{10,50},{30,50},{30,60},{60,60}]]},
                         {line2,internal,0},
                         {proc_lib,init_p,5}]}
    initial_call: {line2,internal,[]}
    ancestors: [<0.22.0>]
    messages: []
    links: [<0.31.0>]
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 377
    stack_size: 21
    reductions: 120
  neighbours:


Then it's pretty clear what goes on.

/klacke









More information about the erlang-questions mailing list