473,698 Members | 2,471 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 2023
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
3031
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
2641
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
2124
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
3457
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
2878
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
1758
by: StevenH | last post by:
I stumped Can someone assist me with the query for "invoices from 2002 & not from 2004" thanks
5
2173
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
1179
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
9968
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
2755
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
8683
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
9170
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
9031
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
8901
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
7739
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...
1
6528
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2336
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.