Closed ryzom-pipeline closed 8 years ago
Original comment by Cédric Ochs (Bitbucket: [Cédric OCHS](https://bitbucket.org/Cédric OCHS), ).
That's strange, I had another crash but this time related to CLuaManager :( And under Windows too, it crashes :p
Original comment by Cédric Ochs (Bitbucket: [Cédric OCHS](https://bitbucket.org/Cédric OCHS), ).
Do you think it could be related to CPU affinity being using all cores by default ?
Original comment by Meelis Mägi (Bitbucket: [Meelis Mägi](https://bitbucket.org/Meelis Mägi), ).
Sadly that does not seem to be the case. I forced single cpu and it still crashes ;-(
Original comment by Cédric Ochs (Bitbucket: [Cédric OCHS](https://bitbucket.org/Cédric OCHS), ).
Ah ok, thanks for the confirmation :)
Original comment by Meelis Mägi (Bitbucket: [Meelis Mägi](https://bitbucket.org/Meelis Mägi), ).
Porbably found the reason: stack corruption.
nel/src/misc/co_task.cpp: line 284:
_PImpl->_Stack = new uint8[NL_TASK_STACK_SIZE*1024];
so, 8MB stack works (*2 still crashed, so tried slightly higher :-)
Original comment by Cédric Ochs (Bitbucket: [Cédric OCHS](https://bitbucket.org/Cédric OCHS), ).
Haha great job :) So NL_TASK_STACK_SIZE is too small ? Do you know if we have a way to detect the correct size ?
Original comment by Cédric Ochs (Bitbucket: [Cédric OCHS](https://bitbucket.org/Cédric OCHS), ).
I found this for Windows : "The default stack reservation size used by the linker is 1 MB" but NeL still uses NL_TASK_STACK_SIZE in CreateFiber call :(
Original comment by Meelis Mägi (Bitbucket: [Meelis Mägi](https://bitbucket.org/Meelis Mägi), ).
Infact, just allocating larger buffer should of not worked, because later on it still uses old value
_PImpl->_Ctx.uc_stack.ss_sp = _PImpl->_Stack;
_PImpl->_Ctx.uc_stack.ss_size = NL_TASK_STACK_SIZE;
Which leads to possible another bug as stackSize is supposed to be variable to CCoTask constructor (default=NL_TASK_STACK_SIZE) and I take ss_size should be the size of the _Stack.
Original comment by Meelis Mägi (Bitbucket: [Meelis Mägi](https://bitbucket.org/Meelis Mägi), ).
I filled allocated buffer with 0xAA and counted first non 0xAA starting from index 0 (stack should starts from last index).
With 40960 byte byffer, first non 0xAA was found at 10872. Used size 30088. - worked fine the few time I tried it.
With 32768 byte buffer, first was at 2680 giving same size, but that time it crashed after selecting char.
Original comment by Meelis Mägi (Bitbucket: [Meelis Mägi](https://bitbucket.org/Meelis Mägi), ).
Interesting.... this small change makes threaded CCoTask work on linux. Even the comment there agrees with the change ;-)
--- a/code/ryzom/client/src/far_tp.cpp
+++ b/code/ryzom/client/src/far_tp.cpp
@@ -569,7 +569,7 @@
break;
case st_disconnect:
// Far TP part 2: disconnect from the FS and unload shard-specific data (called from farTPmainLoop())
- FarTP.disconnectFromPreviousShard();
+ //FarTP.disconnectFromPreviousShard();
SM_BEGIN_EVENT_TABLE
SM_EVENT(ev_connect, st_reconnect_fs);
@@ -1406,6 +1406,10 @@
{
ConnectionReadySent = false;
LoginSM.pushEvent(CLoginStateMachine::ev_far_tp_main_loop_entered);
+
+ disconnectFromPreviousShard();
+
uint nbRecoSelectCharReceived = 0;
bool welcomeWindow = true;
Non-threaded version stack experiments show 210KB from 1MB "used". Normal usage is around 5KB, but just before char select screen when resources get released and then reloaded, it jumps. Makes no sense.
Original comment by Cédric Ochs (Bitbucket: [Cédric OCHS](https://bitbucket.org/Cédric OCHS), ).
Cool, I'll try this change under Windows too :) Thanks !
Original comment by Cédric Ochs (Bitbucket: [Cédric OCHS](https://bitbucket.org/Cédric OCHS), ).
Fixed: Crash under Linux (patch by Nimetu), fixes #252
Original comment by Cédric Ochs (Bitbucket: [Cédric OCHS](https://bitbucket.org/Cédric OCHS), ).
In fact, it works and I think loading time is even better :)
Original report by Meelis Mägi (Bitbucket: [Meelis Mägi](https://bitbucket.org/Meelis Mägi), ).
That crash can be 'fixed' by disabling thread based CCoTask, editing
NL_USE_THREAD_COTASK
defined incode/nel/src/misc/co_task.cpp
.Still has odd crashes after that tho ;-(