Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About crash on CentOS #9

Closed
Novik opened this issue Nov 30, 2011 · 1 comment
Closed

About crash on CentOS #9

Novik opened this issue Nov 30, 2011 · 1 comment

Comments

@Novik
Copy link

Novik commented Nov 30, 2011

See http://libtorrent.rakshasa.no/ticket/2115 for details.

In gdb wee may to see:

(gdb) s
rak::cacheline_allocator<rak::priority_item*>::alloc_size (size=8)
    at ../rak/allocators.h:79
79          pointer ptr = NULL;
(gdb) n
80          int __UNUSED result = posix_memalign((void**)&ptr, LT_SMP_CACHE_BYTES, size);
(gdb) n
82          return ptr;
(gdb) p result
$6 = 22
(gdb) p ptr
$7 = (rak::priority_item **) 0x0
(gdb) p size
$8 = 8
(gdb) p LT_SMP_CACHE_BYTES
$9 = 1
(gdb) bt
#0  rak::cacheline_allocator<rak::priority_item*>::alloc_size (size=8)
    at ../rak/allocators.h:82
#1  0x00002aaaaaf6c5e7 in rak::cacheline_allocator<rak::priority_item*>::allocate (this=0x2aaaab2ca680, num=1, hint=0x0) at ../rak/allocators.h:76
#2  0x00002aaaaaf6c60f in std::_Vector_base<rak::priority_item*, rak::cacheline_allocator<rak::priority_item*> >::_M_allocate (this=0x2aaaab2ca680, __n=1)
    at /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_vector.h:127
#3  0x00002aaaaaf6c79c in std::vector<rak::priority_item*, rak::cacheline_allocator<rak::priority_item*> >::_M_insert_aux (this=0x2aaaab2ca680, __position=Cannot access memory at address 0x0
)
    at /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/vector.tcc:275
#4  0x00002aaaaaf6c9f0 in std::vector<rak::priority_item*, rak::cacheline_allocator<rak::priority_item*> >::push_back (this=0x2aaaab2ca680,
    __x=@0x7fffffffe290)
    at /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_vector.h:610
#5  0x00002aaaaaf6ca10 in rak::priority_queue<rak::priority_item*, rak::priority_compare, std::equal_to<rak::priority_item*>, rak::cacheline_allocator<rak::priority_item*> >::push (this=0x2aaaab2ca680, value=@0x7fffffffe290)
    at ../rak/priority_queue.h:77
#6  0x00002aaaaaf6cf8e in rak::priority_queue_insert (queue=0x2aaaab2ca680,
    item=0x820d98, t=...) at ../rak/priority_queue_default.h:116
#7  0x00002aaaaaf69571 in torrent::Manager::Manager (this=0x820d20)
    at manager.cc:89
#8  0x00002aaaaaf8aa54 in torrent::initialize (poll=0x8124b0) at torrent.cc:104
#9  0x0000000000412aab in main (argc=1, argv=0x7fffffffe998) at main.cc:198

e.q. LT_SMP_CACHE_BYTES is setted to 1, this is a invalid value.

And yes, in config.h (after configure) we may to see:

#define LT_SMP_CACHE_BYTES 1

For avoid this you must remove the superfluous comma in files libtorrent/scripts/common.m4 and rtorrent/scripts/common.m4, e.q. replace lines

AC_DEFINE(LT_SMP_CACHE_BYTES, 128, Largest L1 cache size we know of, should work on all archs.)

to

AC_DEFINE(LT_SMP_CACHE_BYTES, 128, Largest L1 cache size we know of)

and all will be OK.

@rakshasa
Copy link
Owner

Fixed. (and deleted the old ticket due to spam)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants