简体   繁体   中英

Segmentation fault in native code

I see some segmentation fault in android openssl ,

08-30 03:18:00.358: INFO/DEBUG(2350): signal 11 (SIGSEGV), fault addr cbfb0d91
08-30 03:18:00.358: INFO/DEBUG(2350):  r0 00000010  r1 cbfb0d8d  r2 00000000  r3 cbfb0d8d
08-30 03:18:00.358: INFO/DEBUG(2350):  r4 afd42328  r5 002db268  r6 00000108  r7 00000000
08-30 03:18:00.358: INFO/DEBUG(2350):  r8 44eafb80  r9 44724e98  10 44724e84  fp 44eafed8
08-30 03:18:00.358: INFO/DEBUG(2350):  ip 00000000  sp 44eaf900  lr afd0c8e3  pc afd0c19a  cpsr a0000030

and from threads i see this is only native call

"Thread-21" prio=5 tid=20 NATIVE 
  | group="main" sCount=1 dsCount=0 s=N obj=0x47d1b5c0 self=0x1242b0 
  | sysTid=2973 nice=0 sched=0/0 cgrp=default handle=894192 
  | schedstat=( 30654282279 11238141923 4051 ) 
  at org.openssl.NativeBN.BN_generate_prime_ex(Native Method) 
  at java.math.BigInt.generatePrimeDefault(BigInt.java:382) 
  at java.math.BigInteger.<init>(BigInteger.java:271) 
  at org.bouncycastle.crypto.generators.RSAKeyPairGenerator.generateKeyPair(RSAKeyPairGenerator.java:73) 
  at org.bouncycastle.jce.provider.JDKKeyPairGenerator$RSA.generateKeyPair(JDKKeyPairGenerator.java:115)

how do debug android native code issue

You need a copy of the source of what you want to debug. Compile a debug version of the library and use a level debugger like gdb (or similar for android) there might be an IDE which makes this easier.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM