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

segfault at end of bcalm (probably due to valgrind error) #2

Closed
rchikhi opened this issue Jan 29, 2016 · 8 comments
Closed

segfault at end of bcalm (probably due to valgrind error) #2

rchikhi opened this issue Jan 29, 2016 · 8 comments
Assignees

Comments

@rchikhi
Copy link
Member

rchikhi commented Jan 29, 2016

Problem is in ographBin:

DSK created 32 partitions
[Iterating DSK partitions                ]  0    %   elapsed:   0 min 0  sec   remaining:   0 min 0  sec
Partition 0 has 1518 kmers
Iterated 1518 kmers, among them 350 has leftmin!=rightmin
==18709== Thread 5:
==18709== Conditional jump or move depends on uninitialised value(s)
==18709==    at 0xF7790C: graph4::debruijn() (ographBin.cpp:81)
==18709==    by 0xF7CFA9: bcalm_1::execute()::{lambda(int)#6}::operator()(int) const (bcalm_1.cpp:484)
==18709==    by 0xF84A88: void std::_Bind<bcalm_1::execute()::{lambda(int)#6} (std::_Placeholder<1>)>::__call<void, int&&, 0ul>(std::tuple<int&&>&&, std::_Index_tuple<0ul>) (functional:1264)
==18709==    by 0xF84A33: void std::_Bind<bcalm_1::execute()::{lambda(int)#6} (std::_Placeholder<1>)>::operator()<int, void>(int&&) (functional:1323)
==18709==    by 0xF849E4: std::enable_if<((!std::is_member_pointer<std::_Bind<bcalm_1::execute()::{lambda(int)#6} (std::_Placeholder<1>)> >::value)&&(!std::is_function<std::is_member_pointer>::value))&&(!std::is_member_pointer<std::_Bind<bcalm_1::execute()::{lambda(int)#6} (std::_Placeholder<1>)> ><std::remove_pointer<std::is_member_pointer>::type>::value), std::result_of<std::is_member_pointer& (int&&)>::type>::type std::__invoke<std::_Bind<bcalm_1::execute()::{lambda(int)#6} (std::_Placeholder<1>)>, int>(std::result_of, int&&) (functional:202)
==18709==    by 0xF8498F: std::result_of<bcalm_1::execute()::{lambda(int)#6} (&(int&&))(std::_Placeholder<1>)>::type std::reference_wrapper<std::_Bind<bcalm_1::execute()::{lambda(int)#6} (std::_Placeholder<1>)> >::operator()<int>(int&&) const (functional:435)
==18709==    by 0xF848BF: void std::_Bind_simple<std::reference_wrapper<std::_Bind<bcalm_1::execute()::{lambda(int)#6} (std::_Placeholder<1>)> > (int)>::_M_invoke<0ul>(std::_Index_tuple<0ul>) (functional:1700)
==18709==    by 0xF846C3: std::_Bind_simple<std::reference_wrapper<std::_Bind<bcalm_1::execute()::{lambda(int)#6} (std::_Placeholder<1>)> > (int)>::operator()() (functional:1688)
==18709==    by 0xF84548: std::_Function_handler<void (), std::reference_wrapper<std::_Bind_simple<std::reference_wrapper<std::_Bind<bcalm_1::execute()::{lambda(int)#6} (std::_Placeholder<1>)> > (int)> > >::_M_invoke(std::_Any_data const&) (functional:2069)
==18709==    by 0xFA6780: std::function<void ()>::operator()() const (functional:2439)
==18709==    by 0xFA5A07: std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, void>::operator()() (future:1264)
==18709==    by 0xFA4EAD: std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, void> >::_M_invoke(std::_Any_data const&) (functional:2025)
@Malfoy
Copy link
Contributor

Malfoy commented Mar 17, 2016

OgraphBin is still in dev and should not be yet used.

@rchikhi
Copy link
Member Author

rchikhi commented Mar 19, 2016

so we should use graph3?

@rchikhi
Copy link
Member Author

rchikhi commented Mar 19, 2016

ograph3 has an issue as well:

[..]
[Iterating DSK partitions                ]  75   %   elapsed:   3 min 17 sec   remaining:   1 min 6  sec
Partition 25 has 1520 kmers
Loaded 503 doubled kmers for partition 25
Iterated 1520 kmers, among them 403 has leftmin!=rightmin
==7688== Conditional jump or move depends on uninitialised value(s)
==7688==    at 0xF8C928: graph3::debruijn() (ograph.cpp:362)
==7688==    by 0xF95771: bcalm_1::execute()::{lambda(int)#6}::operator()(int) const (bcalm_1.cpp:485)
[..]

To reproduce it:

../build/bcalm -in ~/bcalm-data/lambda-k16.fa -k 16 -abundance 1

https://transfer.sh/9h7XC/lambda-k16.fa (link will expire soon)

@Malfoy
Copy link
Contributor

Malfoy commented Mar 19, 2016

I'll take care of it.
Thanks for the example

@rchikhi
Copy link
Member Author

rchikhi commented Mar 19, 2016

okay thanks!

@Malfoy
Copy link
Contributor

Malfoy commented Mar 21, 2016

I can't reproduce the error.
But I see a possible reason for bcalm to crash.
I tried a fix, tell me if it work for you.

@rchikhi
Copy link
Member Author

rchikhi commented Mar 25, 2016

Indeed, with this new version, I do not get a valgrind error during the execution anymore!
This bug was unrelated then, but thanks for fixing it.

The crash remains at the end of the execution, however it disappears when bcalm is compiled in debug mode. Valgrind output is not helpful without debug information.

==9529== Invalid read of size 4
==9529==    at 0x7091E2: __tcf_3 (in /home/rayan/bcalm-gatb/build/bcalm)
==9529==    by 0x5CCAB28: __run_exit_handlers (exit.c:82)
==9529==    by 0x5CCAB74: exit (exit.c:104)
==9529==    by 0x5CB4B4B: (below main) (libc-start.c:321)
==9529==  Address 0x8f0109e1b0 is not stack'd, malloc'd or (recently) free'd

Neither is gdb:

Program received signal SIGSEGV, Segmentation fault.
0x00000000007091e2 in __tcf_3 ()
(gdb) bt
#0  0x00000000007091e2 in __tcf_3 ()
#1  0x00007ffff6c0ab29 in __run_exit_handlers (status=0, listp=0x7ffff6f785a8 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true) at exit.c:82
#2  0x00007ffff6c0ab75 in __GI_exit (status=<optimized out>) at exit.c:104
#3  0x00007ffff6bf4b4c in __libc_start_main (main=0x6edf50 <main>, argc=7, argv=0x7fffffffdc18, init=<optimized out>, fini=<optimized out>,
    rtld_fini=<optimized out>, stack_end=0x7fffffffdc08) at libc-start.c:321
#4  0x00000000006ee9cf in _start ()

I'm on it.

@rchikhi rchikhi assigned Malfoy and rchikhi and unassigned Malfoy Mar 25, 2016
@rchikhi
Copy link
Member Author

rchikhi commented Mar 25, 2016

it was related to a call in initBinSeq, that I just commented out because we don't use binSeq at the moment.

@rchikhi rchikhi closed this as completed Mar 25, 2016
@Ritu-Kundu Ritu-Kundu mentioned this issue Mar 1, 2018
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