Replies: 4 comments 9 replies
-
Strange. Is this with compiler optimizations? In that case it's possible that "the address of the referenced object is different " is only a side effect of some compilation that has confused the debugger, but that the real issue is actually elsewhere. In that case using a Debug build would help. Is there a way you can turn this into something I can reproduce on my end? |
Beta Was this translation helpful? Give feedback.
-
Did you try setting a Data breakpoint in msvc to see when the value at the
memory address is overwritten?
Sent from a mobile device. Excuse my brevity. Kind regards, Thomas
Op do 16 feb. 2023 18:37 schreef Richard Brice ***@***.***>:
… My guess it is a compiler setting issue also. I compared the IfcOpenHouse
settings to my project's and they seem to be identical.
If I do the following, the call to setDefaultHeaderValues() succeeds, but
then it crashes later.
auto& my_header = header();
my_header.file_description().implementation_leve("2:1"); // actually, I replace all header().file_... with my_header.file... but you get the idea
The address of &my_header and &(this->header_) are different.
The call to implementation_level() eventually gets down to setArgument()
at IfcParse.cpp line 1458 if(attributes[i] != 0) with i = 1, evaluates to
true because attributes_[1] = 0x00000000fdfdfdfd. fdfdfdfd is a MSVC
marker for no man's land at the end of an array to guard against buffer
overruns.
Somehow the call to header() shifts pointer by 4 bytes.
I created a very simple analog for my program, but it does not reproduce
the issue.
I'll keep after this. If you can think of anything, let me know.
—
Reply to this email directly, view it on GitHub
<#2777 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAILWV5AGG3SJNOVGKDKM4LWXZQV5ANCNFSM6AAAAAAU5VVSJY>
.
You are receiving this because you commented.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
I finally found a way to recreate the problem in a small project. In the IfcDriver project (the DLL that uses IfcParse.lib) there is a class called
However, if you comment out the I though perhaps this has something to do with the template generated code. To test this idea, I created a new I build IfcParse.lib using visual studio 2022 with boost 1.78 #2524 (comment) and I'm using the 0.7 branch |
Beta Was this translation helpful? Give feedback.
-
I experienced this same issue when moving to v0.8.0. I think I've found the root cause and wanted to share in case someone else has experienced this problem. My application and IfcParse both use the boost libraries. However, I had boost installed in two locations (one for my application and one in the IfcOpenShell file structure). When I made my application use the exact same boost libraries as IfcParse, the issue went away. I think the mixing of different installations of boost was the root cause problem. |
Beta Was this translation helpful? Give feedback.
-
I have been experiencing a weird situation using
IfcParse.lib
from my Windows DLL. A call toIfcHierarchyHelper<Schema> file;
is crashing whensetDefaultHeaderValues()
is called from theIfcFile
constructor.IfcFile::header()
is returning a reference to the wrong address. The address of the referenced object is different thanIfcFile::_header
. The exact line it is crashing on isheader().file_description().implementation_level("2;1");
.Everything worked fine using code from the 0.6 branch a year ago. Now, this is happening. The only difference is I changed my compiler to VS2022. The problem also happens when I use the 0.7 branch.
I know the problem is entirely on my end because the IfcOpenHouse example uses the same
IfcHierarchyHelper<Schema> file;
code and it works just fine.Any ideas as to what could be wrong?
Beta Was this translation helpful? Give feedback.
All reactions