question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No bounds checking on fill/trace buf access

See original GitHub issue

I’m having some trouble processing big 3d volumes using the library. The cause seems to be a lack of bounds checking on buf access in fill() and trace(), buf being statically sized. Due to the numba.jit usage it manifests as a segfault due to the out-of-bounds write.

Here’s a PR to add that bounds checking, and allows caller specification of the fixed buffer size to build_sknw(): https://github.com/yxdragon/sknw/pull/2

I guess it could also be dynamically resized, but I’m not familiar with numba.jit flavoured python so I’ll leave that.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
victor000000commented, Nov 13, 2020

I found that in build_sknw(ske, multi=False, iso=True, ring=True) if ske is of type np.uint8, then if node num > 255 - 10, node_num will be 0, that is a bug image

so if node num > 255, we shoud make sure ske is of type np.int64

0reactions
victor000000commented, Nov 13, 2020

131042 * 8(int64) = 1M 131042 *1024 * 8 = 1G

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · Image-Py/sknw - GitHub
Empty Graph returned for circular skeletons without branches. #11 opened on Oct 16, 2020 by Quasimondo ... No bounds checking on fill/trace buf...
Read more >
Accessing array out of bounds in C/C++ - GeeksforGeeks
Stay inside the bounds of the array in C programming while using arrays to avoid any such errors. C++ however offers the std::vector...
Read more >
[PATCH V3 11/14] coresight: sink: Add TRBE driver - Mathieu ...
But the > access to the trace buffer could be prohibited by a higher exception level > (EL3 or EL2), indicated by TRBIDR_EL1....
Read more >
No out of bounds error - Stack Overflow
When you access an array index, C and C++ don't do bound checking. ... code execution (the famous "buffer overflow" security breaches).
Read more >
Application for Disruption of Solid Waste Disposal Area 10/12/15
No waste is anticipated to be encountered or removed ... Construction of on-landfill access road. ... has long range and fills up to....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found