Git Product home page Git Product logo

Comments (4)

nickg avatar nickg commented on August 25, 2024

Are they any particular fixed-sized buffers which are causing problems? Some of the ones in src/link.c and src/rt/jit.c could be replaced with xasprintf and a corresponding free (wrapper in src/util.c for asprintf that aborts on failure).

I looked at libgc before but it's way over the top for this use. It causes all sorts of weird non-deterministic bugs and more importantly, is incompatible with Valgrind.

AddressSantitizer looks quite good as a memory checker and if using Clang it only needs an extra compiler flag to enable.

from nvc.

hiyuh avatar hiyuh commented on August 25, 2024

for fixed-sized buffers, maybe i can spoil them by using crazy VHDL source file which has very long identifier of entity (or file name?). IIRC, LRM does not mention about limitation about length of identifier. it looks you already set reasonable length for them, and i also expect sane users do not use very long identifier, but some HLS tools generate crazy ones, such as Vivado.
http://www.xilinx.com/support/answers/52787.htm
in fact, the above one is caused by Windows specific MAX_PATH limitation (I believe this can be fixed by using namespaces though). but this craze of HLS will produce more brilliant shits in near future, IMHO.

using xasprintf looks nice for char, ill try it soonish.

for GC and memory checker, it looks you already have your own thoughts, so i have no objection about them.

P.S. ive updated the top post.

from nvc.

hiyuh avatar hiyuh commented on August 25, 2024

commit a0a9ba0 purges 20 temp buffers.

any idea for nuking others?

from nvc.

nickg avatar nickg commented on August 25, 2024

Thanks, I merged that commit. All fine except two little issues:

In _bounds_fail the suffix variable always gets passed to printf so it has to be non-null or you end up with error messages like this:

** Fatal: array index 9 outside bounds 8 downto 0(null)

Fixed that in ab89cd8. It's OK to not free suffix as _bounds_fail never returns.

In loc_to_ident it's possible we write past the end of the array. This function has always been kind of broken though. Fixed it with 462a33d.

I also changed a bunch of fixed size buffers in cgen.c to use xasprinf too in 90cfa27. I don't think the remaining ones are anything to worry about at the moment.

from nvc.

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.