Andersbakken / rtags

A client/server indexer for c/c++/objc[++] with integration for Emacs based on clang.
http://www.rtags.net
GNU General Public License v3.0
1.83k stars 252 forks source link

Failed to open /path/to/cache/0/symnames #703

Closed dscole closed 8 years ago

dscole commented 8 years ago

I've been having these issues for a while and finally decided to try and track down what is going on. I just loaded up a large database of ~ 6120 source files. Now I try to run rtags-find-symbol on some constructor and it fails. Emacs' message is "RTags: No results" and when I look at the rdm log I see these errors:

/path/to/rc --current-file=/path/to/file_name.h --no-color -f /path/to/file_name.h:35:3:
Failed to open /spare/local/dcole/rtags/rtags-cache/_spare_local_dcole_dev_/0/usrs (2) 87
/path/to/rc --current-file=/path/to/file_name.h --no-color -F CtorName --definition-only -M 1 --dependency-filter /path/to/file_name.h --wildcard-symbol-names
Failed to open /spare/local/dcole/rtags/rtags-cache/_spare_local_dcole_dev_/0/symnames (2) 87
/path/to/rc --current-file=/path/to/file_name.h --no-color -F CtorName -M 1 --dependency-filter /path/to/file_name.h --wildcard-symbol-names
Failed to open /spare/local/dcole/rtags/rtags-cache/_spare_local_dcole_dev_/0/symnames (2) 87

Any ideas what's going on?

The only thing I can think of is that during the long loading time of the database, I might have tried to query that symbol before the relevant file was parsed.

dscole commented 8 years ago

I don't know what caused this, but restarting the rdm server and triggering a recompilation on the relevant header file (by changing a whitespace and saving the file) made this go away. I'll reopen if this comes up again.

Andersbakken commented 8 years ago

It happens for me sometimes too and I haven't been able to find a good repro for it. If you're able to I'd love to hear about it.

Anders

On Fri, Jun 3, 2016 at 12:22 PM, dscole notifications@github.com wrote:

I don't know what caused this, but restarting the rdm server and triggering a recompilation on the relevant header file made this go away. I'll reopen if this comes up again.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Andersbakken/rtags/issues/703#issuecomment-223670230, or mute the thread https://github.com/notifications/unsubscribe/AAEdSkjHHZMBRWfqfDdEd-UwvYtt0Bjmks5qIH8LgaJpZM4Ir8rK .

baol commented 8 years ago

Same here, it frequently makes rtags unusable on a rather big project, but I could never reproduce it on smaller scale.

dscole commented 8 years ago

I'm currently running the rdm server gdb with a breakpoint at: 342 B *errPtr = "Failed to open: " + path + " " + Location::path(fileId) + ": " + err; and: 344 B error() << "Failed to open" << path << Location::path(fileId) << err;

In the hopes of catching this in the act.

@Andersbakken , do you mind giving a quick explanation of what is supposed to be specifically in the directory '0'? Also, I'm trying to confirm how the rtags database works, so please correct me if I'm wrong. The way I understand it, somewhere (in _project_name_/sources?) there is a map <file_name.cpp> -> <index>. Each index represents a directory _project_name_/<index>/ which holds all the information for that specific <file_name.cpp>. One thing I don't understand is why I have 19084 directories in _project_name_/ when I only loaded about 6000 targets.

Andersbakken commented 8 years ago

Hi

the number corresponds to a file id and 0 is meant to be invalid so this shouldn't really be possible.

The reason you have more dirs than source files is that the headers get a directory each too.

Let me know if you catch it. I've been meaning to do something similar but I can't seem to really get it to happen with any sort of reliability.

Anders

On Mon, Jun 6, 2016 at 8:14 AM, dscole notifications@github.com wrote:

I'm currently running the rdm server gdb with a breakpoint at: 342 B *errPtr = "Failed to open: " + path + " " + Location::path(fileId) + ": " + err; and: 344 B error() << "Failed to open" << path << Location::path(fileId) << err;

In the hopes of catching this in the act.

@Andersbakken https://github.com/Andersbakken , do you mind giving a quick explanation of what is supposed to be specifically in the directory '0'? Also, I'm trying to confirm how the rtags database works, so please correct me if I'm wrong. The way I understand it, somewhere (in _projectname/sources?) there is a map -> . Each index represents a directory _projectname// which holds all the information for that specific . One thing I don't understand is why I have 19084 directories in _projectname/ when I only loaded about 6000 targets.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Andersbakken/rtags/issues/703#issuecomment-223989737, or mute the thread https://github.com/notifications/unsubscribe/AAEdSr4KZ0Y0k3DYHyrhBAcX7N0bu3niks5qJDlIgaJpZM4Ir8rK .

baol commented 8 years ago

Hi, here's what I got running it with an assert for some time. HTH

