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

Nan - nbind - NonCopyablePersistentTraits - Error - VG #66

Closed
subwaystation opened this issue Mar 1, 2017 · 2 comments
Closed

Nan - nbind - NonCopyablePersistentTraits - Error - VG #66

subwaystation opened this issue Mar 1, 2017 · 2 comments

Comments

@subwaystation
Copy link

subwaystation commented Mar 1, 2017

Hi,

@jjrv maybe you could help me out here?
Of a given graph I want to create an index to find a sequence in it efficiently.

Thanks in advance :)

@subwaystation
Copy link
Author

subwaystation commented Mar 1, 2017

Hi,

@jjrv maybe you could help me out here?
Of a given graph I want to create an index to find a sequence in it efficiently.
Only trying to build the first part of the index, GCSA I run into the following problem.
Code:

std::shared_ptr<gcsa::GCSA> buildGcsa(VG& vg) {
    vg::id_t head_id = 0, tail_id = 0;
    int kmer_size = 13;
    int doubling_steps = 2;
    bool path_only = false;
    bool forward_only = true;
    // TODO change this to 200 or more
    size_t size_limit = 2; // in Gigabytes
    std::string base_file_name = ".vg-kmers-tmp-";
    string tmpfile = vg.write_gcsa_kmers_to_tmpfile(kmer_size, path_only,
    			forward_only, head_id, tail_id, doubling_steps, size_limit,
    			base_file_name);
    // set up the input graph using the kmers
    gcsa::InputGraph input_graph( { tmpfile }, true);
    gcsa::ConstructionParameters params;
    params.setSteps(doubling_steps);
    params.setLimit(size_limit);
    // run the GCSA construction
    //gcsa = new gcsa::GCSA(input_graph, params);
    //auto ag = std::make_shared<AG>(in_vg, in_ff);
    auto gcsa = std::make_shared<gcsa::GCSA>(input_graph, params);
    // and the LCP array construction
    // lcp = new gcsa::LCPArray(input_graph, params);
    // delete the temporary debruijn graph file
    remove(tmpfile.c_str());
    return gcsa;
}

Traceback:


Thread 1 received signal SIGSEGV, Segmentation fault.
0x000000010614307e in v8::Local<v8::Function> Nan::New<v8::Function, v8::NonCopyablePersistentTraits<v8::Function> >(Nan::Persistent<v8::Function, v8::NonCopyablePersistentTraits<v8::Function> > const&) ()
   from /Users/heumos/git/genome-graph/build/Release/nbind.node
(gdb) bt
#0  0x000000010614307e in v8::Local<v8::Function> Nan::New<v8::Function, v8::NonCopyablePersistentTraits<v8::Function> >(Nan::Persistent<v8::Function, v8::NonCopyablePersistentTraits<v8::Function> > const&) ()
   from /Users/heumos/git/genome-graph/build/Release/nbind.node
#1  0x000000010613cc22 in nbind::BindingType<std::shared_ptr<gcsa::GCSA> >::toWireType(std::shared_ptr<gcsa::GCSA>&&) ()
   from /Users/heumos/git/genome-graph/build/Release/nbind.node
#2  0x000000010613eb51 in void nbind::TemplatedBaseSignature<nbind::FunctionSignature<std::shared_ptr<gcsa::GCSA> (*)(vg::AG&), decltype(nullptr), nbind::PolicyListType<>, std::shared_ptr<gcsa::GCSA><vg::AG&> >, std::shared_ptr<gcsa::GCSA><vg::AG&>, std::shared_ptr<gcsa::GCSA><vg::AG&> >::callInnerSafely<void, Nan::FunctionCallbackInfo<v8::Value> const, Nan::FunctionCallbackInfo<v8::Value> >(Nan::FunctionCallbackInfo<v8::Value> const&, Nan::FunctionCallbackInfo<v8::Value>&, unsigned int) ()
   from /Users/heumos/git/genome-graph/build/Release/nbind.node
#3  0x00000001061311d7 in Nan::imp::FunctionCallbackWrapper(v8::FunctionCallbackInfo<v8::Value> const&) ()
   from /Users/heumos/git/genome-graph/build/Release/nbind.node
#4  0x000000010017c59a in v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&)) ()
#5  0x00000001001e029c in v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) ()
#6  0x00000001001df6d9 in v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) ()
#7  0x0000365ae28063a7 in ?? ()
#8  0x0000365ae28062e1 in ?? ()
#9  0x00007fff5fbfe3e0 in ?? ()
#10 0x0000000300000000 in ?? ()
#11 0x00007fff5fbfe448 in ?? ()
#12 0x0000365ae2c0c61a in ?? ()
#13 0x00003ab3e9904311 in ?? ()
#14 0x0000168da24a70d9 in ?? ()
#15 0x0000000500000000 in ?? ()
#16 0x00001dea6d052399 in ?? ()
#17 0x00001dea6d005399 in ?? ()
#18 0x0000168da24a70d9 in ?? ()
#19 0x00001dea6d014319 in ?? ()
#20 0x00002197b4ce9779 in ?? ()
#21 0x00007fff5fbfe4b8 in ?? ()
#22 0x0000365ae2c09169 in ?? ()
#23 0x00001dea6d052399 in ?? ()
#24 0x00002197b4ce5499 in ?? ()
#25 0x00001dea6d014319 in ?? ()

It seems to me that v8 is trying to copy something that is not copyable?

@subwaystation subwaystation changed the title How to return a std::pair of 2 std::shared_ptr ? - related to VG lib Nan - nbind - NonCopyablePersistentTraits - Error - VG Mar 20, 2017
@subwaystation
Copy link
Author

It occured to me that it is the same problem as in here: https://github.com/charto/nbind/issues/39#issuecomment-261890364

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

1 participant