romainguy/pathway

native crash getting a segment iterator

chethaase opened this issue · 6 comments

I have a simple path created with a single cubic:
path.reset()
path.moveTo(pathPoints[0], pathPoints[1])
path.cubicTo(points[index * 2], points[index * 2 + 1],
points[index * 2], points[index * 2 + 1],
points[index * 2], points[index * 2 + 1])

I try to log the result with pathway like so:
for (segment: PathSegment in path.asAndroidPath()) {
println("*** segment = $segment")
}
The app crashes in on hasNext() during iteration.
I tried it with a close() command, and with one more cubic, but it always crashed in native code with this log:
2022-07-08 16:07:33.732 22397-22397/com.example.pathplayground A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x2 in tid 22397 (.pathplayground)

Specifically, debugger has it crashing when stepping over this call:
val typeValue = internalPathIteratorNext(internalPathIterator, pointsData)
where pointsData is a float array of 8 0.0's.

On which version of Android?

This was on an API 24 emulator (x86). Is there a problem running it on the emulator, or on another binary platform?
I wondered whether the problem wasn't a crash in that function per se, but rather a problem with the native side of pathway in general, either it's not building correctly on my system or is hitting some other incompatibility problem.

Hm, now running API 24 emulator (ARM) on a different machine (m1 mac vs x86 mac) and it doesn't crash. Not sure if this is something on my side (build time) or in the artifacts pathway has for download

Could be x86 related, I'll take a look next week.

Fixed in 0.4.0