Giter Club home page Giter Club logo

Comments (4)

allanjude avatar allanjude commented on June 17, 2024

I could be wrong, but it looks like the problem is caused by the call to xo_buf_has_room() not considering some part of the pretty printing:

ALLAN: xo_buf_has_room: xb_size: 8192, curp: 8154, len: 12
ALLAN: xo_buf_has_room: xb_size: 8192, curp: 8166, len: 1
ALLAN: xo_buf_has_room: xb_size: 8192, curp: 8167, len: 5
ALLAN: xo_buf_has_room: xb_size: 8192, curp: 8172, len: 2
ALLAN: xo_buf_has_room: xb_size: 8192, curp: 8174, len: 1
ALLAN: xo_buf_has_room: xb_size: 8192, curp: 8175, len: 5
ALLAN: xo_buf_has_room: xb_size: 8192, curp: 8212, len: 12
ALLAN: Expanded buffer
ALLAN: xo_buf_has_room: xb_size: 16384, curp: 8224, len: 1
ALLAN: xo_buf_has_room: xb_size: 16384, curp: 8225, len: 4

It doesn't appear to expand the buffer until the cur pointer has passed the end of the buffer.

from libxo.

philshafer avatar philshafer commented on June 17, 2024

Could you please retry with the current code? I fixed an embarrassingly bad issue in xo_vsnprintf:

  • if (rc > xbp->xb_size) {
  • if (rc >= left) {

in commit 1f66642 that’s part of libxo-0.3.3. IIRC the fix is in 0.3.2 also.

But I’m fairly confident this was the issue you are seeing.

Thanks,
Phil

On May 4, 2015, at 12:40 AM, Allan Jude [email protected] wrote:

I could be wrong, but it looks like the problem is caused by the call to xo_buf_has_room() not considering some part of the pretty printing:

ALLAN: xo_buf_has_room: xb_size: 8192, curp: 8154, len: 12
ALLAN: xo_buf_has_room: xb_size: 8192, curp: 8166, len: 1
ALLAN: xo_buf_has_room: xb_size: 8192, curp: 8167, len: 5
ALLAN: xo_buf_has_room: xb_size: 8192, curp: 8172, len: 2
ALLAN: xo_buf_has_room: xb_size: 8192, curp: 8174, len: 1
ALLAN: xo_buf_has_room: xb_size: 8192, curp: 8175, len: 5
ALLAN: xo_buf_has_room: xb_size: 8192, curp: 8212, len: 12
ALLAN: Expanded buffer
ALLAN: xo_buf_has_room: xb_size: 16384, curp: 8224, len: 1
ALLAN: xo_buf_has_room: xb_size: 16384, curp: 8225, len: 4

It doesn't appear to expand the buffer until the cur pointer has passed the end of the buffer.

β€”
Reply to this email directly or view it on GitHub #37 (comment).

from libxo.

allanjude avatar allanjude commented on June 17, 2024

I have 0.3.2 with that fix.

The issue seems to be that the exact same bug exists in:
xo_printf_v()

ALLAN: xo_buf_has_room: xb_size: 8192, curp: 8166, len: 1
ALLAN: xo_buf_has_room: xb_size: 8192, curp: 8167, len: 5
ALLAN: xo_buf_has_room: xb_size: 8192, curp: 8172, len: 2
ALLAN: xo_buf_has_room: xb_size: 8192, curp: 8174, len: 1
ALLAN: xo_buf_has_room: xb_size: 8192, curp: 8175, len: 5
ALLAN: xo_printf_v: wrote 12 of 12 bytes
ALLAN: xo_printf_v: wrote 20 of 0 bytes
ALLAN: xo_buf_has_room: xb_size: 8192, curp: 8212, len: 12
ALLAN: Expanding Buffer
ALLAN: xo_buf_has_room: xb_size: 16384, curp: 8224, len: 1
ALLAN: xo_buf_has_room: xb_size: 16384, curp: 8225, len: 4

from libxo.

philshafer avatar philshafer commented on June 17, 2024

Fixed in 0.3.4

from libxo.

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.