Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using handtracking arr SIGSEG 11, SIG_MAPERR occured #3781

Closed
beakyangsu opened this issue Oct 20, 2022 · 9 comments
Closed

using handtracking arr SIGSEG 11, SIG_MAPERR occured #3781

beakyangsu opened this issue Oct 20, 2022 · 9 comments
Assignees
Labels
legacy:hands Hand tracking/gestures/etc platform:android Issues with Android as Platform type:support General questions

Comments

@beakyangsu
Copy link

beakyangsu commented Oct 20, 2022

OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Android SOS
Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: Samsung Galaxy S22+
Bazel version: bazel 5.3.1
Android Studio, NDK, SDK versions (if issue is related to building in mobile dev enviroment):
AndroidStudio Chipmunk NDK : 20.0.5594570, SDK: 30.0.3
Xcode & Tulsi version (if issue is related to building in mobile dev enviroment):
Exact steps to reproduce:

10-30 13:54:15.959 27509 27509 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
10-30 13:54:15.959 27509 27509 F DEBUG   : Cause: null pointer dereference
10-30 13:54:15.959 27509 27509 F DEBUG   :     x0  0000000000000000  x1  000000740e6ad18c  x2  000000710b70ee50  x3  000000700fb38778
10-30 13:54:15.959 27509 27509 F DEBUG   :     x4  0000000000000000  x5  b40000716b6c2f58  x6  6f6e20646c756f63  x7  6120646165722074
10-30 13:54:15.959 27509 27509 F DEBUG   :     x8  0000000000000000  x9  000000000000000b  x10 0000007ff740cc60  x11 fffffffffffffff5
10-30 13:54:15.959 27509 27509 F DEBUG   :     x12 000000000000000b  x13 0000007ff740dfc5  x14 00000000fffffff5  x15 000000704e8c8bf5
10-30 13:54:15.959 27509 27509 F DEBUG   :     x16 000000704eb5e8f0  x17 000000740e61c140  x18 00000070096ba000  x19 000000700fb38858
10-30 13:54:15.959 27509 27509 F DEBUG   :     x20 000000700fb38878  x21 0000000000000000  x22 ffffffffffffffff  x23 000000700fb387c0
10-30 13:54:15.959 27509 27509 F DEBUG   :     x24 000000704e8bccc6  x25 0000000000000030  x26 0000000000000036  x27 00000000000fc000
10-30 13:54:15.959 27509 27509 F DEBUG   :     x28 000000700fa40000  x29 000000700fb38c50
10-30 13:54:15.959 27509 27509 F DEBUG   :     lr  000000704e3d365c  sp  000000700fb387b0  pc  000000740e61c150  pst 0000000080001000
10-30 13:54:15.959 27509 27509 F DEBUG   : backtrace:
10-30 13:54:15.959 27509 27509 F DEBUG   :       #00 pc 000000000004b150  /apex/com.android.runtime/lib64/bionic/libc.so (__strlen_aarch64+16) (BuildId: dc8ba4e10139d1ad5599c24f3d06e81f)
10-30 13:54:15.959 27509 27509 F DEBUG   :       #01 pc 000000000018a658  /data/app/~~q6RwlXjng2rLioYWR3P5Pw==/com.lge.camera-2fYdsf0iCkRaAiRnoowMxQ==/lib/arm64/libmediapipe_jni.so
10-30 13:54:15.959 27509 27509 F DEBUG   :       #02 pc 0000000000147198  /data/app/~~q6RwlXjng2rLioYWR3P5Pw==/com.lge.camera-2fYdsf0iCkRaAiRnoowMxQ==/lib/arm64/libmediapipe_jni.so
10-30 13:54:15.959 27509 27509 F DEBUG   :       #03 pc 0000000000518514  /data/app/~~q6RwlXjng2rLioYWR3P5Pw==/com.lge.camera-2fYdsf0iCkRaAiRnoowMxQ==/lib/arm64/libmediapipe_jni.so
10-30 13:54:15.959 27509 27509 F DEBUG   :       #04 pc 000000000050a2f8  /data/app/~~q6RwlXjng2rLioYWR3P5Pw==/com.lge.camera-2fYdsf0iCkRaAiRnoowMxQ==/lib/arm64/libmediapipe_jni.so
10-30 13:54:15.959 27509 27509 F DEBUG   :       #05 pc 000000000050a174  /data/app/~~q6RwlXjng2rLioYWR3P5Pw==/com.lge.camera-2fYdsf0iCkRaAiRnoowMxQ==/lib/arm64/libmediapipe_jni.so
10-30 13:54:15.959 27509 27509 F DEBUG   :       #06 pc 000000000052d8e8  /data/app/~~q6RwlXjng2rLioYWR3P5Pw==/com.lge.camera-2fYdsf0iCkRaAiRnoowMxQ==/lib/arm64/libmediapipe_jni.so
10-30 13:54:15.959 27509 27509 F DEBUG   :       #07 pc 000000000052d650  /data/app/~~q6RwlXjng2rLioYWR3P5Pw==/com.lge.camera-2fYdsf0iCkRaAiRnoowMxQ==/lib/arm64/libmediapipe_jni.so
10-30 13:54:15.959 27509 27509 F DEBUG   :       #08 pc 00000000000b6a24  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+264) (BuildId: dc8ba4e10139d1ad5599c24f3d06e81f)
10-30 13:54:15.959 27509 27509 F DEBUG   :       #09 pc 00000000000532bc  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+68) (BuildId: dc8ba4e10139d1ad5599c24f3d06e81f)


