You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you print most strings in mdb_v8, if the buffer is too small, it will truncate the output and insert a "[...]" to indicate that there's more output not shown. It doesn't always do this, though. I'm fixing a lot of these cases under issue #35, but while testing those changes I found another case that's not working properly that I'm not addressing in that change. The information below describes the behavior with my changes for #35, but the behavior is similarly incorrect before my changes.
I believe the issue is that when you have a ConsString of, say, str1 and str2, and the buffer size is exactly large enough to hold "str1", but not "str2", then we'll just print "str1" (and no ellipsis). Similarly, if the buffer size is large enough to hold "str1" and one character of "str2", then you'll get str1 plus "[" (as in the first part of "[...]"). The problem is basically that we don't consider truncation at all when processing ConsStrings. We only consider it when processing external strings, sequential strings, and sliced strings. As a result, we write out the whole first string without checking if we're nearing the end of the buffer, and then we may not have room left to write out even a whole ellipsis marker.
To be concrete, I found this string value in a jobsupervisor core that I've been using for testing:
When you print most strings in mdb_v8, if the buffer is too small, it will truncate the output and insert a "[...]" to indicate that there's more output not shown. It doesn't always do this, though. I'm fixing a lot of these cases under issue #35, but while testing those changes I found another case that's not working properly that I'm not addressing in that change. The information below describes the behavior with my changes for #35, but the behavior is similarly incorrect before my changes.
I believe the issue is that when you have a ConsString of, say, str1 and str2, and the buffer size is exactly large enough to hold "str1", but not "str2", then we'll just print "str1" (and no ellipsis). Similarly, if the buffer size is large enough to hold "str1" and one character of "str2", then you'll get str1 plus "[" (as in the first part of "[...]"). The problem is basically that we don't consider truncation at all when processing ConsStrings. We only consider it when processing external strings, sequential strings, and sliced strings. As a result, we write out the whole first string without checking if we're nearing the end of the buffer, and then we may not have room left to write out even a whole ellipsis marker.
To be concrete, I found this string value in a jobsupervisor core that I've been using for testing:
The whole string looks like this:
The text was updated successfully, but these errors were encountered: