Coder Social home page Coder Social logo

mistake in mp_div about libtommath HOT 6 CLOSED

libtom avatar libtom commented on May 29, 2024
mistake in mp_div

from libtommath.

Comments (6)

czurnieden avatar czurnieden commented on May 29, 2024

Hi Dmitry,

was not able to repeat that error with a normal 64-bit pc.

Would you mind to give us a bit more information? What is your result, the version of libtommath, which OS on which architecture with which compiler?

Christoph Zurnieden

from libtommath.

dmitry-lipetsk avatar dmitry-lipetsk commented on May 29, 2024

Hi

Win10 x64, VS2015 SP3

my clone of libtommath (exact source code) - https://github.com/dmitry-lipetsk/libtommath-for-ibprovider--set01
based on - https://github.com/FirebirdSQL/firebird/tree/master/extern/libtommath

My result - "out of range" error. Valid range: [0...x.used)

In other case, as I understand, you can get the incorrect result of mp_div or AV.

Dmitry Kovalenko

from libtommath.

czurnieden avatar czurnieden commented on May 29, 2024

You do not only want support for a C++ port instead of the original C-code from https://github.com/libtom/libtommath, you also had ported LibTomMath code that was not original in the first place and it is not repeatable with the current version of LibTomMath.

Not a bug.

from libtommath.

dmitry-lipetsk avatar dmitry-lipetsk commented on May 29, 2024

:FACEPALM:

from libtommath.

czurnieden avatar czurnieden commented on May 29, 2024

Several different versions LibTomMath get used in several dozen different applications. Do you want us to support every one of those versions? It is quite normal in any development open to public comments that only the current version(s) get support.

So if you can repeat your problem in the current version and describe your method in such a way and form that others can repeat your test and find the described bug I will happily reopen this issue.

And recall over one hundred sensor packets where I used LibTomMath to implement rational math in a small MCU. So rest assured that will not take any errors in LibTomMath easily because wrong results will cost me much more than just the recall.

from libtommath.

dmitry-lipetsk avatar dmitry-lipetsk commented on May 29, 2024

It was incorrect offer :(

Access after end element - it is mp_div behavior "by design".

For avoid a read after last element ( x.dp[x.used] ) need use other solution.

from libtommath.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.