this error occured when i use FrameProcessor.onNewFrame()
i did use gpubuffer for handtracking, convert yuv Image(class) to bitmap and then create texutreFrame,
here is my code.
please let me know what't the problem?

I want to use FrameProcessor.onNewFrame() directly, not through ExternalTextureConverter.

in onCreate()

AndroidAssetUtil.initializeNativeAssetManager(mInf.scInf.act)
       eglManager = EglManager(null)
       processor = FrameProcessor(
               mInf.scInf.act,
               eglManager!!.nativeContext,
               BINARY_GRAPH_NAME,
               INPUT_VIDEO_STREAM_NAME,
               OUTPUT_VIDEO_STREAM_NAME)

       val packetCreator = processor!!.packetCreator
       val inputSidePackets: MutableMap<String, Packet> = HashMap()
       inputSidePackets[INPUT_NUM_HANDS_SIDE_PACKET_NAME] = packetCreator.createInt32(NUM_HANDS)
       processor!!.setVideoInputStreamCpu(INPUT_VIDEO_STREAM_NAME)
       processor!!.setInputSidePackets(inputSidePackets)

//register callback
       processor!!.addPacketCallback(OUTPUT_LANDMARKS_STREAM_NAME) { packet: Packet ->
           Log.d(TAG, "solsol Received multi-hand landmarks packet.")
           val multiHandLandmarks = PacketGetter.getProtoVector(packet, LandmarkProto.NormalizedLandmarkList.parser())
           Log.d(TAG, "solsol [TS:"
                   + packet.timestamp
                   + "] "
                   + getMultiHandLandmarksDebugString(multiHandLandmarks))
       }

in onResume()

//init outputView
      mOutputView = SurfaceView(mInf.scInf.actCtx)
       val parent = mInf.scInf.act.findViewById<View>(R.id.shotmode_parent_layout) as ViewGroup
       val boxView = mInf.scInf.act.findViewById<View>(R.id.obt_result_layout)
       val index = parent.indexOfChild(boxView)
       parent.addView(mOutputView, index)
       mOutputView?.visibility = INVISIBLE

mOutputView?.holder?.addCallback(
               object : SurfaceHolder.Callback {
                   override fun surfaceCreated(holder: SurfaceHolder) {
                       processor!!.videoSurfaceOutput.setSurface(holder.surface)
                       processor!!.videoSurfaceOutput.setFlipY(FLIP_FRAMES_VERTICALLY)
                   }

                   override fun surfaceChanged(holder: SurfaceHolder, format: Int, width: Int, height: Int) {
                   }

                   override fun surfaceDestroyed(holder: SurfaceHolder) {
                       processor!!.videoSurfaceOutput.setSurface(null)
                   }
               })

in onFullFrameAvailable()

