View Issue Details

IDProjectCategoryView StatusLast Update
0001706Anope Stable (2.0.x series)Generalpublic2017-06-07 22:13
Reportercapitaine Assigned ToAdam  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutioninvalid 
Summary0001706: Crash after a module update
DescriptionAnope crashes after a module update, and OperServ MODRELOAD or OperServ MODLIST is done.
Steps To Reproduce1) Update a module
2) Type /OS MODRELOAD or /OS MODLIST
Additional InformationBacktrace

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
TagsNo tags attached.

Activities

Adam

2017-06-07 22:13

administrator   ~0006843

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.

capitaine

2017-06-07 09:55

reporter   ~0006842

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 !

Adam

2017-06-06 22:52

administrator   ~0006841

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.

capitaine

2017-06-06 10:30

reporter   ~0006840

Last edited: 2017-06-06 10:42

View 2 revisions

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)

Adam

2017-06-02 22:29

administrator   ~0006839

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.

Issue History

Date Modified Username Field Change
2017-06-01 11:50 capitaine New Issue
2017-06-02 22:29 Adam Note Added: 0006839
2017-06-06 10:30 capitaine Note Added: 0006840
2017-06-06 10:42 capitaine Note Edited: 0006840 View Revisions
2017-06-06 22:52 Adam Note Added: 0006841
2017-06-07 09:55 capitaine Note Added: 0006842
2017-06-07 22:13 Adam Note Added: 0006843
2017-06-07 22:13 Adam Status new => closed
2017-06-07 22:13 Adam Assigned To => Adam
2017-06-07 22:13 Adam Resolution open => invalid