MantisBT - Community
View Issue Details
0024868Community[OCCT] OCCT:Visualizationpublic2014-04-23 17:232019-09-04 12:58
Markus 
kgv 
lowminor 
assignedopen 
Windows
[OCCT] 6.7.0 
[OCCT] 7.5.0* 
0024868: Visulization, TKOpenGl - Exception when many views are created
When more than approximately 70 views are created in Draw via vinit, an exception is thrown in the call to
wglCreateContext (aWindowDC);
in
OpenGl_Window::OpenGl_Window (const Handle(OpenGl_Display)& theDisplay,
                              const CALL_DEF_WINDOW& theCWindow,
                              Aspect_RenderingContext theGContext,
                              const Handle(OpenGl_Caps)& theCaps,
                              const Handle(OpenGl_Context)& theShareCtx)

Is this a limitation or a bug?

The behaviour is the same in OCC 6.7.1 beta.

Similar behaviour can also be reproduced with the ImportExportSample (either MFC or CSharp) using menu "Window > New windw" to create new views.
pload VISUALIZATION
for {set i 1} {$i < 1000} { incr i} {puts $i; vinit}



Exception on AMD:
78
An exception was caught 012EBCB8 : Aspect_GraphicDeviceDefinitionError: OpenGl_Window::CreateWindow: 
wglCreateContext failed. Error code: 0
** Exception ** 012EBCB8 : Aspect_GraphicDeviceDefinitionError: OpenGl_Window::CreateWindow: wglCreateContext 
failed. Error code: 0


Exception on Intel:
33
An exception was caught 01BEBCB8 : Aspect_GraphicDeviceDefinitionError: OpenGl_Window::CreateWindow: 
wglShareLists failed. Error code: -1073278755
** Exception ** 01BEBCB8 : Aspect_GraphicDeviceDefinitionError: OpenGl_Window::CreateWindow: wglShareLists 
failed. Error code: -1073278755 
No tags attached.
related to 0022832closed aba Community Not documented limitation of Graphic3d_StructureManager 
related to 0025147closed bugmaster Open CASCADE Visualization, TKOpenGl - support EGL as alternative to GLX 
Issue History
2014-04-23 17:23TimoNew Issue
2014-04-23 17:23TimoAssigned To => san
2014-04-23 17:24TimoDescription Updatedbug_revision_view_page.php?rev_id=7317#r7317
2014-04-23 17:47TimoDescription Updatedbug_revision_view_page.php?rev_id=7318#r7318
2014-04-23 17:48TimoDescription Updatedbug_revision_view_page.php?rev_id=7319#r7319
2014-04-23 17:48TimoSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=7321#r7321
2014-04-23 17:48TimoDescription Updatedbug_revision_view_page.php?rev_id=7322#r7322
2014-04-23 17:48TimoSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=7323#r7323
2014-04-23 17:49TimoDescription Updatedbug_revision_view_page.php?rev_id=7324#r7324
2014-04-23 17:49TimoSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=7325#r7325
2014-04-24 09:20abvNote Added: 0029046
2014-04-24 09:20abvAssigned Tosan => Timo
2014-04-24 09:20abvStatusnew => feedback
2014-04-24 09:20abvRelationship addedrelated to 0022832
2014-04-24 09:23abvNote Edited: 0029046bug_revision_view_page.php?bugnote_id=29046#r7327
2014-04-24 14:27TimoNote Added: 0029058
2014-04-24 14:28TimoAssigned ToTimo => abv
2014-04-24 14:29TimoStatusfeedback => assigned
2014-04-24 14:47kgvAssigned Toabv => kgv
2014-04-24 14:47kgvPrioritynormal => low
2014-04-24 14:47kgvPlatform => Windows
2014-04-24 14:47kgvTarget Version6.7.1 => 6.8.0
2014-04-24 14:47kgvSummaryException when many views are created => Visulization, TKOpenGl - Exception when many views are created
2014-04-24 14:47kgvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=7330#r7330
2014-04-24 14:55kgvNote Added: 0029059
2014-09-29 21:48kgvTarget Version6.8.0 => 7.1.0
2014-09-29 22:29kgvRelationship addedrelated to 0025147
2015-01-19 17:45kgvRelationship addedrelated to 0025552
2016-10-25 09:48kgvTarget Version7.1.0 => 7.2.0
2017-05-31 15:41TimoReporterTimo => Markus
2017-07-20 11:32kgvTarget Version7.2.0 => 7.4.0
2019-09-04 12:58abvTarget Version7.4.0 => 7.5.0*

Notes
(0029046)
abv   
2014-04-24 09:20   
(edited on: 2014-04-24 09:23)
There is limitation of number of views that can be created, currently 100, see http://dev.opencascade.org/doc/refman/html/class_visual3d___view_manager.html [^]

In my experiment using OCCT 6.7.0 vc8 32-bit and OCCT 6.7.1 beta vc10 64-bit it stops exactly on 101-th view:

Draw[1]> pload ALL
Draw[2]> for {set i 1} {$i < 1000} { incr i} {puts $i; vinit}
1
...
100
101
An exception was caught 000007FEEB8FFD38 : Aspect_IdentDefinitionError: GenId Next Error: Available == 0
** Exception ** 000007FEEB8FFD38 : Aspect_IdentDefinitionError: GenId Next Error: Available == 0
Draw[3]> exit

If you confirm that it stops on 101-th view (not 71-th as you reported), I suggest we close this issue as known limitation. If it fails earlier, please try to debug in your environment, as we cannot reproduce it here.

(0029058)
Timo   
2014-04-24 14:27   
It seems it is dependent on the graphics driver.

Until now I had:
ATI FirePro V5800 (driver: 9.3.3.3000), Win 7 Pro

and received the following Draw output:
...
86
An exception was caught 0082F028 : OSD_Exception_ACCESS_VIOLATION: ACCESS VIOLAT
ION at address 0x00000008 during 'READ' operation
** Exception ** 0082F028 : OSD_Exception_ACCESS_VIOLATION: ACCESS VIOLATION at a
ddress 0x00000008 during 'READ' operation

After updating the driver to:
ATI FirePro V5800 (driver: 13.350.1012.0), Win 7 Pro
I received the same output as you.

I tested it still on some other systems.
The result was correct (100 views) on:
- NVIDIA Quadro FX 4600 (driver: 9.18.13.3165), Win 8.1 Pro
- NVIDIA Quadro FX 1600M (driver: 8.17.12.9573), Win 7 Ultimate


There was a problem in the following case:
- Intel HD Graphics 4000 (driver: 9.17.10.2875), Win 8 Pro
Output:
33
An exception was caught 01BEBCB8 : Aspect_GraphicDeviceDefinitionError: OpenGl_W
indow::CreateWindow: wglShareLists failed. Error code: -1073278755
** Exception ** 01BEBCB8 : Aspect_GraphicDeviceDefinitionError: OpenGl_Window::C
reateWindow: wglShareLists failed. Error code: -1073278755
(0029059)
kgv   
2014-04-24 14:55   
The exception looks like limitation of OpenGL driver - there is nothing wrong in OCCT (although it should be checked that code has appropriate checks in case of failure).

However the problem itself can be resolved by re-usage of the single OpenGL context instance across all views (already planned but nowhere announced since this change will make no differenced in most cases, rather than this one accidentally appeared).