Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » underflow in bool Sql::fetch()
underflow in bool Sql::fetch() [message #17051] Sat, 26 July 2008 19:15 Go to next message
grc3H0219 is currently offline  grc3H0219
Messages: 2
Registered: April 2008
Location: michigan
Junior Member
Hello:
I have been Ultimate++ with sqlite3 for about 4 months and have
found Ultimate++ very easy to use. I am using TheIDE 2008.2
beta 2008-03-24 9:41, Mingw and Windows XP Professional SP2. I have run into a few very minor problems.
The first problem is with bool Sql::fetch() and was mentioned in message #14083.
( http://www.ultimatepp.org/forum/index.php?t=msg&goto=140 91& )
The patch corrected the integer overflow of the positive values.
I am seeing integer overflow(underflow) in negative values such that when t is small compared to starttime and traceslow,
- session.traceslow - cn->starttime
is smaller than -(INT_MAX) and is converted to a large postive number instead the small negative value that it is. This results in the output of all SQL statements to the BugLog file. In bool Sql::Fetch(),

When I convert the
bool Sql::fetch() code: if(t - session.traceslow - cn->starttime > 0)

to: if((float)t - (float)session.traceslow - (float)cn->starttime > 0)

or to: if((signed long long)t - (signed long long)session.traceslow - (signed long long)cn->starttime > 0)

the correct number is generated. The following values are typical numbers
for t,starttime and traceslow on my system:

t: 2076696 starttime: 2147483647 traceslow: 536870911

In SqlSession::SqlSession(),
traceslow = INT_MAX / 4; So, if t is less than INT_MAX / 4, there
will be an integer overflow error.

dw
Re: underflow in bool Sql::fetch() [message #17060 is a reply to message #17051] Sat, 26 July 2008 20:11 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
grc3H0219 wrote on Sat, 26 July 2008 13:15

Hello:
I have been Ultimate++ with sqlite3 for about 4 months and have
found Ultimate++ very easy to use. I am using TheIDE 2008.2
beta 2008-03-24 9:41, Mingw and Windows XP Professional SP2. I have run into a few very minor problems.
The first problem is with bool Sql::fetch() and was mentioned in message #14083.
( http://www.ultimatepp.org/forum/index.php?t=msg&goto=140 91& )
The patch corrected the integer overflow of the positive values.
I am seeing integer overflow(underflow) in negative values such that when t is small compared to starttime and traceslow,
- session.traceslow - cn->starttime
is smaller than -(INT_MAX) and is converted to a large postive number instead the small negative value that it is. This results in the output of all SQL statements to the BugLog file. In bool Sql::Fetch(),

When I convert the
bool Sql::fetch() code: if(t - session.traceslow - cn->starttime > 0)

to: if((float)t - (float)session.traceslow - (float)cn->starttime > 0)

or to: if((signed long long)t - (signed long long)session.traceslow - (signed long long)cn->starttime > 0)

the correct number is generated. The following values are typical numbers
for t,starttime and traceslow on my system:

t: 2076696 starttime: 2147483647 traceslow: 536870911

In SqlSession::SqlSession(),
traceslow = INT_MAX / 4; So, if t is less than INT_MAX / 4, there
will be an integer overflow error.

dw



Which U++ version? I was fixing this issue 3 weeks ago, if I remember well..

If it is not a problem confirmed with latest release (2008.1 final), can you check with it?

Mirek
Re: underflow in bool Sql::fetch() [message #17064 is a reply to message #17051] Sat, 26 July 2008 23:20 Go to previous message
grc3H0219 is currently offline  grc3H0219
Messages: 2
Registered: April 2008
Location: michigan
Junior Member
I was using upp-mingw-2008.2beta . With upp-mingw-2008.1rc2 this
problem has been resolved. Thanks.

dw
Previous Topic: SQLite crashes
Next Topic: FireBird plugin and test program
Goto Forum:
  


Current Time: Sat Apr 27 19:25:06 CEST 2024

Total time taken to generate the page: 0.02657 seconds