On Sun, Oct 17, 2010 at 6:34 AM, Stefan de Konink <span dir="ltr"><<a href="mailto:stefan@konink.de">stefan@konink.de</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Sun, 17 Oct 2010, Stefan de Konink wrote:<br>
<br>
</div><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
message 'PrimitiveBlock': missing required field 'stringtable'<br>
Error unpacking PrimitiveBlock message<br>
<br>
(gdb) print *hmsg<br>
$3 = {base = {descriptor = 0x406740, n_unknown_fields = 0,<br>
    unknown_fields = 0x0}, bbox = 0x0, n_required_features = 0,<br>
 required_features = 0x0, n_optional_features = 0, optional_features = 0x0,<br>
  writingprogram = 0x0, source = 0x0}<br>
<br>
But lets look what is in the raw message:<br>
<br>
(gdb) print bmsg.raw<br>
$2 = {len = 56,<br>
 data = 0x60b550 "\n\032\b\276\210\360\350B\020\340\220\361\227g\030\236\226\305\344\370\002 \340\347\351\223\340\002\"\016OsmSchema-V0.6\"\nDenseNodes\201\n\002"}<br>
<br>
Could it be an empty block?<br>
</blockquote>
<br></div>
(It missed a required feature)<br>
<br>
If we look at one block after it, which the error actually has:<br>
<br>
(gdb) print *bmsg<br>
$1 = {base = {descriptor = 0x4057e0, n_unknown_fields = 0,<br>
    unknown_fields = 0x0}, has_raw = 1, raw = {len = 141264,<br>
    data = 0x7ffff7eaf010 "\n\261D\n"}, has_raw_size = 0, raw_size = 0,<br>
  has_zlib_data = 0, zlib_data = {len = 0, data = 0x0}, has_lzma_data = 0,<br>
  lzma_data = {len = 0, data = 0x0}, has_bzip2_data = 0, bzip2_data = {<br>
    len = 0, data = 0x0}}<br>
<br>
The block has raw_size = 0 (that will result in badness!)<br>
<br>
Now the question is? I'm trusting raw_size (because it is equal for uncompress and compressed data) and it means the output size. I see that you have only set 'len' of the raw message. While it is set in the compressed case. Why is it 0?<div>
<div></div><div class="h5"><br></div></div></blockquote><div><br></div><div>I left the raw_size unset, and you're getting the default value of 0.</div><div><br></div><div><div>Scott</div></div><div><br></div></div>