[ejabberd] Segfault with EXMPP (erlang r13b04)

saurabh aggarwal aggarwal.saurabh at gmail.com
Mon Nov 28 09:53:08 MSK 2011


We have created an XMPP component for GTalk using EXMPP.

Occasionaly (like once a week), I get a segfault in erl. I am running
R13B04. Since EXMPP is the only external library that I am using, I am
suspecting it to be the culprit.

I have  a core dump (only one yet, since earlier the cores were not enabled
on my machine). The crash seems to be because of a memory issue.

I am running the latest exmpp library. Any pointers will be appreciated.

>From my application log, I could also figure out that the last 2 times it
happened, it was when a particular user signed in (maybe something to do
with his roster?).

saurabh at serv10-ub1:~/ejabberd_development/gmail_component$ gdb
/usr/local/lib/erl
lang/erts-5.7.5/bin/beam ./core
GNU gdb (Ubuntu/Linaro 7.2-1ubuntu11) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/local/lib/erlang/erts-5.7.5/bin/beam...done.
[New Thread 1330]

warning: Can't read pathname for load map: Input/output error.
Reading symbols from /lib/i386-linux-gnu/libutil.so.1...(no debugging
symbols found)...done.
Loaded symbols for /lib/i386-linux-gnu/libutil.so.1
Reading symbols from /lib/i386-linux-gnu/libdl.so.2...(no debugging symbols
found)...done.
Loaded symbols for /lib/i386-linux-gnu/libdl.so.2
Reading symbols from /lib/i386-linux-gnu/libm.so.6...(no debugging symbols
found)...done.
Loaded symbols for /lib/i386-linux-gnu/libm.so.6
Reading symbols from /lib/libncurses.so.5...(no debugging symbols
found)...done.
Loaded symbols for /lib/libncurses.so.5
Reading symbols from /lib/i386-linux-gnu/libpthread.so.0...(no debugging
symbols found)...done.
Loaded symbols for /lib/i386-linux-gnu/libpthread.so.0
Reading symbols from /lib/i386-linux-gnu/librt.so.1...(no debugging symbols
found)...done.
Loaded symbols for /lib/i386-linux-gnu/librt.so.1
Reading symbols from /lib/i386-linux-gnu/libc.so.6...(no debugging symbols
found)...done.
Loaded symbols for /lib/i386-linux-gnu/libc.so.6
Reading symbols from /lib/ld-linux.so.2...(no debugging symbols
found)...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from
/usr/local/lib/erlang/lib/exmpp-0.9.8-05-g6987a0a/priv/lib/exmpp_stringprep.so...done.
Loaded symbols for
/usr/local/lib/erlang/lib/exmpp-0.9.8-05-g6987a0a/priv/lib/exmpp_stringprep.so
Reading symbols from
/usr/local/lib/erlang/lib/exmpp-0.9.8-05-g6987a0a/priv/lib/exmpp_xml_expat.so...done.
Loaded symbols for
/usr/local/lib/erlang/lib/exmpp-0.9.8-05-g6987a0a/priv/lib/exmpp_xml_expat.so
Reading symbols from /lib/i386-linux-gnu/libexpat.so.1...(no debugging
symbols found)...done.
Loaded symbols for /lib/i386-linux-gnu/libexpat.so.1
Reading symbols from
/usr/local/lib/erlang/lib/exmpp-0.9.8-05-g6987a0a/priv/lib/exmpp_xml_expat_legacy.so...done.
Loaded symbols for
/usr/local/lib/erlang/lib/exmpp-0.9.8-05-g6987a0a/priv/lib/exmpp_xml_expat_legacy.so
Reading symbols from
/usr/local/lib/erlang/lib/crypto-1.6.4/priv/lib/crypto_drv.so...done.
Loaded symbols for
/usr/local/lib/erlang/lib/crypto-1.6.4/priv/lib/crypto_drv.so
Reading symbols from /usr/lib/libcrypto.so.0.9.8...(no debugging symbols
found)...done.
Loaded symbols for /usr/lib/libcrypto.so.0.9.8
Reading symbols from /lib/i386-linux-gnu/libz.so.1...(no debugging symbols
found)...done.
Loaded symbols for /lib/i386-linux-gnu/libz.so.1
Reading symbols from
/usr/local/lib/erlang/lib/exmpp-0.9.8-05-g6987a0a/priv/lib/exmpp_tls_openssl.so...done.
Loaded symbols for
/usr/local/lib/erlang/lib/exmpp-0.9.8-05-g6987a0a/priv/lib/exmpp_tls_openssl.so
Reading symbols from /lib/libssl.so.0.9.8...(no debugging symbols
found)...done.
Loaded symbols for /lib/libssl.so.0.9.8
Reading symbols from
/usr/local/lib/erlang/lib/exmpp-0.9.8-05-g6987a0a/priv/lib/exmpp_compress_zlib.so...done.
Loaded symbols for
/usr/local/lib/erlang/lib/exmpp-0.9.8-05-g6987a0a/priv/lib/exmpp_compress_zlib.so
Core was generated by `/usr/local/lib/erlang/erts-5.7.5/bin/beam -- -root
/usr/local/lib/erlang -progn'.
Program terminated with signal 11, Segmentation fault.
#0  replace (allctr=0x81cfac0, size=280, cand_blk=0x0, cand_size=0)
    at beam/erl_bestfit_alloc.c:289
289 x->left->parent = y;
(gdb) p *x
$1 = {hdr = 1685341039, flags = 1647849803, parent = 0xb74eb5bc,
  left = 0x4e4f7362, right = 0x70315a67}
(gdb) p *x->left
Cannot access memory at address 0x4e4f7362
(gdb) bt
#0  replace (allctr=0x81cfac0, size=280, cand_blk=0x0, cand_size=0)
    at beam/erl_bestfit_alloc.c:289
#1  bf_unlink_free_block (allctr=0x81cfac0, size=280, cand_blk=0x0,
    cand_size=0) at beam/erl_bestfit_alloc.c:783
#2  bf_get_free_block (allctr=0x81cfac0, size=280, cand_blk=0x0,
cand_size=0)
    at beam/erl_bestfit_alloc.c:842
#3  0x08072e51 in mbc_alloc_block (allctr=0x81cfac0, size=275)
    at beam/erl_alloc_util.c:631
#4  mbc_alloc (allctr=0x81cfac0, size=275) at beam/erl_alloc_util.c:758
#5  0x08075a11 in do_erts_alcu_alloc (type=131, extra=0x81cfac0, size=275)
    at beam/erl_alloc_util.c:2529
#6  erts_alcu_alloc_ts (type=131, extra=0x81cfac0, size=275)
    at beam/erl_alloc_util.c:2551
#7  0x081048bb in erts_alloc (c_p=0xb7737754, reg=0x81de360, live=5,
    build_size_term=143, extra_words=0, unit=8) at beam/erl_alloc.h:184
#8  erts_bin_nrml_alloc (c_p=0xb7737754, reg=0x81de360, live=5,
    build_size_term=143, extra_words=0, unit=8) at beam/erl_binary.h:234
#9  erts_bs_append (c_p=0xb7737754, reg=0x81de360, live=5,
    build_size_term=143, extra_words=0, unit=8) at beam/erl_bits.c:1325
#10 0x08127185 in process_main () at beam/beam_emu.c:3556
#11 0x0807ec56 in erl_start (argc=13, argv=0xbfe32964) at
beam/erl_init.c:1329
#12 0x08064fcb in main (argc=13, argv=0xbfe32964) at sys/unix/erl_main.c:29
(gdb)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.jabber.ru/pipermail/ejabberd/attachments/20111128/03d6fcd5/attachment.html>


More information about the ejabberd mailing list