{"action":"created","issue":{"url":"https://api.github.com/repos/gmarcais/Jellyfish/issues/53","labels_url":"https://api.github.com/repos/gmarcais/Jellyfish/issues/53/labels{/name}","comments_url":"https://api.github.com/repos/gmarcais/Jellyfish/issues/53/comments","events_url":"https://api.github.com/repos/gmarcais/Jellyfish/issues/53/events","html_url":"https://github.com/gmarcais/Jellyfish/issues/53","id":126350298,"number":53,"title":"jellyfish::cooperative::hash_counter destructor hangs in local scope","user":{"login":"rob-p","id":361470,"avatar_url":"https://avatars.githubusercontent.com/u/361470?v=3","gravatar_id":"","url":"https://api.github.com/users/rob-p","html_url":"https://github.com/rob-p","followers_url":"https://api.github.com/users/rob-p/followers","following_url":"https://api.github.com/users/rob-p/following{/other_user}","gists_url":"https://api.github.com/users/rob-p/gists{/gist_id}","starred_url":"https://api.github.com/users/rob-p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rob-p/subscriptions","organizations_url":"https://api.github.com/users/rob-p/orgs","repos_url":"https://api.github.com/users/rob-p/repos","events_url":"https://api.github.com/users/rob-p/events{/privacy}","received_events_url":"https://api.github.com/users/rob-p/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-01-13T06:23:11Z","updated_at":"2016-01-13T16:02:51Z","closed_at":null,"body":"Hi Guillaume,\r\n\r\n  I'm encountering the following *very* strange issue.  I'm using a hash_counter inside a function to maintain counts for some k-mers and everything is working great.  Until the point where the function should return.  For some reason, the function will never return, and I've deduced that it is because it is waiting on the hash_counter destructor to finish (which it never does).  The process for the program goes into `S` state, and an `strace` reveals the following is what's happening `wait4(-1,`.  Do you have any idea what might be going on here?  Interestingly, if I make a pointer to the hash_counter, and simply don't delete it (so that the memory escapes the scope of the function and \"dangles\"), then the program runs to completion (and, presumably, the normal process cleanup reclaims the memory).  Any thoughts on what might be happening here are greatly appreciated!"},"comment":{"url":"https://api.github.com/repos/gmarcais/Jellyfish/issues/comments/171342953","html_url":"https://github.com/gmarcais/Jellyfish/issues/53#issuecomment-171342953","issue_url":"https://api.github.com/repos/gmarcais/Jellyfish/issues/53","id":171342953,"user":{"login":"rob-p","id":361470,"avatar_url":"https://avatars.githubusercontent.com/u/361470?v=3","gravatar_id":"","url":"https://api.github.com/users/rob-p","html_url":"https://github.com/rob-p","followers_url":"https://api.github.com/users/rob-p/followers","following_url":"https://api.github.com/users/rob-p/following{/other_user}","gists_url":"https://api.github.com/users/rob-p/gists{/gist_id}","starred_url":"https://api.github.com/users/rob-p/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rob-p/subscriptions","organizations_url":"https://api.github.com/users/rob-p/orgs","repos_url":"https://api.github.com/users/rob-p/repos","events_url":"https://api.github.com/users/rob-p/events{/privacy}","received_events_url":"https://api.github.com/users/rob-p/received_events","type":"User","site_admin":false},"created_at":"2016-01-13T16:02:51Z","updated_at":"2016-01-13T16:02:51Z","body":"Sure.  Here is the backtrace running under gdb:\r\n\r\n```\r\nProgram received signal SIGINT, Interrupt.\r\n__lll_lock_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135\r\n135     ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: No such file or directory.\r\n(gdb) bt\r\n#0  __lll_lock_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135\r\n#1  0x00007ffff7bc812e in _L_lock_39 () from /lib/x86_64-linux-gnu/libpthread.so.0\r\n#2  0x00007ffff7bc8068 in __pthread_cond_destroy (cond=0x7fffffffb9e8) at pthread_cond_destroy.c:35\r\n#3  0x00000000004a14bc in jellyfish::cooperative::hash_counter<jellyfish::mer_dna_ns::mer_base_static<unsigned long, 1>, unsigned long, atomic::gcc, allocators::mmap>::~hash_counter() ()\r\n#4  0x00000000004ca627 in bool buildHash<int>(std::string const&, std::string&, unsigned long, unsigned int, std::vector<int, std::allocator<int> >&) ()\r\n#5  0x00000000004cf411 in void indexTranscriptsSA<jellyfish::whole_sequence_parser<jellyfish::stream_manager<__gnu_cxx::__normal_iterator<std::string const*, std::vector<std::string, std::allocator<std::string> > > > > >(jellyfish::whole_sequence_parser<jellyfish::stream_manager<__gnu_cxx::__normal_iterator<std::string const*, std::vector<std::string, std::allocator<std::string> > > > >*, std::string&, bool, std::mutex&) ()\r\n#6  0x00000000004c261f in rapMapSAIndex(int, char**) ()\r\n```"}}