Skip to content

Crash when creating a new static view #16

Description

@whatsthecraic

Hi there,
hope you're doing well! I have to ask a bit of your help here.

I'm experiencing a crash when creating a new "simple" view:

[Switching to Thread 0x7feb28221700 (LWP 27343)]
snap_t<dst_weight_t<__univeral_type> >::handle_flagu (this=0x6c1500) at /export/scratch1/home/dleo/workspace/graphone/gview/static_view.h:105
105                 __sync_fetch_and_add(&degree_out[src_vid].add_count, 1);
Missing separate debuginfos, use: dnf debuginfo-install gmp-6.1.2-10.fc30.x86_64 gmp-c++-6.1.2-10.fc30.x86_64 libpfm-4.10.1-6.fc30.x86_64 numactl-libs-2.0.12-2.fc30.x86_64 papi-libs-5.7.0-1.fc30.x86_64
(gdb) bt
#0  snap_t<dst_weight_t<__univeral_type> >::handle_flagu (this=0x6c1500) at /export/scratch1/home/dleo/workspace/graphone/gview/static_view.h:105
#1  0x000000000052ed7a in snap_t<dst_weight_t<__univeral_type> >::_ZN6snap_tI12dst_weight_tI15__univeral_typeEE11update_viewEv._omp_fn.0(void) () at /export/scratch1/home/dleo/workspace/graphone/gview/static_view.h:233
#2  0x00007ffff77c6906 in gomp_thread_start (xdata=<optimized out>) at /export/scratch2/dleo/temp/d20191206-38211-kercnc/gcc-9.2.0/libgomp/team.c:123
#3  0x00007ffff77785a2 in start_thread () from /lib64/libpthread.so.0
#4  0x00007ffff76a3163 in clone () from /lib64/libc.so.6

Now the local vars are clearly bogus:

(gdb) info locals
i = 6720341
src = <optimized out>
dst = <optimized out>
src_vid = 207067756544
dst_vid = 224230715648
is_del = false
is_stale = false
is_simple = true

The state of the main thread is:

[Switching to thread 1 (Thread 0x7ffff7334ac0 (LWP 10809))]
#0  snap_t<dst_weight_t<__univeral_type> >::handle_flagu (this=0x6c1500)
    at /export/scratch1/home/dleo/workspace/graphone/gview/static_view.h:105
105                 __sync_fetch_and_add(&degree_out[src_vid].add_count, 1);
(gdb) bt
#0  snap_t<dst_weight_t<__univeral_type> >::handle_flagu (this=0x6c1500)
    at /export/scratch1/home/dleo/workspace/graphone/gview/static_view.h:105
#1  0x000000000052ed7a in snap_t<dst_weight_t<__univeral_type> >::_ZN6snap_tI12dst_weight_tI15__univeral_typeEE11updat
e_viewEv._omp_fn.0(void) () at /export/scratch1/home/dleo/workspace/graphone/gview/static_view.h:233
#2  0x00007ffff77bda02 in GOMP_parallel (
    fn=0x52eceb <snap_t<dst_weight_t<__univeral_type> >::_ZN6snap_tI12dst_weight_tI15__univeral_typeEE11update_viewEv.
_omp_fn.0(void)>, data=0x7fffffffb260, num_threads=39, flags=0)
    at /export/scratch2/dleo/temp/d20191206-38211-kercnc/gcc-9.2.0/libgomp/parallel.c:171
#3  0x00000000004fe4e4 in snap_t<dst_weight_t<__univeral_type> >::update_view (this=0x6c1500)
    at /export/scratch1/home/dleo/workspace/graphone/gview/static_view.h:224
#4  0x00000000004fb562 in create_static_view<dst_weight_t<__univeral_type> > (pgraph=0x6c0460, flag=4)
    at /export/scratch1/home/dleo/workspace/graphone/gview/graph_view.h:58
[...]
(gdb) frame 3
#3  0x00000000004fe4e4 in snap_t<dst_weight_t<__univeral_type> >::update_view (this=0x6c1500)
    at /export/scratch1/home/dleo/workspace/graphone/gview/static_view.h:224
224         #pragma omp parallel num_threads(THD_COUNT)

(gdb) info locals
blog = 0x6bffc0
marker = 2603795200
old_marker = 2543452160
(gdb) p *this
$15 = {<gview_t<dst_weight_t<__univeral_type> >> = {
    _vptr.gview_t = 0x5d5678 <vtable for snap_t<dst_weight_t<__univeral_type> >+16>, pgraph = 0x6c0460, 
    snapshot = 0x7feea4035bd0, thread = 140737488332512, algo_meta = 0x0, v_count = 4294967296, flag = 4, 
    sstream_func = 0x7fffffffa6e5}, graph_out = 0x6ca8a0, graph_in = 0x6ca8a0, degree_out = 0x7fc65c974010, 
  degree_in = 0x7fc65c974010, edges = 0x7ff7cd82f010, edge_count = 60343040}
(gdb) p pgraph->blog
$16 = (blog_t<dst_weight_t<__univeral_type> > *) 0x6bffc0
(gdb) p *(pgraph->blog)
$17 = {blog_beg = 0x7ff71712f010, blog_count = 134217728, blog_mask = 134217727, blog_head = 2603795200, 
  blog_tail = {<std::__atomic_base<unsigned long>> = {static _S_alignment = 8, _M_i = 2543452160}, 
    static is_always_lock_free = true}, blog_marker = 2556428288, blog_wtail = 0, blog_wmarker = 0}
(gdb) p edges - pgraph->blog->blog_beg
$20 = 127533056

If I understand correctly, the array pgraph->blog->blog_beg is meant to be treated as circular ? That is, once depleted, writers keep adding new edges at the start of the array. If that's the case, the iteration in snap_t<T>::handle_flagu() (and anywhere else this array is being used) should proceed modulo pgraph->blog->blog_count ?

All the best,
Dean

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions