473,467 Members | 1,531 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Problems to find out code changes that seems not to lead into a bug but does ?

Hi,

this is an unusual question here, but I think, it is C++ related due to
the fact that my code is written with it.

I have written an ODBC wrapper that - if checked out with my last working
tag - works fine.

I have identified the reason, why the update of a column fails with
updating the column with an empty string. I have corrected it and it runs.

But if I checkout the latest version of all files, I see the corrected code
but it does not work.

I can not explain the why. I don't cope with the code changes.
I tought I can correct the problem in one file and solve the problem.

It seems not.

The problem was an instance - containing a pointer to a memory structure,
that where bound to an ODBC column. The instance was inserted into a container
and this container clones the object instance - therefore the pointer of
the orginal object instance was copied to a new pointer.

The result was, the orginal instance has been destroied and the pointer in it
was reset to p[0] = 0.

Now my questions:

My code is actually corrected in both variants, why can it be, that the error
comes again ?

Can it be that other code areas would be involved ?

I have found a bug with the help of Electric Fence. Is it possible to
use a similar tool under Windows ?

You can find the complete code at http://sourceforge.net/projects/lbdmf/
It is too much to put it here.

Hint: The relevant code is at line 486 in file lbDB.cpp.
The file is located in Basedevelopment/lbDB
The following code is in a loop of amount of columns.

lbErrCodes err = ERR_NONE;
printf("Bind a column\n");
// Create the instance ...
lbBoundColumn* bc = new lbBoundColumn();
bc->setModuleManager(*&manager, __FILE__, __LINE__);
bc->prepareBoundColumn(q, i);
integerKey->setData(i);
UAP(lb_I_Unknown, uk, __FILE__, __LINE__)
UAP(lb_I_KeyBase, key, __FILE__, __LINE__)
bc->queryInterface("lb_I_Unknown", (void**) &uk, __FILE__, __LINE__);
integerKey->queryInterface("lb_I_KeyBase", (void**) &key, __FILE__, __LINE__);
printf("Insert the bound column\n");

// Clones the instance
boundColumns->insert(&uk, &key);
UAP(lb_I_BoundColumn, bc1, __FILE__, __LINE__)
printf("Get the bound column back\n");
bc1 = getBoundColumn(i);

// Avoid the '' by binding the column to the cloned instance.
// Retrieving the column returns a reference, not a clone.
bc1->bindColumn(q, i);

I hope that any can help me with that problem.

Thanks

Lothar
Jul 22 '05 #1
2 1478
Lothar Behrens <lo************@lollisoft.de> spoke thus:
this is an unusual question here, but I think, it is C++ related due to
the fact that my code is written with it.


From a cursory glance, it appears that you have a version control
problem, not a C++ problem. In any case, reading the following URLs
can't hurt:

http://www.slack.net/~shiva/welcome.txt
http://www.parashift.com/c++-faq-lite/

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
Jul 22 '05 #2
Christopher Benson-Manica <at***@nospam.cyberspace.org> wrote in message news:<c5**********@chessie.cirr.com>...
Lothar Behrens <lo************@lollisoft.de> spoke thus:
this is an unusual question here, but I think, it is C++ related due to
the fact that my code is written with it.


From a cursory glance, it appears that you have a version control
problem, not a C++ problem. In any case, reading the following URLs
can't hurt:

http://www.slack.net/~shiva/welcome.txt
http://www.parashift.com/c++-faq-lite/


Hi,

thanks for the link to the FAQ.

It is not a version control problem. Currently I have checked deeply that
the pointer for the bound column is the same. It is.

At least I tried to activate the PostgreSQL ODBC logging functionality.
If activated detailed logs, the problem is away.

I do not have a C++ problem, I have a triky ODBC driver problem.
It would also be a tricky memory overrun, or a stack problem.

Therefore another question:
Where can I find or ask for tools to check my code under Windows ?
Under Linux I found Electric Fence.

Now I will go to a postgreSQL group, that is hopefully vital.

Thanks

Lothar
Jul 22 '05 #3

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

Similar topics

1
by: Tim Haughton | last post by:
Hello, I seem to be encountering a problem that many others have encountered before me. Unfortunately, even the mighty Google seems reluctant to yield any solutions. We are developing some...
14
by: Jim Hubbard | last post by:
Are you up to speed on the difficulties in using the 1.1 .Net framework? Not if you are unaware of the 1,596 issues listed at KBAlertz (http://www.kbalertz.com/technology_3.aspx). If you are...
2
by: Lothar Behrens | last post by:
Hi, this is an unusual question here, but I think, it is C++ related due to the fact that my code is written with it. I have written an ODBC wrapper that - if checked out with my last working...
0
by: ZMan | last post by:
Scenario: This is about debugging server side scripts that make calls to middle-tier business DLLs. The server side scripts are legacy ASP 3.0 pages, and the DLLs are managed DLLs...
2
by: Brian | last post by:
NOTE ALSO POSTED IN microsoft.public.dotnet.framework.aspnet.buildingcontrols I have solved most of my Server Control Collection property issues. I wrote an HTML page that describes all of the...
14
by: multiformity | last post by:
So I have been working on an opensource project for a while, and decided to really try to make it look better after focusing on the functionality most of this time. Up to now, I have simply used a...
8
by: Mike Owen | last post by:
Hi, I am using the following code to send email on a Windows 2003 Web Server: Imports System.Net.Mail ........ Dim msgmail As New MailMessage msgmail.To.Add(New...
9
by: =?Utf-8?B?SG93YXJkIFNtaXRo?= | last post by:
I am using VC++ 6.0 (with SP5 installed). When using WinXP this is with SP2 installed. I am developing an instrumentation system comprising a set of networked PCs connected using TCP/IP TCP links....
30
by: galiorenye | last post by:
Hi, Given this code: A** ppA = new A*; A *pA = NULL; for(int i = 0; i < 10; ++i) { pA = ppA; //do something with pA
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
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...
1
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
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...
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,...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.