Jump to content

SwitchToFiber called on NULL-pointer


Markus1201

Recommended Posts

Hello!

I'm using Visual Studio 2015 to simulate my design. When it reaches a
specific size, it throws an exception due to dereferencing a
NULL-pointer inside SwitchToFiber. Is there a way to tweak the settings
somehow, to get around this limitation? Also it would be nice to add
some more asserts to catch the error, when creating the Fiber actually
fails.

 

best regards

Markus

Link to post
Share on other sites

Do you mean you've reached a maximum possible fibers limit?

 

According to MS documentation:

https://msdn.microsoft.com/en-us/library/ms682402%28VS.85%29.aspx

 

The number of fibers a process can create is limited by the available virtual memory. For example, if you create each fiber with 1 megabyte of reserved stack space, you can create at most 2028 fibers. If you reduce the default stack size by using the STACKSIZE statement in the module definition (.def) file or by using CreateFiberEx, you can create more fibers.

 

So you have two options:

  1. Increase virtual memory. If you are compiling for 32bit , try switching into 64 bit.
  2. Decrease stack size. Try to decrease stack size using  set_stack_size method (Check SystemC LRM for documentation).

 

Also it would be nice to add some more asserts to catch the error, when creating the Fiber actually fails.

 

 

I agree. Unfortunately there is no SystemC bugtracker to track such requests. So our best hope is that someone from SystemC committee will read this thread and add error checking to CreateFiber call.

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...