rdm: ../src/Project.h:346: std::shared_ptr<FileMap<Key, Value> > Project::FileMapScope::openFileMap(Project::FileMapType, uint32_t, Hash<unsigned int, std::shared_ptr<FileMap<Key, Value> > >&, String*) [with Key = String; Value = Set<Location>; uint32_t = unsigned int]: Assertion `!"Failed to open file '0'"' failed.
Caught signal 6
rdm[0x6cbd5d]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x10330)[0x7f7ca0ade330]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37)[0x7f7c9fe01c37]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x148)[0x7f7c9fe05028]
/lib/x86_64-linux-gnu/libc.so.6(+0x2fbf6)[0x7f7c9fdfabf6]
/lib/x86_64-linux-gnu/libc.so.6(+0x2fca2)[0x7f7c9fdfaca2]
rdm(_ZN7Project12FileMapScope11openFileMapI6String3SetI8LocationEEESt10shared_ptrI7FileMapIT_T0_EENS_11FileMapTypeEjR4HashIjSB_EPS2_+0x86a)[0x79c2d4]
rdm(_ZN7Project8openUsrsEjP6String+0xa4)[0x8a1d2e]
rdm(_ZN7Project9findByUsrERK6StringjNS_14DependencyModeE8Location+0x3d3)[0x88fe6f]
rdm(_ZN7Project11findTargetsERK6Symbol+0x373)[0x88f9bf]
rdm(_ZN7Project10findTargetERK6Symbol+0x3b)[0x85b8ad]
rdm(_ZN17FollowLocationJob7executeEv+0x62a)[0x85b3c0]
rdm(_ZN8QueryJob3runERKSt10shared_ptrI10ConnectionE+0x80)[0x8c631a]
rdm(_ZN6Server14followLocationERKSt10shared_ptrI12QueryMessageERKS0_I10ConnectionE+0x1dd)[0x6ef851]
rdm(_ZN6Server18handleQueryMessageERKSt10shared_ptrI12QueryMessageERKS0_I10ConnectionE+0x525)[0x6ef44b]
rdm(_ZN6Server12onNewMessageERKSt10shared_ptrI7MessageERKS0_I10ConnectionE+0xd9)[0x6ec50b]
rdm(_ZNKSt7_Mem_fnIM6ServerFvRKSt10shared_ptrI7MessageERKS1_I10ConnectionEEEclIJS3_S7_EvEEvPS0_DpOT_+0xa0)[0x76d8e2]
rdm(_ZNSt5_BindIFSt7_Mem_fnIM6ServerFvRKSt10shared_ptrI7MessageERKS2_I10ConnectionEEEPS1_St12_PlaceholderILi1EESF_ILi2EEEE6__callIvJOS4_OS8_EJLm0ELm1ELm2EEEET_OSt5tupleIJDpT0_EESt12_Index_tupleIJXspT1_EEE+0xb6)[0x762086]
rdm(_ZNSt5_BindIFSt7_Mem_fnIM6ServerFvRKSt10shared_ptrI7MessageERKS2_I10ConnectionEEEPS1_St12_PlaceholderILi1EESF_ILi2EEEEclIJS4_S8_EvEET0_DpOT_+0x6d)[0x75140f]
rdm(_ZNSt17_Function_handlerIFvSt10shared_ptrI7MessageES0_I10ConnectionEESt5_BindIFSt7_Mem_fnIM6ServerFvRKS2_RKS4_EEPS8_St12_PlaceholderILi1EESH_ILi2EEEEE9_M_invokeERKSt9_Any_dataS2_S4_+0x5e)[0x741552]
rdm(_ZNKSt8functionIFvSt10shared_ptrI7MessageES0_I10ConnectionEEEclES2_S4_+0x91)[0x7ba2c3]
rdm(_ZN6SignalISt8functionIFvSt10shared_ptrI7MessageES1_I10ConnectionEEEEclIIRS3_RS5_EEEvDpOT_+0x11f)[0x7b712b]
rdm(_ZN10Connection15onDataAvailableERKSt10shared_ptrI12SocketClientEO6Buffer+0x34c)[0x7b283a]
rdm(_ZNKSt7_Mem_fnIM10ConnectionFvRKSt10shared_ptrI12SocketClientEO6BufferEEclIIS5_S6_EvEEvPS0_DpOT_+0xa0)[0x7c32a4]
rdm(_ZNSt5_BindIFSt7_Mem_fnIM10ConnectionFvRKSt10shared_ptrI12SocketClientEO6BufferEEPS1_St12_PlaceholderILi1EESD_ILi2EEEE6__callIvJS6_S8_EJLm0ELm1ELm2EEEET_OSt5tupleIJDpT0_EESt12_Index_tupleIJXspT1_EEE+0xb6)[0x7c13fc]
rdm(_ZNSt5_BindIFSt7_Mem_fnIM10ConnectionFvRKSt10shared_ptrI12SocketClientEO6BufferEEPS1_St12_PlaceholderILi1EESD_ILi2EEEEclIJS6_S7_EvEET0_DpOT_+0x6d)[0x7be171]
rdm(_ZNSt17_Function_handlerIFvRKSt10shared_ptrI12SocketClientEO6BufferESt5_BindIFSt7_Mem_fnIM10ConnectionFvS4_S6_EEPSA_St12_PlaceholderILi1EESF_ILi2EEEEE9_M_invokeERKSt9_Any_dataS4_S6_+0x5e)[0x7bba06]
rdm(_ZNKSt8functionIFvRKSt10shared_ptrI12SocketClientEO6BufferEEclES4_S6_+0x70)[0x7f9e04]
rdm(_ZN6SignalISt8functionIFvRKSt10shared_ptrI12SocketClientEO6BufferEEEclIIRS3_S6_EEEvDpOT_+0xed)[0x7f814b]
rdm(_ZN12SocketClient14socketCallbackEii+0x6ea)[0x7f5c1a]
rdm(_ZNKSt7_Mem_fnIM12SocketClientFviiEEclIJijEvEEvPS0_DpOT_+0xa3)[0x7fd975]
rdm(_ZNSt5_BindIFSt7_Mem_fnIM12SocketClientFviiEEPS1_St12_PlaceholderILi1EES6_ILi2EEEE6__callIvJOiOjEJLm0ELm1ELm2EEEET_OSt5tupleIJDpT0_EESt12_Index_tupleIJXspT1_EEE+0xb6)[0x7fbf8a]
rdm(_ZNSt5_BindIFSt7_Mem_fnIM12SocketClientFviiEEPS1_St12_PlaceholderILi1EES6_ILi2EEEEclIJijEvEET0_DpOT_+0x6d)[0x7fa9d1]
rdm(_ZNSt17_Function_handlerIFvijESt5_BindIFSt7_Mem_fnIM12SocketClientFviiEEPS3_St12_PlaceholderILi1EES8_ILi2EEEEE9_M_invokeERKSt9_Any_dataij+0x5c)[0x7f9415]
rdm(_ZNKSt8functionIFvijEEclEij+0x6c)[0x7cb24c]
rdm(_ZN9EventLoop10fireSocketEij+0xc3)[0x7c768d]
rdm(_ZN9EventLoop19processSocketEventsEP11epoll_eventi+0x491)[0x7c7b8b]
rdm(_ZN9EventLoop4execEi+0x2ec)[0x7c7fc4]
rdm(main+0x2766)[0x6d0657]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7f7c9fdecf45]
rdm[0x6cb9b9]
baol commented 8 years ago

And now I have it on gdb.

#0  0x00007ffff5f60c37 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff5f64028 in __GI_abort () at abort.c:89
#2  0x00007ffff5f59bf6 in __assert_fail_base (fmt=0x7ffff60aa3b8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x9e5037 "!\"Failed to open file '0'\"", 
    file=file@entry=0x9e4c24 "../src/Project.h", line=line@entry=346, 
    function=function@entry=0x9e5780 <std::shared_ptr<FileMap<String, Set<Location> > > Project::FileMapScope::openFileMap<String, Set<Location> >(Project::FileMapType, unsigned int, Hash<unsigned int, std::shared_ptr<FileMap<String, Set<Location> > > >&, String*)::__PRETTY_FUNCTION__> "std::shared_ptr<FileMap<Key, Value> > Project::FileMapScope::openFileMap(Project::FileMapType, uint32_t, Hash<unsigned int, std::shared_ptr<FileMap<Key, Value> > >&, String*) [with Key = String; Value"...) at assert.c:92
#3  0x00007ffff5f59ca2 in __GI___assert_fail (assertion=0x9e5037 "!\"Failed to open file '0'\"", file=0x9e4c24 "../src/Project.h", line=346, 
    function=0x9e5780 <std::shared_ptr<FileMap<String, Set<Location> > > Project::FileMapScope::openFileMap<String, Set<Location> >(Project::FileMapType, unsigned int, Hash<unsigned int, std::shared_ptr<FileMap<String, Set<Location> > > >&, String*)::__PRETTY_FUNCTION__> "std::shared_ptr<FileMap<Key, Value> > Project::FileMapScope::openFileMap(Project::FileMapType, uint32_t, Hash<unsigned int, std::shared_ptr<FileMap<Key, Value> > >&, String*) [with Key = String; Value"...) at assert.c:101
#4  0x00000000008355d5 in Project::FileMapScope::openFileMap<String, Set<Location> > (this=0x925e3e0, type=Project::Targets, fileId=0, cache=..., errPtr=0x0) at ../src/Project.h:346
#5  0x0000000000833ead in Project::openTargets (this=0x1442510, fileId=0, err=0x0) at ../src/Project.h:107
#6  0x000000000093daff in <lambda(uint32_t)>::operator()(uint32_t) const (__closure=0x7fffffff7070, dep=0) at ../src/Project.cpp:1588
#7  0x000000000093df52 in findReferences(const Set<Symbol> &, const std::shared_ptr<Project> &, std::function<bool(const Symbol&, const Symbol&)>) (inputs=..., project=
    std::shared_ptr (count 6, weak 3) 0x1442510, filter=...) at ../src/Project.cpp:1608
#8  0x000000000093e3e6 in findReferences(const Symbol &, const std::shared_ptr<Project> &, std::function<bool(const Symbol&, const Symbol&)>, Set<Symbol> *) (in=..., 
    project=std::shared_ptr (count 6, weak 3) 0x1442510, filter=..., inputsPtr=0x0) at ../src/Project.cpp:1676
#9  0x000000000093e600 in Project::findCallers (this=0x1442510, symbol=...) at ../src/Project.cpp:1693
#10 0x0000000000996df8 in ReferencesJob::execute (this=0x7fffffff7880) at ../src/ReferencesJob.cpp:135
#11 0x0000000000976ba7 in QueryJob::run (this=0x7fffffff7880, connection=std::shared_ptr (count 4, weak 2) 0x8b6eb60) at ../src/QueryJob.cpp:281
#12 0x000000000076262d in Server::referencesForLocation (this=0xd113d0, query=std::shared_ptr (count 4, weak 0) 0x8de31f0, conn=std::shared_ptr (count 4, weak 2) 0x8b6eb60)
    at ../src/Server.cpp:1085
#13 0x000000000075e782 in Server::handleQueryMessage (this=0xd113d0, message=std::shared_ptr (count 4, weak 0) 0x8de31f0, conn=std::shared_ptr (count 4, weak 2) 0x8b6eb60)
    at ../src/Server.cpp:662
#14 0x000000000075b805 in Server::onNewMessage (this=0xd113d0, message=std::shared_ptr (count 4, weak 0) 0x8de31f0, connection=std::shared_ptr (count 4, weak 2) 0x8b6eb60)
    at ../src/Server.cpp:334
#15 0x00000000007dfc17 in std::_Mem_fn<void (Server::*)(std::shared_ptr<Message> const&, std::shared_ptr<Connection> const&)>::operator()<std::shared_ptr<Message>, std::shared_ptr<Connection>, void>(Server*, std::shared_ptr<Message>&&, std::shared_ptr<Connection>&&) const (this=0xe11630, __object=0xd113d0) at /usr/include/c++/4.9/functional:569
#16 0x00000000007d130e in std::_Bind<std::_Mem_fn<void (Server::*)(std::shared_ptr<Message> const&, std::shared_ptr<Connection> const&)> (Server*, std::_Placeholder<1>, std::_Placeholder<2>)>::__call<void, std::shared_ptr<Message>&&, std::shared_ptr<Connection>&&, 0ul, 1ul, 2ul>(std::tuple<std::shared_ptr<Message>&&, std::shared_ptr<Connection>&&>&&, std::_Index_tuple<0ul, 1ul, 2ul>) (
    this=0xe11630, __args=<unknown type in /home/maischbe/dev/rtags/build/bin/rdm, CU 0x69dcc, DIE 0x1cdcf4>) at /usr/include/c++/4.9/functional:1264
#17 0x00000000007be7fb in std::_Bind<std::_Mem_fn<void (Server::*)(std::shared_ptr<Message> const&, std::shared_ptr<Connection> const&)> (Server*, std::_Placeholder<1>, std::_Placeholder<2>)>::operator()<std::shared_ptr<Message>, std::shared_ptr<Connection>, void>(std::shared_ptr<Message>&&, std::shared_ptr<Connection>&&) (this=0xe11630) at /usr/include/c++/4.9/functional:1323
#18 0x00000000007ae329 in std::_Function_handler<void (std::shared_ptr<Message>, std::shared_ptr<Connection>), std::_Bind<std::_Mem_fn<void (Server::*)(std::shared_ptr<Message> const&, std::shared_ptr<Connection> const&)> (Server*, std::_Placeholder<1>, std::_Placeholder<2>)> >::_M_invoke(std::_Any_data const&, std::shared_ptr<Message>, std::shared_ptr<Connection>) (__functor=..., 
    __args#0=std::shared_ptr (count 4, weak 0) 0x8de31f0, __args#1=std::shared_ptr (count 4, weak 2) 0x8b6eb60) at /usr/include/c++/4.9/functional:2039
#19 0x00000000008552eb in std::function<void (std::shared_ptr<Message>, std::shared_ptr<Connection>)>::operator()(std::shared_ptr<Message>, std::shared_ptr<Connection>) const (this=0x8b3ae28, 
    __args#0=std::shared_ptr (empty) 0x0, __args#1=std::shared_ptr (empty) 0x0) at /usr/include/c++/4.9/functional:2439
---Type <return> to continue, or q <return> to quit---
#20 0x0000000000852173 in Signal<std::function<void (std::shared_ptr<Message>, std::shared_ptr<Connection>)> >::operator()<std::shared_ptr<Message>&, std::shared_ptr<Connection>&>(std::shared_ptr<Message>&, std::shared_ptr<Connection>&) (this=0x8b6ebb8) at ../src/rct/rct/SignalSlot.h:70
#21 0x000000000084d6b0 in Connection::onDataAvailable(std::shared_ptr<SocketClient> const&, Buffer&&) (this=0x8b6eb60, 
    buf=<unknown type in /home/maischbe/dev/rtags/build/bin/rdm, CU 0x4efe77, DIE 0x533291>) at ../src/rct/rct/Connection.cpp:151
#22 0x000000000085ea2f in std::_Mem_fn<void (Connection::*)(std::shared_ptr<SocketClient> const&, Buffer&&)>::operator()<std::shared_ptr<SocketClient> const&, Buffer, void>(Connection*, std::shared_ptr<SocketClient> const&, Buffer&&) const (this=0x8d6c800, __object=0x8b6eb60) at /usr/include/c++/4.9/functional:569
#23 0x000000000085c9fc in std::_Bind<std::_Mem_fn<void (Connection::*)(std::shared_ptr<SocketClient> const&, Buffer&&)> (Connection*, std::_Placeholder<1>, std::_Placeholder<2>)>::__call<void, std::shared_ptr<SocketClient> const&, Buffer&&, 0ul, 1ul, 2ul>(std::tuple<std::shared_ptr<SocketClient> const&, Buffer&&>&&, std::_Index_tuple<0ul, 1ul, 2ul>) (this=0x8d6c800, 
    __args=<unknown type in /home/maischbe/dev/rtags/build/bin/rdm, CU 0x4efe77, DIE 0x541409>) at /usr/include/c++/4.9/functional:1264
#24 0x000000000085969f in std::_Bind<std::_Mem_fn<void (Connection::*)(std::shared_ptr<SocketClient> const&, Buffer&&)> (Connection*, std::_Placeholder<1>, std::_Placeholder<2>)>::operator()<std::shared_ptr<SocketClient> const&, Buffer, void>(std::shared_ptr<SocketClient> const&, Buffer&&) (this=0x8d6c800) at /usr/include/c++/4.9/functional:1323
#25 0x0000000000856b53 in std::_Function_handler<void (std::shared_ptr<SocketClient> const&, Buffer&&), std::_Bind<std::_Mem_fn<void (Connection::*)(std::shared_ptr<SocketClient> const&, Buffer&&)> (Connection*, std::_Placeholder<1>, std::_Placeholder<2>)> >::_M_invoke(std::_Any_data const&, std::shared_ptr<SocketClient> const&, Buffer&&) (__functor=..., 
    __args#0=std::shared_ptr (count 2, weak 1) 0x8e501e0, __args#1=<unknown type in /home/maischbe/dev/rtags/build/bin/rdm, CU 0x4efe77, DIE 0x53bbf9>) at /usr/include/c++/4.9/functional:2039
#26 0x0000000000897b9c in std::function<void (std::shared_ptr<SocketClient> const&, Buffer&&)>::operator()(std::shared_ptr<SocketClient> const&, Buffer&&) const (this=0x8af4a98, 
    __args#0=std::shared_ptr (count 2, weak 1) 0x8e501e0, __args#1=<unknown type in /home/maischbe/dev/rtags/build/bin/rdm, CU 0x615e15, DIE 0x64816f>) at /usr/include/c++/4.9/functional:2439
#27 0x0000000000895f14 in Signal<std::function<void (std::shared_ptr<SocketClient> const&, Buffer&&)> >::operator()<std::shared_ptr<SocketClient>&, Buffer>(std::shared_ptr<SocketClient>&, Buffer&&) (this=0x8e50218) at ../src/rct/rct/SignalSlot.h:70
#28 0x0000000000893a9b in SocketClient::socketCallback (this=0x8e501e0, f=23, mode=1) at ../src/rct/rct/SocketClient.cpp:644
#29 0x000000000089bfdf in std::_Mem_fn<void (SocketClient::*)(int, int)>::operator()<int, unsigned int, void>(SocketClient*, int&&, unsigned int&&) const (this=0x1074c40, __object=0x8e501e0)
    at /usr/include/c++/4.9/functional:569
#30 0x000000000089a226 in std::_Bind<std::_Mem_fn<void (SocketClient::*)(int, int)> (SocketClient*, std::_Placeholder<1>, std::_Placeholder<2>)>::__call<void, int&&, unsigned int&&, 0ul, 1ul, 2ul>(std::tuple<int&&, unsigned int&&>&&, std::_Index_tuple<0ul, 1ul, 2ul>) (this=0x1074c40, __args=<unknown type in /home/maischbe/dev/rtags/build/bin/rdm, CU 0x615e15, DIE 0x64a88f>)
    at /usr/include/c++/4.9/functional:1264
#31 0x0000000000898855 in std::_Bind<std::_Mem_fn<void (SocketClient::*)(int, int)> (SocketClient*, std::_Placeholder<1>, std::_Placeholder<2>)>::operator()<int, unsigned int, void>(int&&, unsigned int&&) (this=0x1074c40) at /usr/include/c++/4.9/functional:1323
#32 0x0000000000897189 in std::_Function_handler<void (int, unsigned int), std::_Bind<std::_Mem_fn<void (SocketClient::*)(int, int)> (SocketClient*, std::_Placeholder<1>, std::_Placeholder<2>)> >::_M_invoke(std::_Any_data const&, int, unsigned int) (__functor=..., __args#0=23, __args#1=1) at /usr/include/c++/4.9/functional:2039
#33 0x00000000008672ce in std::function<void (int, unsigned int)>::operator()(int, unsigned int) const (this=0x7fffffffc450, __args#0=23, __args#1=1) at /usr/include/c++/4.9/functional:2439
#34 0x0000000000863717 in EventLoop::fireSocket (this=0xd106f0, fd=23, mode=1) at ../src/rct/rct/EventLoop.cpp:694
#35 0x0000000000863c16 in EventLoop::processSocketEvents (this=0xd106f0, events=0x7fffffffc610, eventCount=1) at ../src/rct/rct/EventLoop.cpp:833
#36 0x0000000000864050 in EventLoop::exec (this=0xd106f0, timeoutTime=-1) at ../src/rct/rct/EventLoop.cpp:951
#37 0x000000000073e593 in main (argc=1, argv=0x7fffffffdbe8) at ../src/rdm.cpp:886
Andersbakken commented 8 years ago

That is quite useful. It seems to imply to me that there's a node with fileId 0 in the mDependencies. Not sure if you still have gdb open but if you do. Any chance you could see if you could get to the value (type DependencyNode *) for the key: 0 in project->mDependencies.

If you can, it would be nice to know if its fileId matches the key (e.g. if it is 0) and if it has any dependents or includes. I've added an additional assert that tries to catch this but more likely the bug happened at an earlier stage. I will try to add additional asserts to catch when this might have happened.

Anders

On Wed, Jun 15, 2016 at 2:48 AM, baol notifications@github.com wrote:

And now I have it on gdb.

0 0x00007ffff5f60c37 in

*GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56

1 https://github.com/Andersbakken/rtags/issues/1 0x00007ffff5f64028 in

__GI_abort () at abort.c:89 #2 https://github.com/Andersbakken/rtags/issues/2 0x00007ffff5f59bf6 in __assert_fail_base (fmt=0x7ffff60aa3b8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x9e5037 "!\"Failed to open file '0'\"", file=file@entry=0x9e4c24 "../src/Project.h", line=line@entry=346, function=function@entry=0x9e5780 > > Project::FileMapScope::openFileMap

(Project::FileMapType, unsigned int, Hash > > >&, String_)::__PRETTYFUNCTION> "std::shared_ptr > Project::FileMapScope::openFileMap(Project::FileMapType, uint32_t, Hash > &, String

_) [with Key = String; Value"...) at assert.c:92 #3 https://github.com/Andersbakken/rtags/issues/3 0x00007ffff5f59ca2 in __GI___assertfail (assertion=0x9e5037 "!\"Failed to open file '0'\"", file=0x9e4c24 "../src/Project.h", line=346, function=0x9e5780 > > Project::FileMapScope::openFileMap >(Project::FileMapType, unsigned int, Hash > > >&, String)::_PRETTYFUNCTION> "std::shared_ptr > Project::FileMapScope::openFileMap(Project::FileMapType, uint32_t, Hash >

&, String

_) [with Key = String; Value"...) at assert.c:101 #4 https://github.com/Andersbakken/rtags/issues/4 0x00000000008355d5 in Project::FileMapScope::openFileMap > (this=0x925e3e0, type=Project::Targets, fileId=0, cache=..., errPtr=0x0) at ../src/Project.h:346 #5 https://github.com/Andersbakken/rtags/issues/5 0x0000000000833ead in Project::openTargets (this=0x1442510, fileId=0, err=0x0) at ../src/Project.h:107 #6 https://github.com/Andersbakken/rtags/issues/6 0x000000000093daff in ::operator()(uint32_t) const (__closure=0x7fffffff7070, dep=0) at ../src/Project.cpp:1588 #7 https://github.com/Andersbakken/rtags/issues/7 0x000000000093df52 in findReferences(const Set &, const std::shared_ptr &, std::function) (inputs=..., project= std::shared_ptr (count 6, weak 3) 0x1442510, filter=...) at ../src/Project.cpp:1608 #8 https://github.com/Andersbakken/rtags/issues/8 0x000000000093e3e6 in findReferences(const Symbol &, const std::shared_ptr &, std::function, Set *) (in=..., project=std::shared_ptr (count 6, weak 3) 0x1442510, filter=..., inputsPtr=0x0) at ../src/Project.cpp:1676 #9 https://github.com/Andersbakken/rtags/issues/9 0x000000000093e600 in Project::findCallers (this=0x1442510, symbol=...) at ../src/Project.cpp:1693 #10 https://github.com/Andersbakken/rtags/issues/10 0x0000000000996df8 in ReferencesJob::execute (this=0x7fffffff7880) at ../src/ReferencesJob.cpp:135 #11 https://github.com/Andersbakken/rtags/issues/11 0x0000000000976ba7 in QueryJob::run (this=0x7fffffff7880, connection=std::shared_ptr (count 4, weak 2) 0x8b6eb60) at ../src/QueryJob.cpp:281 #12 https://github.com/Andersbakken/rtags/issues/12 0x000000000076262d in Server::referencesForLocation (this=0xd113d0, query=std::shared_ptr (count 4, weak 0) 0x8de31f0, conn=std::shared_ptr (count 4, weak 2) 0x8b6eb60) at ../src/Server.cpp:1085 #13 https://github.com/Andersbakken/rtags/issues/13 0x000000000075e782 in Server::handleQueryMessage (this=0xd113d0, message=std::shared_ptr (count 4, weak 0) 0x8de31f0, conn=std::shared_ptr (count 4, weak 2) 0x8b6eb60) at ../src/Server.cpp:662 #14 https://github.com/Andersbakken/rtags/issues/14 0x000000000075b805 in Server::onNewMessage (this=0xd113d0, message=std::shared_ptr (count 4, weak 0) 0x8de31f0, connection=std::shared_ptr (count 4, weak 2) 0x8b6eb60) at ../src/Server.cpp:334 #15 https://github.com/Andersbakken/rtags/issues/15 0x00000000007dfc17 in std::_Memfn<void (Server::)(std::shared_ptr const&, std::shared_ptr const&)>::operator()std::shared_ptr<Message, std::sharedptr, void>(Server , std::shared_ptr&&, std::shared_ptr&&) const (this=0xe11630, __object=0xd113d0) at /usr/include/c++/4.9/functional:569 #16 https://github.com/Andersbakken/rtags/issues/16 0x00000000007d130e in std::_Bind<std::_Memfn<void (Server::)(std::shared_ptr const&, std::shared_ptr const&)> (Server

_, std::_Placeholder<1>, std::_Placeholder<2>)>::__call&&, std::shared_ptr&&, 0ul, 1ul, 2ul>(std::tuplestd::shared_ptr<Message&&, std::shared_ptr&&>&&, std::_Index_tuple<0ul, 1ul, 2ul>) ( this=0xe11630, __args=) at /usr/include/c++/4.9/functional:1264 #17 https://github.com/Andersbakken/rtags/issues/17 0x00000000007be7fb in std::_Bind<std::_Memfn<void (Server::)(std::shared_ptr const&, std::sharedptr const&)> (Server , std::_Placeholder<1>, std::_Placeholder<2>)>::operator()std::shared_ptr<Message, std::shared_ptr, void>(std::shared_ptr&&, std::shared_ptr&&) (this=0xe11630) at /usr/include/c++/4.9/functional:1323 #18 https://github.com/Andersbakken/rtags/issues/18 0x00000000007ae329 in std::_Function_handler, std::shared_ptr), std::_Bind<std::_Memfn<void (Server::)(std::shared_ptr const&, std::shared_ptr const&)> (Server

*, std::_Placeholder<1>, std::_Placeholder<2>)>

::_M_invoke(std::_Any_data const&, std::shared_ptr, std::shared_ptr) (functor=..., args#0=std::shared_ptr (count 4, weak 0) 0x8de31f0, args#1=std::shared_ptr (count 4, weak 2) 0x8b6eb60) at /usr/include/c++/4.9/functional:2039 #19 https://github.com/Andersbakken/rtags/issues/19 0x00000000008552eb in std::function, std::shared_ptr)>::operator()(std::shared_ptr, std::shared_ptr) const (this=0x8b3ae28, args#0=std::shared_ptr (empty) 0x0, __args#1=std::shared_ptr (empty) 0x0) at /usr/include/c++/4.9/functional:2439 ---Type to continue, or q to quit---

20 https://github.com/Andersbakken/rtags/issues/20 0x0000000000852173 in

Signal, std::shared_ptr)> >::operator()std::shared_ptr<Message&, std::shared_ptr&>(std::shared_ptr&, std::shared_ptr&) (this=0x8b6ebb8) at ../src/rct/rct/SignalSlot.h:70 #21 https://github.com/Andersbakken/rtags/issues/21 0x000000000084d6b0 in Connection::onDataAvailable(std::shared_ptr const&, Buffer&&) (this=0x8b6eb60, buf=) at ../src/rct/rct/Connection.cpp:151 #22 https://github.com/Andersbakken/rtags/issues/22 0x000000000085ea2f in std::_Mem_fn<void (Connection::*)(std::shared_ptr const&, Buffer&&)>::operator()std::sharedptr<SocketClient const&, Buffer, void>(Connection , std::shared_ptr const&, Buffer&&) const (this=0x8d6c800, __object=0x8b6eb60) at /usr/include/c++/4.9/functional:569 #23 https://github.com/Andersbakken/rtags/issues/23 0x000000000085c9fc in std::_Bind<std::_Memfn<void (Connection::)(std::shared_ptr const&, Buffer&&)> (Connection

_, std::_Placeholder<1>, std::_Placeholder<2>)>::__call const&, Buffer&&, 0ul, 1ul, 2ul>(std::tuplestd::shared_ptr<SocketClient const&, Buffer&&>&&, std::_Index_tuple<0ul, 1ul, 2ul>) (this=0x8d6c800, __args=) at /usr/include/c++/4.9/functional:1264 #24 https://github.com/Andersbakken/rtags/issues/24 0x000000000085969f in std::_Bind<std::_Memfn<void (Connection::)(std::sharedptr const&, Buffer&&)> (Connection , std::_Placeholder<1>, std::_Placeholder<2>)>::operator()std::shared_ptr<SocketClient const&, Buffer, void>(std::shared_ptr const&, Buffer&&) (this=0x8d6c800) at /usr/include/c++/4.9/functional:1323 #25 https://github.com/Andersbakken/rtags/issues/25 0x0000000000856b53 in std::_Function_handler const&, Buffer&&), std::_Bind<std::_Memfn<void (Connection::)(std::shared_ptr const&, Buffer&&)> (Connection

*, std::_Placeholder<1>, std::_Placeholder<2>)>

::_M_invoke(std::_Any_data const&, std::shared_ptr const&, Buffer&&) (functor=..., args#0=std::shared_ptr (count 2, weak 1) 0x8e501e0, args#1=) at /usr/include/c++/4.9/functional:2039 #26 https://github.com/Andersbakken/rtags/issues/26 0x0000000000897b9c in std::function const&, Buffer&&)>::operator()(std::shared_ptr const&, Buffer&&) const (this=0x8af4a98, __args#0=std::shared_ptr (count 2, weak 1) 0x8e501e0, args#1=) at /usr/include/c++/4.9/functional:2439 #27 https://github.com/Andersbakken/rtags/issues/27 0x0000000000895f14 in Signal const&, Buffer&&)> >::operator()std::shared_ptr<SocketClient&, Buffer>(std::shared_ptr&, Buffer&&) (this=0x8e50218) at ../src/rct/rct/SignalSlot.h:70 #28 https://github.com/Andersbakken/rtags/issues/28 0x0000000000893a9b in SocketClient::socketCallback (this=0x8e501e0, f=23, mode=1) at ../src/rct/rct/SocketClient.cpp:644 #29 https://github.com/Andersbakken/rtags/issues/29 0x000000000089bfdf in std::_Mem_fn<void (SocketClient::*)(int, int)>::operator()(SocketClient

_, int&&, unsigned int&&) const (this=0x1074c40, __object=0x8e501e0) at /usr/include/c++/4.9/functional:569 #30 https://github.com/Andersbakken/rtags/issues/30 0x000000000089a226 in std::_Bind<std::_Memfn<void (SocketClient::)(int, int)> (SocketClient

_, std::_Placeholder<1>, std::_Placeholder<2>)>::call(std::tuple&&, std::_Index_tuple<0ul, 1ul, 2ul>) (this=0x1074c40, args=) at /usr/include/c++/4.9/functional:1264 #31 https://github.com/Andersbakken/rtags/issues/31 0x0000000000898855 in std::_Bind<std::_Memfn<void (SocketClient::)(int, int)> (SocketClient _, std::_Placeholder<1>, std::_Placeholder<2>)>::operator()(int&&, unsigned int&&) (this=0x1074c40) at /usr/include/c++/4.9/functional:1323

32 https://github.com/Andersbakken/rtags/issues/32 0x0000000000897189 in

std::_Function_handler<void (int, unsigned int), std::_Bind<std::_Memfn<void (SocketClient::)(int, int)> (SocketClient*, std::_Placeholder<1>, std::_Placeholder<2>)> >::_M_invoke(std::_Any_data const&, int, unsigned int) (functor=..., args#0=23, __args#1=1) at /usr/include/c++/4.9/functional:2039

33 https://github.com/Andersbakken/rtags/issues/33 0x00000000008672ce

in std::function::operator()(int, unsigned int) const (this=0x7fffffffc450, args#0=23, args#1=1) at /usr/include/c++/4.9/functional:2439

34 https://github.com/Andersbakken/rtags/issues/34 0x0000000000863717

in EventLoop::fireSocket (this=0xd106f0, fd=23, mode=1) at ../src/rct/rct/EventLoop.cpp:694

35 https://github.com/Andersbakken/rtags/issues/35 0x0000000000863c16

in EventLoop::processSocketEvents (this=0xd106f0, events=0x7fffffffc610, eventCount=1) at ../src/rct/rct/EventLoop.cpp:833

36 https://github.com/Andersbakken/rtags/issues/36 0x0000000000864050

in EventLoop::exec (this=0xd106f0, timeoutTime=-1) at ../src/rct/rct/EventLoop.cpp:951

37 https://github.com/Andersbakken/rtags/issues/37 0x000000000073e593

in main (argc=1, argv=0x7fffffffdbe8) at ../src/rdm.cpp:886

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Andersbakken/rtags/issues/703#issuecomment-226140202, or mute the thread https://github.com/notifications/unsubscribe/AAEdSjd714fQg-ya5Ep9Hhd3UQqgtDDzks5qL8pkgaJpZM4Ir8rK .

baol commented 8 years ago
(gdb) print mDependencies
$15 = {<std::unordered_map<unsigned int, DependencyNode*, std::hash<unsigned int>, 
std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, DependencyNode*> > >> = 
std::unordered_map with 23859 elements = 
{[0] = 0x9402590, [3654] = 0x76d5740, [18827] = 0x76d55e0, [3615] = 0x76d5480, 
    [18788] = 0x76d5320, [8515] = 0x76d51c0, [23688] = 0x76d5060, [11998] = 0x76d4f00, [19515] = 0x76d4da0, [19732] = 0x76d4c40, [4559] = 0x76d4ae0, 
    [7864] = 0x76d4980, [23037] = 0x76d4820, [23254] = 0x76d46c0, [8081] = 0x76d4560, [15737] = 0x76d4400, [564] = 0x76d42a0, [15776] = 0x76d4140, 
    [603] = 0x76d3fe0, [3016] = 0x76d3e80, [18189] = 0x76d3d20, [18267] = 0x76d3bc0, [3094] = 0x76d3a60, [200] = 0x76d3900, [15373] = 0x76d37a0, 
    [7717] = 0x76d3640, [22890] = 0x76d34e0, [19329] = 0x76d3380, [4156] = 0x76d3220, [15590] = 0x76d30c0, [417] = 0x76d2f60, [23107] = 0x76d2e00, 
    [7934] = 0x76d2ca0, [14842] = 0x76d2b40, [11142] = 0x76d29e0, [14881] = 0x76d2880, [3447] = 0x76d2720, [18620] = 0x76d25c0, [18698] = 0x76d2460, 
    [3525] = 0x76d2300, [11042] = 0x76d21a0, [11003] = 0x76d2040, [18659] = 0x76d1ee0, [3486] = 0x76d1d80, [14703] = 0x76d1c20, [18481] = 0x76d1ac0, 
    [3308] = 0x76d1960, [10825] = 0x76d1800, [10747] = 0x76d16a0, [18403] = 0x76d1540, [3230] = 0x76d13e0, [10786] = 0x76d1280, [18442] = 0x76d1120, 
    [3269] = 0x76d0fc0, [18520] = 0x76d0e60, [3347] = 0x76d0d00, [10864] = 0x76d0ba0, [14502] = 0x76d0a40, [3068] = 0x76d08e0, [18241] = 0x76d0780, 
    [10724] = 0x76d0620, [14920] = 0x76d04c0, [3703] = 0x76d0360, [18876] = 0x76d0200, [18737] = 0x76d00a0, [3564] = 0x76cff40, [11081] = 0x76cfde0, 
    [14998] = 0x76cfc80, [14496] = 0x76cfb20, [10796] = 0x76cf9c0, [14457] = 0x76cf860, [10718] = 0x76cf700, [10953] = 0x76cf5a0, [11032] = 0x76cf440, 
    [18688] = 0x76cf2e0, [3515] = 0x76cf180, [15032] = 0x76cf020, [18910] = 0x76ceec0, [3737] = 0x76ced60, [10580] = 0x76cec00, [2924] = 0x76ceaa0, 
    [18097] = 0x76ce940, [10541] = 0x76ce7e0, [2885] = 0x76ce680, [18058] = 0x76ce520, [11176] = 0x76ce3c0, [22788] = 0x76ce260, [7615] = 0x76ce100, 
    [15132] = 0x76cdfa0, [3659] = 0x76cde40, [18832] = 0x76cdce0, [14600] = 0x76cdb80, [18478] = 0x76cda20, [3305] = 0x76cd8c0, [10822] = 0x76cd760, 
    [18556] = 0x76cd600, [3383] = 0x76cd4a0, [10900] = 0x76cd340, [6409] = 0x76cd1e0, [21582] = 0x76cd080...}, <No data fields>}
baol commented 8 years ago
(gdb) print *(DependencyNode*)0x9402590
$19 = {
  dependents = {<std::unordered_map<unsigned int, DependencyNode*, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, DependencyNode*> > >> = std::unordered_map with 0 elements, <No data fields>}, 
  includes = {<std::unordered_map<unsigned int, DependencyNode*, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, DependencyNode*> > >> = std::unordered_map with 0 elements, <No data fields>}, fileId = 0}
Andersbakken commented 8 years ago

Thanks. I am 99% sure I figured out what happened now. The latest version should have it fixed. Note that you may have to blow away your data directory to reap the benefits.

Anders

On Thu, Jun 16, 2016 at 8:54 AM, baol notifications@github.com wrote:

(gdb) print (DependencyNode)0x9402590 $19 = { dependents = {<std::unordered_map<unsigned int, DependencyNode, std::hash, std::equal_to, std::allocator<std::pair<unsigned int const, DependencyNode> > >> = std::unordered_map with 0 elements, }, includes = {<std::unordered_map<unsigned int, DependencyNode, std::hash, std::equal_to, std::allocator<std::pair<unsigned int const, DependencyNode> > >> = std::unordered_map with 0 elements, }, fileId = 0}

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Andersbakken/rtags/issues/703#issuecomment-226529157, or mute the thread https://github.com/notifications/unsubscribe/AAEdStxdHN-ET9wXqnU7ZwNuCiYCBxq3ks5qMXGfgaJpZM4Ir8rK .

baol commented 8 years ago

Hi, now I get hundreds of warnings [ 1%] 91/8343 ... Couldn't get location for diagnostics InvalidFile 0 100 Warning Couldn't get location for diagnostics InvalidFile 0 100 Warning

baol commented 8 years ago

(btw, even with the warnigs, it seems to be working better than it used to)

Andersbakken commented 8 years ago

Ah . I just took that warning out. It's not really useful I guess.

On Fri, Jun 17, 2016 at 8:33 AM, baol notifications@github.com wrote:

(btw, even with the warnigs, it seems to be working better than it used to)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Andersbakken/rtags/issues/703#issuecomment-226802203, or mute the thread https://github.com/notifications/unsubscribe/AAEdSu0ZOkddZ5zem_BQWW7KfJnmC-Msks5qMr5ggaJpZM4Ir8rK .