[erlang-bugs] ERLANG VM crashed

Tomasz Pastuch tomasz.pastuch@REDACTED
Fri Oct 21 16:38:32 CEST 2011


Hello,

during using ttb module, erlang VM sometimes dumps core. Probably during ttb:stop() - but it seems to be randomly. We using R13B03 version.
Please find a call stack from core:


#0  0x00000000004529be in erts_ddll_proc_dead (p=0x2aaab9fb17f0, plocks=1) at beam/erl_bif_ddll.c:1054
#1  0x00000000004a5217 in continue_exit_process (p=0x2aaab9fb17f0, pix_lock=0x88c920) at beam/erl_process.c:7522
#2  0x00000000004a570a in erts_do_exit_process (p=0x2aaab9fb17f0, reason=148811) at beam/erl_process.c:7451
#3  0x00000000005227a6 in handle_error (c_p=0x2aaab9fb17f0, pc=0x19fd69e8, reg=0x2b16ce9ec2c0, bf=0x0) at beam/beam_emu.c:5633
#4  0x000000000052957d in process_main () at beam/beam_emu.c:3273
#5  0x000000000049c8bb in sched_thread_func (vesdp=<value optimized out>) at beam/erl_process.c:3789
#6  0x000000000059df0c in thr_wrapper (vtwd=<value optimized out>) at pthread/ethread.c:106
#7  0x0000003020e06367 in start_thread () from /lib64/libpthread.so.0
#8  0x00000030202d30ad in clone () from /lib64/libc.so.6

I've checked the erl_bif_ddll.c file and it seems that the problem lies in:
prt->drv_ptr->handle 
            ^^^^^^^^

drv_ptr is NULL.

I don't know how exactly it should work, but for me it should look sth like this:


			if (!(prt->status & FREE_PORT_FLAGS) &&
	prt->drv_ptr && prt->drv_ptr->handle == dh)


I've checked the sources for B04 version and it seems that this problem is not fixed there.

Here you have more debugs:


(gdb) p *prt
$2 = {sched = {next = 0x0, prev = 0x0, taskq = 0x0, exe_taskq = 0x0}, timeout_task = {counter = 0}, refc = {counter = 2}, lock = 0x1a000ab0,
  xports = 0x0, run_queue = {counter = 47376955437248}, state_lck = {slck = {lock = 1}}, id = 259319, connected = 51,
  caller = 18446744073709551611, data = 971, bp = 0x0, nlinks = 0x0, monitors = 0x0, bytes_in = 7, bytes_out = 63, ptimer = 0x0,
  tracer_proc = 18446744073709551611, trace_flags = 0, ioq = {size = 0, v_start = 0x0, v_end = 0x0, v_head = 0x0, v_tail = 0x0, v_small = {{
        iov_base = 0x1a056671, iov_len = 4}, {iov_base = 0x1a04ed38, iov_len = 81}, {iov_base = 0x1a04edc1, iov_len = 61}, {iov_base = 0x0,
        iov_len = 0}, {iov_base = 0x0, iov_len = 0}}, b_start = 0x0, b_end = 0x0, b_head = 0x0, b_tail = 0x0, b_small = {0x0, 0x0, 0x0, 0x0,
      0x0}}, dist_entry = 0x0, name = 0x19ffd3b8 "efile", drv_ptr = 0x0, drv_data = 437074800, suspended = 0x0, linebuf = 0x0, status = 4096,
  control_flags = 0, snapshot = 0, reg = 0x0, port_data_lock = 0x0, psd = 0x0}

(gdb) p prt->drv_ptr
$4 = (erts_driver_t *) 0x0

best regards

----------------------------------------------------------------
Zarabiaj nawet o 3 tys. wiecej!
http://linkint.pl/f2a59



More information about the erlang-bugs mailing list