473,739 Members | 2,602 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

STL bug in VS.NET 2002

Hi everyone,

I use Visual Studio .NET 2002 right now, and I discovered a bug last night
that I have found few references to on the internet. Basically, if you
allocated a null-terminated char array that is 16 bytes or longer to
std::string, it stores garbage into it:

std::string s = "12345678901234 56";

I tried this on .NET 2003 at work, and this bug has been fixed. Indeed, I
stepped into the string code, and found the difference somewhere in
<xstring>.

Anyway, my question is: what do I do? Do I really have to remove 2002 and
install 2003? Is there an bug-free STL implementation that I can download
somewhere and use instead? I have found no mention of this bug on M$ website
(big surprise).

Thank you for your time,

Tony
Jul 19 '05 #1
3 2028
On Sat, 8 Nov 2003 12:38:14 -0500, "Antonio Maiorano"
<ma******@video tron.ca> wrote:
Hi everyone,

I use Visual Studio .NET 2002 right now, and I discovered a bug last night
that I have found few references to on the internet. Basically, if you
allocated a null-terminated char array that is 16 bytes or longer to
std::string, it stores garbage into it:

std::string s = "12345678901234 56";

I tried this on .NET 2003 at work, and this bug has been fixed. Indeed, I
stepped into the string code, and found the difference somewhere in
<xstring>.

Anyway, my question is: what do I do? Do I really have to remove 2002 and
install 2003? Is there an bug-free STL implementation that I can download
somewhere and use instead? I have found no mention of this bug on M$ website
(big surprise).


It's not a bug. Strings 16 characters or shorter are stored in the
object, while longer strings are stored on the heap. The debugger just
doesn't show the heap-allocated strings by default.

--
Be seeing you.
Jul 19 '05 #2

"Antonio Maiorano" <ma******@video tron.ca> wrote in message
news:LR******** *************@w eber.videotron. net...
Hi everyone,

I use Visual Studio .NET 2002 right now, and I discovered a bug last night
that I have found few references to on the internet. Basically, if you
allocated a null-terminated char array that is 16 bytes or longer to
std::string, it stores garbage into it:

std::string s = "12345678901234 56";
What specific code did you use that caused you to come to this
conclusion?

I tried this on .NET 2003 at work, and this bug has been fixed.
I'm not yet convinced you've discovered a bug.
Indeed, I
stepped into the string code, and found the difference somewhere in
<xstring>.
Difference between what and what?

Anyway, my question is: what do I do?
First confirm that there really is a bug.
Do I really have to remove 2002 and
install 2003? Is there an bug-free STL implementation that I can download
somewhere and use instead? I have found no mention of this bug on M$ website (big surprise).


I don't see you referring to any particular 'bug.'
What behavior are you getting with what code that
causes you to cry 'bug'?

-Mike
Jul 19 '05 #3
"Antonio Maiorano" <ma******@video tron.ca> wrote in message
news:LR******** *************@w eber.videotron. net...
I use Visual Studio .NET 2002 right now, and I discovered a bug last night
that I have found few references to on the internet. Basically, if you
allocated a null-terminated char array that is 16 bytes or longer to
std::string, it stores garbage into it:

std::string s = "12345678901234 56";

I tried this on .NET 2003 at work, and this bug has been fixed. Indeed, I
stepped into the string code, and found the difference somewhere in
<xstring>.

Anyway, my question is: what do I do? Do I really have to remove 2002 and
install 2003? Is there an bug-free STL implementation that I can download
somewhere and use instead? I have found no mention of this bug on M$ website (big surprise).


The bug is in the debugger, which fails to display long strings properly.
(We use the Small String Optimization from V7.0 onward.) The strings
themselves are correct.

P.J. Plauger
Dinkumware, Ltd.
www.dinkumware.com
Jul 19 '05 #4

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

Similar topics

2
3037
by: Don Miller | last post by:
I can't seem to find at MS how to detect the 2002 OS vs. 2003 OS for web applications using ASP. This is the only page I could find (http://msdn.microsoft.com/library/en-us/guide_ppc/htm/designing_web_sites_f or_internet_explorer_for_pocket_pc_cheo.asp) and it only tells how to detect 2000 vs. 2002 (and much of the graphic is cutoff on the right). It has the code below but it doesn't tell me how to distinguish between 2002 and 2003...
13
2651
by: Noesis Strategy | last post by:
When I ordered my new laptop, Sony didn't offer Access 2003 in its bundles. Recently, I have begun to design Access databases using an copy of Access 2002 from my previous laptop. It works fine, but I would like to have all the office apps on the same version. So I have a few questions: 1) Is the file format the same as 2002? Can 2002 users read 2003 files? 2) What are the major reasons for upgrading to 2002 ?
3
2125
by: Scott | last post by:
Hi, If we want to compile an Access 2002 database and distribute it to others, will the compiled software run on any PC, like Windows 98, Windows 2000, etc. Also, you don't have to have Access 2002 in order to run it do you? Thanks!
7
3463
by: Wayne Aprato | last post by:
I have several Access 2003 mde databases. When I try to open them in Access 2002 I get the following error: "The Visual Basic for Applications project in the database is corrupt." Interestingly I can open the mdb files of the same 2003 databases in Access 2002 without problems. To my understanding the file formats of 2002 and 2003 are the same and this problem shouldn't exist. And why is it only the mde files that are giving the...
9
2881
by: Rob | last post by:
Scenario: O/S: Win XP Professional Back-end: Access 2002 on network server I have an Access 97 application, in production on our network, that takes appoximately 5 minutes to process monthly data. I find this tolerable. The Access 2002 test version, on the network, takes approximately 50
9
1761
by: StevenH | last post by:
I stumped Can someone assist me with the query for "invoices from 2002 & not from 2004" thanks
5
2175
by: Niklas Uhlin | last post by:
Someone please explain why Session_Start fires multiple times / retains SessionID values between sessions, when you open an ASP.NET page from MS Word. For details of the problem, see below: 1. Create a new C# ASP.NET web application named "demo" and modify Session_Start in Global.asax.cs as follows: protected void Session_Start(Object sender, EventArgs e) { Response.Write("Session_Start event fired at "+
4
1182
by: Jon S via DotNetMonster.com | last post by:
Hi all I've taught myself C# 2002 using VS.NET 2002. I've recently brought myself an ASP.NET 2003 book. I will work through this ASP.NET 2003 using VS.NET 2002 and C# 2002. I don't fully understand the differences between the VS. NET 2002 and VS.NET 2003. Will I restrict myself in any way learning ASP.NET 2003 but only using VS.NET 2002 and C# 2002?
52
9980
by: Neil | last post by:
We are running an Access 2000 MDB with a SQL 7 back end. Our network guy is upgrading to Windows Server 2003 and wants to upgrade Office and SQL Server at the same time. We're moving to SQL Server 2005, and, since he already has licenses for Office Pro 2002, he wants to upgrade to that. I've been saying that we need to upgrade to Access 2003, not 2002, even if Office is kept at 2002. We are also looking to do a fair amount of...
0
2756
by: Sebastian | last post by:
Hello I develop my applications in Access 2002. My development system is running Windows XP SP2 and I have Microsoft Office XP Developer. Microsoft Office XP is at SP3. I used Inno Setup (great product) to install my applications. When the Access Runtime was needed on the system I simply ran 'accessrt.msi' from Microsoft Office Developer discs. When another version of Access (other than Access 2002) was on the system then I simply...
0
8969
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8792
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9479
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9337
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9266
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9209
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8215
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
2
2748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.