Anope Bug Tracker - Anope Stable (2.0.x series)
View Issue Details
0001706Anope Stable (2.0.x series)[All Projects] Generalpublic2017-06-01 11:502017-06-07 22:13
capitaine 
Adam 
normalcrashalways
closed@100@ 
0001706: Crash after a module update
Anope crashes after a module update, and OperServ MODRELOAD or OperServ MODLIST is done.
1) Update a module
2) Type /OS MODRELOAD or /OS MODLIST
Backtrace

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0 0x0000000000000000 in ?? ()
0000001 0x000000000055a5a6 in Message::Privmsg::Run (this=0x8b9a00, source=..., params=std::vector of length 2, capacity 2 = {...}) at /home/me/anope-2.0.5-source/src/messages.cpp:365
0000002 0x0000000000594679 in Anope::Process (buffer=...) at /home/me/anope-2.0.5-source/src/process.cpp:73
0000003 0x00000000005c3a16 in UplinkSocket::ProcessRead (this=0x93bce0) at /home/me/anope-2.0.5-source/src/uplink.cpp:136
0000004 0x00000000005bc02a in SocketEngine::Process () at /home/me/anope-2.0.5-source/src/socketengines/socketengine_epoll.cpp:112
0000005 0x0000000000553a40 in main (ac=2, av=0x7fffffffdf78, envp=0x7fffffffdf90) at /home/me/anope-2.0.5-source/src/main.cpp:175
No tags attached.
Issue History
2017-06-01 11:50capitaineNew Issue
2017-06-02 22:29AdamNote Added: 0006839
2017-06-06 10:30capitaineNote Added: 0006840
2017-06-06 10:42capitaineNote Edited: 0006840bug_revision_view_page.php?bugnote_id=6840#r201
2017-06-06 22:52AdamNote Added: 0006841
2017-06-07 09:55capitaineNote Added: 0006842
2017-06-07 22:13AdamNote Added: 0006843
2017-06-07 22:13AdamStatusnew => closed
2017-06-07 22:13AdamAssigned To => Adam
2017-06-07 22:13AdamResolutionopen => @100@

Notes
(0006843)
Adam   
2017-06-07 22:13   
On most systems when you load a module the file gets memory mapped. When you use cp to update the file it updates the mapped version of it, because cp doesn't unlink the original file first. This causes it to crash.

There is a install(1) command which will first unlink the target (which is what make install uses) that you could use if you really wanted to install just the one file.
(0006842)
capitaine   
2017-06-07 09:55   
Ok, I see. I mostly do that, in fact, but working on my own modules, I happened to manually copy and thought there was an issue.

Sorry !
(0006841)
Adam   
2017-06-06 22:52   
You should be using make install in order to install the modules. Not copying them yourself. Copying them will do undefined things depending on your system.
(0006840)
capitaine   
2017-06-06 10:30   
(edited on: 2017-06-06 10:42)
Looks like any module to me, with a simple copy as update.
I can reproduce it doing this :

./bin/services --support
cp ./anope-2.0.5-source/build/modules/m_mysql.so ./anope2/lib/modules/m_mysql.so
or
cp ./anope-2.0.5-source/build/modules/unreal4.so ./anope2/lib/modules/unreal4.so

then /OS MODRELOAD on any module (not necessarly the one updated)

(0006839)
Adam   
2017-06-02 22:29   
Is this *any module*? or a specific one? It is easily possible for poorly written modules to cause a behavior like this, if they don't clean up after themselves.