Comments (4)
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.
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: 4It 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.
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.
Fixed in 0.3.4
from libxo.
Related Issues (20)
- Add "--continuation" option to "xo" to allow multiple html lines
- Document "xo"'s --not-first option HOT 1
- "xo" need option to make JSON object wrapper HOT 1
- "xo" needs a means of handling lists and instances HOT 1
- Newline before closing brace in json output HOT 2
- libtool makes unreliable executable names HOT 1
- 1.3.1 Ubuntu 18.04 WSL missing so HOT 3
- typo HOT 2
- Fails to build with GCC on FreeBSD HOT 2
- check width of unicode characters
- FreeBSD's json format prints an unescaped new line before the final closing bracket HOT 2
- No man page for xo_emit_field() HOT 6
- Man pages not escaping some newlines (PR included) HOT 1
- XOF_UNDERSCORES: hyphens in topmost keys are not replaced HOT 2
- xo/xo.c#L99: add missing UNUSED marker for all unused flags HOT 2
- libxo inconsistent field truncation HOT 3
- Linux: <sys/sysctl.h> missing HOT 2
- Core dump when compile with gcc 10 HOT 3
- xo.h defines NORETURN and PRINTFLIKE without a "XO_" prefix
- adding keys test_05 changes padding output for HIPx HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libxo.