You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "eddelbuettel (via GitHub)" <gi...@apache.org> on 2023/05/16 12:50:51 UTC

[GitHub] [arrow] eddelbuettel opened a new issue, #35617: In C API example, allocation of child buffers references wrong `n_buffers`

eddelbuettel opened a new issue, #35617:
URL: https://github.com/apache/arrow/issues/35617

   ### Describe the bug, including details regarding any error messages, version, and platform.
   
   This is something spotted by `gcc-12` as I was working around the C API examples.  When (near the very bottom of the [C API documentation](https://arrow.apache.org/docs/format/CDataInterface.html)) the example allocates buffers, it references the parent structure in
   
   ```c
   malloc(sizeof(void*) * array->n_buffers);
   ```
   
   This should be 
   
   ```c
   malloc(sizeof(void*) * child->n_buffers);
   ```
   
   in both cases, and `child` is updated just above with `n_buffers` being 2 and 3, respectively, as opposed to the 1 from the parent.   
   
   Making the change makes the nags
   
         warning: array subscript 1 is outside array bounds of ‘void[8]'
   
         note: at offset 8 into object of size 8 allocated by ‘malloc’ 
         
   go away.  I can send a PR if it helps as I have this updated in a fork.
   
   ### Component(s)
   
   C, Documentation, Website


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] eddelbuettel commented on issue #35617: [Docs] C API example, allocation of child buffers references wrong `n_buffers`

Posted by "eddelbuettel (via GitHub)" <gi...@apache.org>.
eddelbuettel commented on issue #35617:
URL: https://github.com/apache/arrow/issues/35617#issuecomment-1550320100

   I will happily give all credit to `gcc-12`.  
   
   Can you aid a first time as to what my pull request title should be given this ticket?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] kou commented on issue #35617: In C API example, allocation of child buffers references wrong `n_buffers`

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on issue #35617:
URL: https://github.com/apache/arrow/issues/35617#issuecomment-1550308540

   Good catch!
   Could you send a pull request for this?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] eddelbuettel commented on issue #35617: [Docs] C API example, allocation of child buffers references wrong `n_buffers`

Posted by "eddelbuettel (via GitHub)" <gi...@apache.org>.
eddelbuettel commented on issue #35617:
URL: https://github.com/apache/arrow/issues/35617#issuecomment-1550347747

   I gave it a go at https://github.com/apache/arrow/pull/35626


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow] kou closed issue #35617: [Docs] C API example, allocation of child buffers references wrong `n_buffers`

Posted by "kou (via GitHub)" <gi...@apache.org>.
kou closed issue #35617: [Docs] C API example, allocation of child buffers references wrong `n_buffers`
URL: https://github.com/apache/arrow/issues/35617


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org