Bug #1006

Microvegetation Crash

Added by rti about 8 years ago. Updated about 7 years ago.

Status:Assigned Start date:07/05/2010
Priority:High Due date:
Assignee:rti % Done:

50%

Category:OS: Mac
Target version:Version 0.9.0

Description

Enabling Microvegetation on Mac OS X using Cocoa leads to a crash in the OpenGL subsystem.

crash-log.html (63.4 kB) Magnifier Sywindt, 07/04/2011 07:50 pm

client.cfg (1.7 kB) Sywindt, 07/07/2011 04:16 pm

History

#1 Updated by rti almost 8 years ago

#2 Updated by kervala over 7 years ago

PLease could you try to replace the crashing line by :

1glDrawElements(GL_TRIANGLES,3*ntris,GL_UNSIGNED_SHORT, &((uint16 *)0)[((uint16 *) _LastIB._Values)[firstTri]]);

#3 Updated by kervala over 7 years ago

On Apple developer site, there are examples to use glDrawElements with or without VBO :

http://developer.apple.com/library/mac/#samplecode/OpenCL_Procedural_Grass_and_Terrain_Example/Listings/grid_mesh_cpp.html

#4 Updated by rti over 7 years ago

Does not make any difference. :(

The change:

rti@minion .../ryzom-core-repository/code/build-make (hg)-[default] % hg diff
diff -r 50c8101204cc code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp
--- a/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp    Wed Dec 22 01:00:28 2010 +0100
+++ b/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp    Thu Dec 23 14:25:51 2010 +0100
@@ -374,7 +374,8 @@

     if (_LastIB._Format == CIndexBuffer::Indices16)
     {
-        glDrawElements(GL_TRIANGLES,3*ntris,GL_UNSIGNED_SHORT, ((uint16 *) _LastIB._Values)+firstTri);
+        // glDrawElements(GL_TRIANGLES,3*ntris,GL_UNSIGNED_SHORT, ((uint16 *) _LastIB._Values)+firstTri);
+        glDrawElements(GL_TRIANGLES,3*ntris,GL_UNSIGNED_SHORT, &((uint16 *)0)[((uint16 *) _LastIB._Values)[firstTri]]);
     }
     else
     {

The crash

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000
0x00000002000c9969 in glrCompExecuteKernel ()
(gdb) bt
#0  0x00000002000c9969 in glrCompExecuteKernel ()
#1  0x000000011e122bc3 in glDrawElements_ACC_Exec ()
#2  0x000000010bc46d15 in NL3D::CDriverGL::renderSimpleTriangles (this=0x108825800, firstTri=126, ntris=6) at /Users/rti/Code/ryzom-core/ryzom-core-repository/code/nel/src/3d/driver/opengl/driver_opengl_vertex.cpp:378
#3  0x00000001037ee081 in NL3D::CVegetableBlendLayerModel::render (this=0x133c02d40, driver=0x108825800) at /Users/rti/Code/ryzom-core/ryzom-core-repository/code/nel/src/3d/vegetable_blend_layer_model.cpp:125
#4  0x00000001037ee1a0 in NL3D::CVegetableBlendLayerModel::traverseRender (this=0x133c02d40) at /Users/rti/Code/ryzom-core/ryzom-core-repository/code/nel/src/3d/vegetable_blend_layer_model.cpp:150
#5  0x000000010370d422 in NL3D::CRenderTrav::traverse (this=0x1088a6a08, renderPart=6, newRender=false) at /Users/rti/Code/ryzom-core/ryzom-core-repository/code/nel/src/3d/render_trav.cpp:372
#6  0x0000000103716067 in NL3D::CScene::renderPart (this=0x1088a5e10, rp=6, doHrcPass=true) at /Users/rti/Code/ryzom-core/ryzom-core-repository/code/nel/src/3d/scene.cpp:623
#7  0x0000000103732864 in NL3D::CSceneUser::renderPart (this=0x1088a5e00, rp=6) at /Users/rti/Code/ryzom-core/ryzom-core-repository/code/nel/src/3d/scene_user.cpp:529
#8  0x0000000100345230 in renderMainScenePart (renderPart=6) at /Users/rti/Code/ryzom-core/ryzom-core-repository/code/ryzom/client/src/main_loop.cpp:1026
#9  0x0000000100345c76 in renderAll (forceFullDetail=false) at /Users/rti/Code/ryzom-core/ryzom-core-repository/code/ryzom/client/src/main_loop.cpp:1208
#10 0x000000010034a1e4 in mainLoop () at /Users/rti/Code/ryzom-core/ryzom-core-repository/code/ryzom/client/src/main_loop.cpp:2089
#11 0x00000001001c4ee1 in main (argc=1, argv=0x7fff5fbff660) at /Users/rti/Code/ryzom-core/ryzom-core-repository/code/ryzom/client/src/client.cpp:618

#5 Updated by kervala over 7 years ago

Please could you try adding :

glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);

just before the :

glDrawElements(GL_TRIANGLES,3*ntris,GL_UNSIGNED_SHORT, ((uint16 *) _LastIB._Values)+firstTri);

GL_ELEMENT_ARRAY_BUFFER is used nowhere so I suspect it could need to be initialized somewhere.

#6 Updated by kervala over 7 years ago

  • Status changed from New to Validated
  • Priority changed from Normal to High

#7 Updated by rti over 7 years ago

Not sure why I never documented it here, but putting

glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
in there does not help :(

#8 Updated by rti about 7 years ago

  • Status changed from Validated to Resolved
  • % Done changed from 0 to 100

Applied in changeset r1553.

#9 Updated by rti about 7 years ago

  • Assignee set to rti

#10 Updated by Sywindt about 7 years ago

I have a player that reported a crash upon login with a very similar dump: (strangely enough only on 1 character.

Is this the same problem that should have been fixed?

Process:         ryzom_client [527]
Path:            /Applications/Ryzom.app/Contents/MacOS/ryzom_client
Identifier:      com.winchgate.Ryzom
Version:         1.12.1 (1.12.1)
App Item ID:     427774253
App External ID: 3817927
Code Type:       X86-64 (Native)
Parent Process:  launchd [139]

Date/Time:       2011-07-03 12:49:28.405 -0400
OS Version:      Mac OS X 10.6.7 (10J869)
Report Version:  6

Interval Since Last Report:          152871 sec
Crashes Since Last Report:           20
Per-App Interval Since Last Report:  80131 sec
Per-App Crashes Since Last Report:   17
Anonymous UUID:                      8177CAB6-7054-4997-B92A-1FF132AAE75E

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   com.apple.GeForceGLDriver         0x00000002000ca969 glrCompExecuteKernel + 668553
1   GLEngine                          0x0000000118f5fbe3 glDrawElements_ACC_Exec + 902
2   com.winchgate.Ryzom               0x00000001014a3ec0 std::_Rb_tree<std::string, std::pair<std::string const, NL3D::ITextureDrvInfos*>, std::_Select1st<std::pair<std::string const, NL3D::ITextureDrvInfos*> >, std::less<std::string>, std::allocator<std::pair<std::string const, NL3D::ITextureDrvInfos*> > >::_M_insert_unique(std::pair<std::string const, NL3D::ITextureDrvInfos*> const&) + 11472
3   com.winchgate.Ryzom               0x0000000100f6ea87 NL3D::ITransformable::setMatrix(NLMISC::CMatrix const&) + 7223
4   com.winchgate.Ryzom               0x0000000100e8d940 NL3D::CTrackDefaultRGBA::~CTrackDefaultRGBA() + 15776
5   com.winchgate.Ryzom               0x0000000100e937cf NL3D::CRootModel::creator() + 4975
6   com.winchgate.Ryzom               0x0000000100ead83c std::vector<NLMISC::CPolygon, std::allocator<NLMISC::CPolygon> >::_M_fill_insert(__gnu_cxx::__normal_iterator<NLMISC::CPolygon*, std::vector<NLMISC::CPolygon, std::allocator<NLMISC::CPolygon> > >, unsigned long, NLMISC::CPolygon const&) + 8268
7   com.winchgate.Ryzom               0x00000001001f5088 CXDeltaPatch::~CXDeltaPatch() + 8360
8   com.winchgate.Ryzom               0x00000001001f7931 CXDeltaPatch::~CXDeltaPatch() + 18769
9   com.winchgate.Ryzom               0x00000001002000f5 CXDeltaPatch::~CXDeltaPatch() + 53525
10  com.winchgate.Ryzom               0x0000000100063efa std::_Rb_tree<std::string, std::pair<std::string const, CClientConfig::SSysInfoParam>, std::_Select1st<std::pair<std::string const, CClientConfig::SSysInfoParam> >, std::less<std::string>, std::allocator<std::pair<std::string const, CClientConfig::SSysInfoParam> > >::_M_insert_unique(std::_Rb_tree_iterator<std::pair<std::string const, CClientConfig::SSysInfoParam> >, std::pair<std::string const, CClientConfig::SSysInfoParam> const&) + 5914
11  com.winchgate.Ryzom               0x0000000100005854 0x100000000 + 22612

#11 Updated by rti about 7 years ago

I would say this is not related. Could you please post the whole crash report and log file in a new issue?
Where is the character which leads to the client crash?

#12 Updated by rti about 7 years ago

To be absolutely sure wether it is related to Microvegetation or not, you can add

MicroVeget = 0;

to client.cfg

#13 Updated by Sywindt about 7 years ago

Hi rti,

Thanks for your response. The player was in Void, Jungle. Player was was able to login successfully after turning off micro vegetation. So it does seem related. I will attach full log here later today.

#14 Updated by Sywindt about 7 years ago

Crash log attached. client.log has gone missing unfortunately, but didn't contain any relevant errors or exceptions (it just ended)

#15 Updated by rti about 7 years ago

This backtrace is really really fishy... I vote for stack corruption for the following reasons:

  • the bottom of the main thread's stack is not main()
  • calls to destructor ~CXDeltaPatch stack 3 times
  • a call to std::_Rb_tree< [...] <std::string const, NL3D::ITextureDrvInfos*> [...] >::_M_insert_unique() results in a call to glDrawElements_ACC_Exec
    • inserting a pointer and a std::string should really not result in calling GL functionality...
  • CXDeltaPatch code is related to patching, which is not used on Mac OS X and should really not depend on which char is selected

Anyone any idea? This looks really weird to me.. :(

#16 Updated by rti about 7 years ago

Ok, looks like I was wrong again...

I get similar backtraces with the client build from the app store.
So the backtrace should be ok like this... or at least, this should not be due to stack corruption.

Can you provide detailed information how I could reproduce this on my machine?
Exact character position, client.cfg, things like that?

#17 Updated by rti about 7 years ago

velogfx just confirmed it.

crash in "umbra, jungle" at the karavan teleport.
disabling micro vegetation fixed the crash.

http://pastebin.com/VRVWb0DV

#18 Updated by Sywindt about 7 years ago

Crashing location: 10155,-2302

Some observations by player:
- Client only crashes on log in/port in with microveg > 80.

- If log in with microveg = 80 and then change it to 100, there is no problem.

- Once you have crashed, you have to turn off microveg completely to be able to log in again. (So setting it to 70, normally a safe level, does not work)

- Loading screen wait times are much longer in places where there are microveg problems.

#19 Updated by rti about 7 years ago

Thanks a lot for the information! I will try to reproduce the crash at this location on my machine.

Erm.... How can I see my current location as a player?
Can i target a given location by coords with the compass :) ?

#20 Updated by rti about 7 years ago

  • Status changed from Resolved to Assigned
  • % Done changed from 100 to 50

#21 Updated by Sywindt about 7 years ago

On live shards you cannot, on your own shard if you have a privileged account (dev, sgm, gm etc.) you can use /a Position 10155,-2302 to teleport to the relevant location.

Here is the location on the map: http://clip2net.com/clip/m28350/1310077824-clip-44kb.jpg

Also available in: Atom PDF