473,383 Members | 1,863 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,383 software developers and data experts.

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 1474
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
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.