Segfault on port operation

Luke Gorrie <>
Thu Feb 27 18:43:22 CET 2003


Ahoy,

I found a way to segfault the emulator on R9B-0:

  $ /usr/local/erlang/r9b-0/bin/erl
  Erlang (BEAM) emulator version 5.2 [source] [hipe]

  Eshell V5.2  (abort with ^G)
  1> P = open_port({spawn, "/bin/cat"}, []).
  #Port<0.26>
  2> erlang:port_call(P, hello).
  Segmentation fault

That aside, can someone tell me if the following code is initializing
the linked-in driver entry correctly?

  ErlDrvEntry tun_driver_entry;

  ErlDrvEntry *driver_init(void)
  {
      memset(&tun_driver_entry, 0, sizeof(tun_driver_entry));
      tun_driver_entry.init = tun_init;
      tun_driver_entry.start = tun_start;
      tun_driver_entry.stop = tun_stop;
      tun_driver_entry.ready_input = tun_input;
      tun_driver_entry.control = tun_ctl;
      tun_driver_entry.driver_name = "tun_drv";
      return &tun_driver_entry;
  }

Cheers,
Luke




More information about the erlang-questions mailing list