PSOC Creator 4.4 Libclang.dll crash

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
pefa_4425936
Level 2
Level 2
5 replies posted 5 sign-ins First solution authored

Hi. Over the past couple days I’ve been suffering from an issue where my PSOC creator crashes within seconds of typing code.

Upon further investigation, windows event viewer said it was Libclang.dll and the internet said that I could disable semantic parsing to stop the crashing.

that worked except now I might as well be using notepad to code. This is a recent issue. Is there any way to fix this?

0 Likes
1 Solution
pefa_4425936
Level 2
Level 2
5 replies posted 5 sign-ins First solution authored

I FIGURED IT OUT HAHA.

OK. Here's the story. I was getting fancy with my programming. Sorta doing object oriented programming using structs. The issue came with #include-ing two files recursively, which apparently libclang does not know how to handle.

The way I figured it out was by opening up the project in VSCode, which threw an error that a file was #include-ing itself. This made no sense because I had #include guards. It didn't crash like PSoC Programmer, but intellisense (which does the same that libclang does in PSoC Creator) smartly disabled itself for those specific files. With a bit of trial and error, commenting out the includes, intellisense reactivates itself. Then I open up PSoC Creator and its working perfectly again.

For those interested - here's the science behind why it broke.

I have one header file, H1, defining a struct myStruct.

I have another header file, H2, defining functions which take an argument of type myStruct. Obviously I have to include H1 in H2 in order for this to work.

My mistake was including H2 in H1 as well. Even though H1 doesn't use anything in H2. These files are built one at a time, So if H1 is built first, one of the first lines in H1 is to include H2. No problem, the compiler goes and starts building H2, but one of the first lines in H2 is to include H1. And so on and and so on.

I will read this soon, but for those interested in avoiding these problems, apparently this is a good read. http://www.cplusplus.com/forum/articles/10627/

View solution in original post

12 Replies
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

pefa,

It sounds like a Creator support module may have been corrupted.  I recommend reinstalling Creator.

Len
"Engineering is an Art. The Art of Compromise."
0 Likes

Thanks for the suggestion. I’ve already reinstalled two times. Same crash. Interestingly I tried the same project (transported via git) on a different computer and experienced similar crashing. 
I’ve tried a different workspace and copying over my project. Same thing. 

0 Likes

pefa,

Is your system a true Windows environment or is it a Mac or Linux machine running a Windows emulator?

Len
"Engineering is an Art. The Art of Compromise."
0 Likes

True Windows. Up to date.

0 Likes
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi @pefa_4425936

 Can you please let me know if the issue persists with other projects or a new project too? If so, would it be possible to share your project with us?

Thanks and Regards,
Rakshith M B
0 Likes

Other projects yes, it still persists. I tried moving over to a new workspace with a new project and it

Sadly I can’t share the project, since it’s work related. 

0 Likes
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

Although you have already checked this, but the following discussion sounds similar to me.

https://community.cypress.com/t5/PSoC-Creator-Designer/Creator-4-3-closing-itself/m-p/95610

moto

0 Likes

Yes I did see that post,

after reading over it again, I noted that when uninstalling they also deleted some extra files in program files and appdata. I went ahead and uninstalled, deleted the files, and reinstalled. Same issue ;(

0 Likes
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi @pefa_4425936

Can you please try manually installing libclang.dll and let me know if that helps? Additionally, I found this thread in which downloading Visual C++ Redistributable fixed the issue - Impossible to load 'libclang.dll' inside Win 7 VM on Mac OS 
Can you please check if that works for you too?

Thanks and Regards,
Rakshith M B
0 Likes

Thank You, I already saw that thread and reinstalled the  redistributable in question, sadly it did not fix the issue 😞

0 Likes
pefa_4425936
Level 2
Level 2
5 replies posted 5 sign-ins First solution authored

I FIGURED IT OUT HAHA.

OK. Here's the story. I was getting fancy with my programming. Sorta doing object oriented programming using structs. The issue came with #include-ing two files recursively, which apparently libclang does not know how to handle.

The way I figured it out was by opening up the project in VSCode, which threw an error that a file was #include-ing itself. This made no sense because I had #include guards. It didn't crash like PSoC Programmer, but intellisense (which does the same that libclang does in PSoC Creator) smartly disabled itself for those specific files. With a bit of trial and error, commenting out the includes, intellisense reactivates itself. Then I open up PSoC Creator and its working perfectly again.

For those interested - here's the science behind why it broke.

I have one header file, H1, defining a struct myStruct.

I have another header file, H2, defining functions which take an argument of type myStruct. Obviously I have to include H1 in H2 in order for this to work.

My mistake was including H2 in H1 as well. Even though H1 doesn't use anything in H2. These files are built one at a time, So if H1 is built first, one of the first lines in H1 is to include H2. No problem, the compiler goes and starts building H2, but one of the first lines in H2 is to include H1. And so on and and so on.

I will read this soon, but for those interested in avoiding these problems, apparently this is a good read. http://www.cplusplus.com/forum/articles/10627/

pefa,

I'm glad you found the problem.

I'm also glad you troubleshot the issue to the root cause.

The GCC compiler apparently doesn't have strong recursive reference detection.  Instead the compiler probably looped too many times and ran out of stack.  That is what probably caused the "crash".

Len
"Engineering is an Art. The Art of Compromise."
0 Likes