473,397 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

/OPT:REF in mixed assemblies

Hi,

Sorry for the long post, it's a bit epic (and sums up the last 10 hours of
my life, apart from my car's gearbox melting).

We've got a mixed C++ assembly that's exhibiting odd behaviour when the
/OPT:REF (remove unreferenced data) linker option is set. We first noticed
the problem after removing the /DEBUG option (which silently alters the
defaults for the /OPT option) and assumed that was the cause for a few hours
until I read the documentation (ahem).

Having done some more checks, it definitely appears /OPT:REF is the cause
(eliminating COMDATs has does not cause the strange behaviour). The
application crashes with an access violation that's always in the same place
for a particular codebase, but changing something (like changing a
function's argument from taking a const reference to taking a copy) alters
the location of the crash slightly.

The only symptom we have is a boost::shared_ptr which appears not to be
valid in a piece of code that executes perfectly without /OPT:REF and falls
over with it. However, the debugger is behaving less than reliably in the
area of the crash even when /OPT:REF is not set, so I'm not sure that the
shared_ptr is damaged at all.

So, to recap:
/OPT:REF causes the program to exhibit the symptoms (although we've no way
to check if this is a problem with /OPT:REF, or simply a knock on effect of
this linker flag). We don't know what's causing it, and the only suspicious
thing we can find is what happens in the function outlined above.

Has anyone had any experience with problems like this? And does anyone have
any clues as to where we should go? We're loath just to turn off /OPT:REF
since I think it's going to pop up and bite us at some point. I will have a
crack at getting a repro case but I may not succeed.

TIA, and again, sorry for the length of the post,

Steve

Nov 17 '05 #1
3 1542
Steve, would you happen to have a repro that we could take a look at?

Thanks,

Kang Su Gatlin
Visual C++ Program Manager

Enter bug reports at:
http://msdn.microsoft.com/feedback

--------------------
| Reply-To: "Steve McLellan" <sjm.NOSPAM AT fixerlabs DOT com>
| From: "Steve McLellan" <sjm.NOSPAM AT fixerlabs DOT com>
| Subject: /OPT:REF in mixed assemblies
| Date: Tue, 10 Aug 2004 18:18:14 +0100

|
| Hi,
|
| Sorry for the long post, it's a bit epic (and sums up the last 10 hours of
| my life, apart from my car's gearbox melting).
|
| We've got a mixed C++ assembly that's exhibiting odd behaviour when the
| /OPT:REF (remove unreferenced data) linker option is set. We first noticed
| the problem after removing the /DEBUG option (which silently alters the
| defaults for the /OPT option) and assumed that was the cause for a few
hours
| until I read the documentation (ahem).
|
| Having done some more checks, it definitely appears /OPT:REF is the cause
| (eliminating COMDATs has does not cause the strange behaviour). The
| application crashes with an access violation that's always in the same
place
| for a particular codebase, but changing something (like changing a
| function's argument from taking a const reference to taking a copy) alters
| the location of the crash slightly.
|
| The only symptom we have is a boost::shared_ptr which appears not to be
| valid in a piece of code that executes perfectly without /OPT:REF and
falls
| over with it. However, the debugger is behaving less than reliably in the
| area of the crash even when /OPT:REF is not set, so I'm not sure that the
| shared_ptr is damaged at all.
|
| So, to recap:
| /OPT:REF causes the program to exhibit the symptoms (although we've no way
| to check if this is a problem with /OPT:REF, or simply a knock on effect
of
| this linker flag). We don't know what's causing it, and the only
suspicious
| thing we can find is what happens in the function outlined above.
|
| Has anyone had any experience with problems like this? And does anyone
have
| any clues as to where we should go? We're loath just to turn off /OPT:REF
| since I think it's going to pop up and bite us at some point. I will have
a
| crack at getting a repro case but I may not succeed.
|
| TIA, and again, sorry for the length of the post,
|
| Steve
|
|
|
|

Nov 17 '05 #2
Hi,

Knew you would ask that :-)

I don't have a simple repro case, just our project (which is fairly large,
and also owned by my company). The code the problem appears to occur in does
not reproduce the behaviour oustide this project, and in any case I think it
looks more like a stack or memory corruption than a problem with any one
section of code. We're also under a bit of a deadline at the moment, so I
don't have a lot of time to look at this. I did try creating a small repro
project but it didn't cause the problem. This deadline should be out of the
way in a couple of weeks, so I may revisit it then.

