division error in sqlite 3.5.9-5
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | Python |
Invalid
|
Undecided
|
Unassigned | |
| | sqlite3 (Debian) |
Fix Released
|
Unknown
|
||
| | sqlite3 (Ubuntu) |
High
|
Unassigned | ||
| | Intrepid |
Undecided
|
Martin Pitt | ||
Bug Description
Binary package hint: libsqlite3-0
Error occur in sqlite3 3.5.9-5 (command line interface) and python 2.5.2-10ubuntu1 (when connect do sqlite db).
When I try divide real number by real or integer sometimes I get null.
Example:
#sqlite3 test.db
SQLite version 3.5.9
Enter ".help" for instructions
sqlite> select 1.0/2;
0.5
sqlite> select 30/2;
15
sqlite> select 30.3/2;
15.15
sqlite> select 30.3/22; ---<------- ERROR
sqlite> select 30.3/2;
15.15
sqlite> select 30.3/3; ---<------- ERROR
sqlite> select 30.3/2;
15.15
sqlite> select 30.3/4;
7.575
sqlite> select 30.3/5; ---<------- ERROR
sqlite> select 30.3/6; ---<------- ERROR
sqlite> select 30.3/7; ---<------- ERROR
sqlite> select 30.3/8;
3.7875
sqlite> select 30.3/9; ---<------- ERROR
sqlite> select 30.3/10; ---<------- ERROR
sqlite> select 30.3/11; ---<------- ERROR
sqlite> select 30.3/12; ---<------- ERROR
sqlite> select 30.3/13; ---<------- ERROR
sqlite> select 30.3/14; ---<------- ERROR
sqlite> select 30.3/14.3; ---<------- ERROR
sqlite> select 30.3/15; ---<------- ERROR
sqlite> select 30.3/16;
1.89375
sqlite> select 30.3/16.0;
1.89375
sqlite> select 30.3/16.5; ---<------- ERROR
sqlite>
Regards
Sep
executive summary prepared by Rolf Leggewie as per https:/
2.1 impact: sqlite3 returns incorrect results, all packages using an sqlite3 backend are possibly affected by them. I know that at least anki (ichi2.net/anki/) is completely unusable in Intrepid because of this bug.
2.2 fix in .dev branch: dunno, but users report that jaunty packages (which are based off the same orig.tar.gz, I think) are not affected. somebody please comment.
2.3 minimal patch: http://
2.4 test case: see original report above
2.5 regression potential: dunno, sorry. somebody please comment here.
Related branches
| Sep870 (sep870) wrote : | #1 |
| KUmo (shiragumo) wrote : | #2 |
Bug and solution confirmed. Please fix.
The following bug seems to be associated.
http://
| miraks (s-mankowski) wrote : | #3 |
| Changed in sqlite3: | |
| status: | New → In Progress |
| Rolf Leggewie (r0lf) wrote : | #4 |
attaching debdiff (untested, but claims to be working as per comment 2) and subscribing u-m-s for sponsorship into Intrepid.
requesting verification that the fix is proper.
| Rolf Leggewie (r0lf) wrote : | #5 |
this is not a python bug.
| Changed in python: | |
| status: | New → Incomplete |
| status: | Incomplete → Invalid |
| Karol Będkowski (karol-bedkowski) wrote : | #6 |
Confirm - patch works ok.
Regards
sep
I confirm the bug.
It affect division, but also addition, multiplication, substraction.
I am sorry, but I am unable to confirm that patch provided by Rolf works.
But I am able to confirm that everything works correctly if compiled from source (outside .deb packaging).
I suspect this bug to affect any debian derivative has the sqlite3_
| KUmo (shiragumo) wrote : | #8 |
patch confirmed
| miraks (s-mankowski) wrote : | #9 |
Do you know when this fix will be officially in ubuntu 8.10 ?
| Rolf Leggewie (r0lf) wrote : | #11 |
I revisited this bug today and installed an Intrepid test environment in virtualbox. I am sorry to say that the patched package from my PPA still exhibits this problem. unsubscibing main sponsors until a proper fix has been found.
BTW, does this happen in Jaunty?
| Sep870 (sep870) wrote : | #12 |
Version 3.5.9-6 from Jaunty works fine.
| miraks (s-mankowski) wrote : | #13 |
Do you know when this fix will be officially in ubuntu 8.10 ?
| Rolf Leggewie (r0lf) wrote : | #14 |
Miraks, that's a rather unintelligent question given the fact that I reported that the compile flag fix is not working. I've yet to see a different fix being put forward.
To answer your question: It'll be in when it's in, maybe never. First a proper and minimal fix needs to be found. Once that is accomplished, an SRU exception will need to be granted. After that, it will take a few days or up to two weeks, I'd say. Right now, don't hold your breath.
BTW, I'm really angry at the two people confirming the patch was working fine when it now turns out they never really tried it.
| miraks (s-mankowski) wrote : | #15 |
Rolf,
Sorry for my unintelligent question, but this bug seems to be the same than:
this one: https:/
this one: http://
and this one: http://
The solution (given by sqlite team) seems to be known: "If it is compiled with the --fast-math option, then sqlite strikes (what we believe to be) a gcc bug".
So, I don't understand why it's not corrected on 8.10 yet. (This is not a criticism, I don't know how to deliver it !)
I insist because I expect the correction to move to kubuntu 8.10.
Sorry again for my question and for my english.
| Sep870 (sep870) wrote : | #16 |
Rolf,
Today I install fresh Intrepid + apt-update. Result - bug as I have reported.
After I install libsqlite3-0 from your PPA and sqlite works fine.
Please - check again.
| Rolf Leggewie (r0lf) wrote : | #17 |
Sep870, thank you for retrying. I only updated the sqlite3 package itself, not the lib during my previous tests. It is indeed correct that the errors in the original report are fixed when installing both the lib and the package itself.
| Rolf Leggewie (r0lf) wrote : | #18 |
updated my debdiff patch so that the upload goes to intrepid-proposed as it should instead of intrepid itself
| description: | updated |
| Rolf Leggewie (r0lf) wrote : | #19 |
I support the nomination to upload a patched version to intrepid-proposed.
| Changed in sqlite3: | |
| importance: | Undecided → High |
| description: | updated |
| Martin Pitt (pitti) wrote : | #20 |
I confirm that I can reproduce this in intrepid, and that Jaunty works fine.
| Changed in sqlite3: | |
| status: | In Progress → Fix Released |
| Martin Pitt (pitti) wrote : | #21 |
I'd rather apply the upstream fix for that instead of fiddling with compiler options:
http://
| Changed in sqlite3: | |
| assignee: | nobody → pitti |
| status: | New → In Progress |
| Martin Pitt (pitti) wrote : | #22 |
Uploaded to intrepid. Steve, please review.
| Steve Langasek (vorlon) wrote : | #23 |
Accepted into intrepid-proposed, please test and give feedback here. Please see https:/
| Changed in sqlite3: | |
| status: | In Progress → Fix Committed |
| Rolf Leggewie (r0lf) wrote : | #24 |
fix verified for intrepid-proposed. Thank you. Please release.
| Launchpad Janitor (janitor) wrote : | #25 |
This bug was fixed in the package sqlite3 - 3.5.9-3ubuntu1
---------------
sqlite3 (3.5.9-3ubuntu1) intrepid-proposed; urgency=low
* Add 05-improve-
divisions on highly optimized x86 code. This fixes empty results when
doing e. g. "select 30.3/22". Patch from upstream
(http://
3.5.9-4 package. (LP: #254228)
-- Martin Pitt <email address hidden> Tue, 27 Jan 2009 10:05:02 +0000
| Changed in sqlite3: | |
| status: | Fix Committed → Fix Released |
| Changed in sqlite3 (Debian): | |
| status: | Unknown → Fix Released |


Solution:
Replace line in debian/rules:
DEB_OPT_FLAG := -O2 -fno-strict- aliasing -DSQLITE_ ENABLE_ COLUMN_ METADATA -DSQLITE_ ENABLE_ FTS3
to:
DEB_OPT_FLAG := -O2 -fno-strict- aliasing -DSQLITE_ ENABLE_ COLUMN_ METADATA -DSQLITE_ ENABLE_ FTS3 -fno-inline- small-functions
[from: http://<email address hidden> /msg35393. html]
Regards
sep