Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation Fault on InlinePass #605

Closed
doe300 opened this issue Mar 31, 2017 · 3 comments
Closed

Segmentation Fault on InlinePass #605

doe300 opened this issue Mar 31, 2017 · 3 comments
Assignees
Labels

Comments

@doe300
Copy link

doe300 commented Mar 31, 2017

The new inline-pass throws Segmentation Fault in InlinePass::CloneAndMapLocals (line 106).
Here the backtrace:

(Suspended : Signal : SIGSEGV:Segmentation fault)	
std::unique_ptr<spvtools::ir::BasicBlock, std::default_delete<spvtools::ir::BasicBlock> >::get() at unique_ptr.h:308 0x7ffff79f6042	
spvtools::ir::UptrVectorIterator<spvtools::ir::BasicBlock, false>::operator->() at iterator.h:66 0x7ffff79f5122	
spvtools::opt::InlinePass::CloneAndMapLocals() at inline_pass.cpp:106 0x7ffff79f0bab	
spvtools::opt::InlinePass::GenInlineCode() at inline_pass.cpp:197 0x7ffff79f1f2e	
spvtools::opt::InlinePass::Inline() at inline_pass.cpp:363 0x7ffff79f2418	
spvtools::opt::InlinePass::ProcessImpl() at inline_pass.cpp:423 0x7ffff79f292d	
spvtools::opt::InlinePass::Process() at inline_pass.cpp:436 0x7ffff79f2a27	
spvtools::opt::PassManager::Run() at pass_manager.cpp:23 0x7ffff79cdee6	
spvtools::Optimizer::Run() at optimizer.cpp:77 0x7ffff79c778c	
runSPRVToolsOptimizer() at SPIRVParser.cpp:124 0x7ffff7953623	
<...more frames...>	

It looks like the error occurs for functions without any body/instructions (e.g. imported functions), in which case callee_block_itr->begin() points to nullptr.

@dneto0
Copy link
Collaborator

dneto0 commented Mar 31, 2017

Thanks for the bug report!
Cc @greg-lunarg
I'll look at this right away as well.

It seems the just-a-function-declaration case was not even on our test suggestions. :-(

@dneto0 dneto0 added the bug label Mar 31, 2017
@dneto0 dneto0 self-assigned this Mar 31, 2017
@dneto0
Copy link
Collaborator

dneto0 commented Mar 31, 2017

Hm. I can't reproduce the problem. Please provide a sample SPIR-V module that reproduces the problem.

@dneto0
Copy link
Collaborator

dneto0 commented Mar 31, 2017

Oh wait. I got it now. An entry point calls an externally linked function. I had to put the two together. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants