- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have been using icc for years and is now upgrading to icx 2021.3. Of course my code starts crashing.
Now somewhere in my code I does something like
s = calloc(1,sizeof(mystructtype));
/* some innocent code */
s->f = NULL; /* It crashes both on Windows and Linux 64bit. */
It seems to be an alignment issue of s but I am not sure. That code using the classic 19.1 compiler works perfectly. So I wonder if there is something special for the Clang based compiler regarding structs.
I know it is hard for you to say anything wise, but maybe a bells ring.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have worked on it but have not had success yet. Sorry.
I will accept this an answer and get back if I figure something out.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for reaching out to us.
We have tried with the attached sample code using the icx 2021.3 compiler on Windows and Linux machines, but we didn't find any issues. Please refer to the screenshots attached.
Since we are not able to reproduce your issue at our end, could you please provide us a sample reproducer code along with the steps to reproduce your issue?
>>"s->f = NULL; /* It crashes both on Windows and Linux 64bit. */"
Could you please provide us a log/screenshot of the error encountered?
Thanks & Regards,
Santosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am working on a example code. It seems to happen if I allocate s such that
s%64==8
That is my hypothesis. Will keep you posted if I succeed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One more observation:
-
If I compile everything with '-O0' it does not crash.
-
If I compile with '-O1' it crashes on an aligned store. Except if I add a printf just before the line that segfaults, then it works.
Seems like it must be some sort of compiler bug.
Otherwise there are some assumptions about the alignment of structs when optimization is enabled. But that seems strange to me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
We have tried compiling the sample code(attached in my previous post) with the options "-O0", "-O1", and "-O2". But, we didn't face any such crash issues.
So, could you please provide us a sample reproducer code? It would be helpful for us to investigate more on your issue.
Best Regards,
Santosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have worked on it but have not had success yet. Sorry.
I will accept this an answer and get back if I figure something out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Sure, you can take your own time to get back to us.
Whenever it is possible for you to provide a sample reproducer, feel free to post a new question. We would be more than happy to help you there.
For the time being, we are closing this thread. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.
Thanks & Regards,
Santosh
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page