Thanks,

Steve

"Kang Su Gatlin [MS]" <ka******@microsoft.com> wrote in message
news:Tu**************@cpmsftngxa06.phx.gbl...
Steve, would you happen to have a repro that we could take a look at?

Thanks,

Kang Su Gatlin
Visual C++ Program Manager

Enter bug reports at:
http://msdn.microsoft.com/feedback

--------------------
| Reply-To: "Steve McLellan" <sjm.NOSPAM AT fixerlabs DOT com>
| From: "Steve McLellan" <sjm.NOSPAM AT fixerlabs DOT com>
| Subject: /OPT:REF in mixed assemblies
| Date: Tue, 10 Aug 2004 18:18:14 +0100

|
| Hi,
|
| Sorry for the long post, it's a bit epic (and sums up the last 10 hours of | my life, apart from my car's gearbox melting).
|
| We've got a mixed C++ assembly that's exhibiting odd behaviour when the
| /OPT:REF (remove unreferenced data) linker option is set. We first noticed | the problem after removing the /DEBUG option (which silently alters the
| defaults for the /OPT option) and assumed that was the cause for a few
hours
| until I read the documentation (ahem).
|
| Having done some more checks, it definitely appears /OPT:REF is the cause | (eliminating COMDATs has does not cause the strange behaviour). The
| application crashes with an access violation that's always in the same
place
| for a particular codebase, but changing something (like changing a
| function's argument from taking a const reference to taking a copy) alters | the location of the crash slightly.
|
| The only symptom we have is a boost::shared_ptr which appears not to be
| valid in a piece of code that executes perfectly without /OPT:REF and
falls
| over with it. However, the debugger is behaving less than reliably in the | area of the crash even when /OPT:REF is not set, so I'm not sure that the | shared_ptr is damaged at all.
|
| So, to recap:
| /OPT:REF causes the program to exhibit the symptoms (although we've no way | to check if this is a problem with /OPT:REF, or simply a knock on effect
of
| this linker flag). We don't know what's causing it, and the only
suspicious
| thing we can find is what happens in the function outlined above.
|
| Has anyone had any experience with problems like this? And does anyone
have
| any clues as to where we should go? We're loath just to turn off /OPT:REF | since I think it's going to pop up and bite us at some point. I will have a
| crack at getting a repro case but I may not succeed.
|
| TIA, and again, sorry for the length of the post,
|
| Steve
|
|
|
|

Nov 17 '05 #3
OK, feel free to email me directly when you get the time.

Thanks,

Kang Su Gatlin
Visual C++ Program Manager

File Bugs at: http://msdn.microsoft.com/feedback
--------------------
| Reply-To: "Steve McLellan" <sjm.NOSPAM AT fixerlabs DOT com>
| From: "Steve McLellan" <sjm.NOSPAM AT fixerlabs DOT com>
| References: <eQ**************@TK2MSFTNGP12.phx.gbl>
<Tu**************@cpmsftngxa06.phx.gbl>
| Subject: Re: /OPT:REF in mixed assemblies

|
| Hi,
|
| Knew you would ask that :-)
|
| I don't have a simple repro case, just our project (which is fairly large,
| and also owned by my company). The code the problem appears to occur in
does
| not reproduce the behaviour oustide this project, and in any case I think
it
| looks more like a stack or memory corruption than a problem with any one
| section of code. We're also under a bit of a deadline at the moment, so I
| don't have a lot of time to look at this. I did try creating a small repro
| project but it didn't cause the problem. This deadline should be out of
the
| way in a couple of weeks, so I may revisit it then.
|
| Thanks,
|
| Steve
|
| "Kang Su Gatlin [MS]" <ka******@microsoft.com> wrote in message
| news:Tu**************@cpmsftngxa06.phx.gbl...
| > Steve, would you happen to have a repro that we could take a look at?
| >
| > Thanks,
| >
| > Kang Su Gatlin
| > Visual C++ Program Manager
| >
| > Enter bug reports at:
| > http://msdn.microsoft.com/feedback
| >
| > --------------------
| > | Reply-To: "Steve McLellan" <sjm.NOSPAM AT fixerlabs DOT com>
| > | From: "Steve McLellan" <sjm.NOSPAM AT fixerlabs DOT com>
| > | Subject: /OPT:REF in mixed assemblies
| > | Date: Tue, 10 Aug 2004 18:18:14 +0100
| >
| > |
| > | Hi,
| > |
| > | Sorry for the long post, it's a bit epic (and sums up the last 10
hours
| of
| > | my life, apart from my car's gearbox melting).
| > |
| > | We've got a mixed C++ assembly that's exhibiting odd behaviour when
the
| > | /OPT:REF (remove unreferenced data) linker option is set. We first
| noticed
| > | the problem after removing the /DEBUG option (which silently alters
the
| > | defaults for the /OPT option) and assumed that was the cause for a few
| > hours
| > | until I read the documentation (ahem).
| > |
| > | Having done some more checks, it definitely appears /OPT:REF is the
| cause
| > | (eliminating COMDATs has does not cause the strange behaviour). The
| > | application crashes with an access violation that's always in the same
| > place
| > | for a particular codebase, but changing something (like changing a
| > | function's argument from taking a const reference to taking a copy)
| alters
| > | the location of the crash slightly.
| > |
| > | The only symptom we have is a boost::shared_ptr which appears not to
be
| > | valid in a piece of code that executes perfectly without /OPT:REF and
| > falls
| > | over with it. However, the debugger is behaving less than reliably in
| the
| > | area of the crash even when /OPT:REF is not set, so I'm not sure that
| the
| > | shared_ptr is damaged at all.
| > |
| > | So, to recap:
| > | /OPT:REF causes the program to exhibit the symptoms (although we've no
| way
| > | to check if this is a problem with /OPT:REF, or simply a knock on
effect
| > of
| > | this linker flag). We don't know what's causing it, and the only
| > suspicious
| > | thing we can find is what happens in the function outlined above.
| > |
| > | Has anyone had any experience with problems like this? And does anyone
| > have
| > | any clues as to where we should go? We're loath just to turn off
| /OPT:REF
| > | since I think it's going to pop up and bite us at some point. I will
| have
| > a
| > | crack at getting a repro case but I may not succeed.
| > |
| > | TIA, and again, sorry for the length of the post,
| > |
| > | Steve
| > |
| > |
| > |
| > |
| >
|
|
|

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Hautzendorfer | last post by:
Hello, I'm currently working on some printing stuff: I have to print out several .xml files using a stylesheet. Therefor I choose the Internetexplorer PlugIn via SHDocVW. My problem: After...
2
by: Kalafiorczyk | last post by:
Good day ladies and gentlemen! I have a short proggie: ----------------------------------------------------------------------- #using <mscorlib.dll> using namespace...
5
by: Hari | last post by:
Guys please help me to solve this strange problem what Iam getting as follows.. Trying to instantiate a global instance of a template class as follows :- when i build this code with debug and...
8
by: Ted Miller | last post by:
Hi folks, I'm looking at moving a large base of C++ code to .Net under tight time constraints. The code runs in mission-critical environments, and I am extremely concerned about the loader lock...
0
by: Bonj | last post by:
Hi I made a console application called ffind.exe. When building, the linker gives the warnings below. I presume they are telling me that it is eliminating functions from the .EXE that I have...
14
by: Steve McLellan | last post by:
Hi, Sorry to repost, but this is becoming aggravating, and causing me a lot of wasted time. I've got a reasonably large mixed C++ project, and after a number of builds (but not a constant...
1
by: Boris | last post by:
When I compile my "mixed-mode" C++ dll in Release mode, I get these warnings - LINK : warning LNK4243: DLL containing objects compiled with /clr is not linked with /NOENTRY; image may not run...
8
by: Bern McCarty | last post by:
We have a large mixed dll that I can never seem to get to link incrementally. Below is the console output. For simplicity I've eliminated some stuff that we normally do when we really link this...
3
by: =?Utf-8?B?RVF1QWw=?= | last post by:
Hi, We have an application developed in VC2005 with mixed code, primarily C++ but using a C# dll for database access (DBUploader), the dll exposes a C++ interface. We are experiencing...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.