override fun onFullFrameAvailable(image: Image?): Boolean {
       if(image == null || size == null){
           return false
       }

val y = image.planes[0].buffer
       val u = image.planes[1].buffer
       val v = image.planes[2].buffer

       if(yuv == null){
           yuv = ByteArray(y.remaining() + u.remaining() + v.remaining())
       }
       val srcW = image.width
       val srcH = image.height
       ColorConverter.mergeYuvChannels(yuv, y, u, v, srcW, srcH, image.planes[0].rowStride)


       if(bitmap == null) {
           bitmap = Bitmap.createBitmap(srcW, srcH, Bitmap.Config.ARGB_8888)
       }
       ColorConverter.yuv420spToBitmap(bitmap, yuv, srcW, srcH)

       val textureName = intArrayOf(2)
       GLES20.glGenTextures(1, textureName, 0)
       GLES20.glActiveTexture(33984)
       GLES20.glBindTexture(3553, textureName[0])
       GLUtils.texImage2D(3553, 0, bitmap, 0)
       ShaderUtil.checkGlError("texImage2D")
       GLES20.glTexParameteri(3553, 10241, 9729)
       GLES20.glTexParameteri(3553, 10240, 9729)
       GLES20.glTexParameteri(3553, 10242, 33071)
       GLES20.glTexParameteri(3553, 10243, 33071)
       ShaderUtil.checkGlError("texture setup")


       val texture = AppTextureFrame(textureName[0], srcW, srcH)
       texture.timestamp = image.timestamp
       processor!!.onNewFrame(texture)
       return true
   } 

Also is there any way to print mediapipe-jni with method name in error log?
My log is not output with the method name.

like this

/data/app/~~q6RwlXjng2rLioYWR3P5Pw==/com.lge.camera-2fYdsf0iCkRaAiRnoowMxQ==/lib/arm64/libmediapipe_jni.so**(Method name)**
10-30 13:54:15.959 27509 27509 F DEBUG   :       #02 pc 0000000000147198  

Thanks.

@beakyangsu beakyangsu added the type:support General questions label Oct 20, 2022
@kuaashish kuaashish added the legacy:hands Hand tracking/gestures/etc label Oct 20, 2022
@kuaashish
Copy link
Collaborator

Hi @beakyangsu,
Could you elaborate your query with complete details and steps followed to reproduce the issue from our end. Please update the system information as mentioned in the documentation. Thank you!

@kuaashish kuaashish added the stat:awaiting response Waiting for user response label Oct 20, 2022
@beakyangsu
Copy link
Author

beakyangsu commented Oct 24, 2022

@kuaashish
I upadated system information.
Thanks!

@google-ml-butler google-ml-butler bot removed the stat:awaiting response Waiting for user response label Oct 24, 2022
@kuaashish
Copy link
Collaborator

Hi @beakyangsu,
Could you please provide the steps followed to reproduce the issue and understand the issue better from our end. Thank you!

@kuaashish kuaashish added the stat:awaiting response Waiting for user response label Oct 27, 2022
@google-ml-butler
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.

@beakyangsu
Copy link
Author

beakyangsu commented Nov 9, 2022

Hi. @kuaashish
I updated detail steps of my code.
I want to use FrameProcessor.onNewFrame() directly and printout mediapipe-jni.so error log with method name.
Please share your knowledge.
Thanks.

@google-ml-butler google-ml-butler bot removed stale stat:awaiting response Waiting for user response labels Nov 9, 2022
@kuaashish kuaashish added the platform:android Issues with Android as Platform label Nov 16, 2022
@kuaashish kuaashish assigned jiuqiant and unassigned kuaashish Nov 24, 2022
@kuaashish kuaashish added the stat:awaiting googler Waiting for Google Engineer's Response label Nov 24, 2022
@kuaashish kuaashish removed the stat:awaiting googler Waiting for Google Engineer's Response label Apr 26, 2023
@kuaashish kuaashish assigned kuaashish and unassigned jiuqiant Apr 26, 2023
@kuaashish
Copy link
Collaborator

Hello @beakyangsu,
We are upgrading the MediaPipe Legacy Solutions to new MediaPipe solutions However, the libraries, documentation, and source code for all the MediapPipe Legacy Solutions will continue to be available in our GitHub repository and through library distribution services, such as Maven and NPM.

You can continue to use those legacy solutions in your applications if you choose. Though, we would request you to check new MediaPipe solutions which can help you more easily build and customize ML solutions for your applications. These new solutions will provide a superset of capabilities available in the legacy solutions. Thank you

@kuaashish kuaashish added the stat:awaiting response Waiting for user response label Apr 26, 2023
@github-actions
Copy link

github-actions bot commented May 4, 2023

This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.

@github-actions github-actions bot added the stale label May 4, 2023
@github-actions
Copy link

This issue was closed due to lack of activity after being marked stale for past 7 days.

@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

@kuaashish kuaashish removed stat:awaiting response Waiting for user response stale labels May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy:hands Hand tracking/gestures/etc platform:android Issues with Android as Platform type:support General questions
Projects
None yet
Development

No branches or pull requests

4 participants