Jump to content
Markus1201

SwitchToFiber called on NULL-pointer

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

Share this post


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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...