Skip to content

assertion PyBytes_Check failed #1247

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

Closed
AndreMiras opened this issue Mar 30, 2018 · 3 comments
Closed

assertion PyBytes_Check failed #1247

AndreMiras opened this issue Mar 30, 2018 · 3 comments
Labels

Comments

@AndreMiras
Copy link
Member

I'm trying to run the hello world app example on Android with Python3 (crystax-ndk-10.3.2-linux-x86_64).
But it's crashing with a:

Abort message: 'jnius/jnius.c:17873: __pyx_pf_5jnius_5jnius_13MetaJavaClass_4resolve_class: assertion "PyBytes_Check(__pyx_v___javainterfaces__)" failed'

See more adb logcat context below:

03-31 00:26:19.903 13025 13186 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/core/image/_img_sdl2.so: is missing DT_SONAME will use basename as a replacement: "_img_sdl2.so"                                                          
03-31 00:26:19.930 13025 13186 I python  : [INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)                                                                                                                       
03-31 00:26:19.934 13025 13186 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/graphics/fbo.so: is missing DT_SONAME will use basename as a replacement: "fbo.so"                                                                        
03-31 00:26:19.939 13025 13186 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/graphics/context.so: is missing DT_SONAME will use basename as a replacement: "context.so"                                                                
03-31 00:26:19.948 13025 13186 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/graphics/opengl.so: is missing DT_SONAME will use basename as a replacement: "opengl.so"                                                                  
03-31 00:26:19.952 13025 13186 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/graphics/opengl_utils.so: is missing DT_SONAME will use basename as a replacement: "opengl_utils.so"                                                      
03-31 00:26:19.973 13025 13186 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/graphics/vertex_instructions.so: is missing DT_SONAME will use basename as a replacement: "vertex_instructions.so"                                        
03-31 00:26:19.980 13025 13186 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/graphics/stencil_instructions.so: is missing DT_SONAME will use basename as a replacement: "stencil_instructions.so"                                      
03-31 00:26:19.987 13025 13186 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/graphics/gl_instructions.so: is missing DT_SONAME will use basename as a replacement: "gl_instructions.so"                                                
03-31 00:26:19.992 13025 13186 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/graphics/scissor_instructions.so: is missing DT_SONAME will use basename as a replacement: "scissor_instructions.so"                                      
03-31 00:26:19.998 13025 13186 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/weakproxy.so: is missing DT_SONAME will use basename as a replacement: "weakproxy.so"                                                                     
03-31 00:26:20.029 13025 13186 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/core/text/text_layout.so: is missing DT_SONAME will use basename as a replacement: "text_layout.so"                                                       
03-31 00:26:20.036 13025 13186 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/core/text/_text_sdl2.so: is missing DT_SONAME will use basename as a replacement: "_text_sdl2.so"                                                         
03-31 00:26:20.039 13025 13186 I python  : [INFO   ] [Text        ] Provider: sdl2                                                                                                                                                                                         
03-31 00:26:20.076 13025 13186 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/jnius/jnius.so: is missing DT_SONAME will use basename as a replacement: "jnius.so"                                                                            
03-31 00:26:20.114 13025 13186 F libc    : jnius/jnius.c:17873: __pyx_pf_5jnius_5jnius_13MetaJavaClass_4resolve_class: assertion "PyBytes_Check(__pyx_v___javainterfaces__)" failed                                                                                        
03-31 00:26:20.115 13025 13186 F libc    : Fatal signal 6 (SIGABRT), code -6 in tid 13186 (SDLThread)                                                                                                                                                                      
03-31 00:26:20.116   387   387 W         : debuggerd: handling request: pid=13025 uid=10286 gid=10286 tid=13186                                                                                                                                                            
03-31 00:26:20.159  1256  1385 E WifiConfigManager: updateConfiguration freq=2422 BSSID=88:5d:fb:c6:27:3a RSSI=-45 "MIWIFI_2G_DSg6"WPA_PSK                                                                                                                                 
03-31 00:26:20.239  1256  1442 E HwCHRWebMonitor: WebMonitor [mNetWorkIsSuck=0 mUIDIsSuck=]  WebSpeed [WEBSENDSEGS=3  WEBRESENDSEGS=0  WEBRECVSEGS=2  WEBERRSEGS=0  WEBOUTRSTS=0  WEBESTABLISRST=0  WEBRTTDURATION=249  WEBRTTSEGS=2  WEBSRTT=440  WEBSNDDUPACKS=0  SENDSEG
S=0  RESENDSEGS=0  RECVSEGS=0  ERRSEGS=0  OUTRSTS=0  ESTABLISRST=0  RTTDURATION=0  RTTSEGS=0  SNDDUPACKS=0  suckTimes=0 recovage_times=0]                                                                                                                                  
03-31 00:26:20.239  1256  1442 E HwCHRWifiRSSIGroupSummery: updateTcpSummery mRSSI:-47  HwCHRWifiRSSIGroup [rssi_index=4, rtt_tcp_packets=2056, rtt_tcp_duration=154870, rtt_lan_duration=7436, rtt_lan_failures=2, rtt_lan_succ=281, rtt_lan_max=119, rtt_lan_min=0,same_a
rea_frequency=0,adjacent_area_frequency=0]                                                                                                                                                                                                                                 
03-31 00:26:20.240  1256  1442 E HwCHRWebMonitor: HwCHRWifiPacketCnt [mTXGood=4, mTXbad=0, mRXGood=3] rssi=-47                                                                                                                                                             
03-31 00:26:20.240  1256  1442 E HwCHRWebMonitor: running processName=org.test.myapp                                                                                                                                                                                       
03-31 00:26:20.241  1256  1442 E HwCHRWebMonitor: HwCHRWifiUIDWebSpeed [appName=com.whatsapp UID=10106  WEBSENDSEGS=3  WEBRESENDSEGS=0  WEBRECVSEGS=2  WEBERRSEGS=0  WEBOUTRSTS=0  WEBESTABLISRST=0  WEBRTTDURATION=249  WEBRTTSEGS=2  WEBSNDDUPACKS=0  suckTimes=0 recovag
e_times=0]                                                                                                                                                                                                                                                                 
03-31 00:26:20.243 13192 13192 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***                                                                                                                                                                 
03-31 00:26:20.243 13192 13192 F DEBUG   : Build fingerprint: 'HONOR/NEM-L51/HNNEM-H:7.0/HONORNEM-L51/C432B359:user/release-keys'                                                                                                                                          
03-31 00:26:20.243 13192 13192 F DEBUG   : Revision: '0'                                                                                                                                                                                                                   
03-31 00:26:20.243 13192 13192 F DEBUG   : ABI: 'arm'                                                                                                                                                                                                                      
03-31 00:26:20.243 13192 13192 F DEBUG   : pid: 13025, tid: 13186, name: SDLThread  >>> org.test.myapp <<<                                                                                                                                                                 
03-31 00:26:20.243 13192 13192 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------                                                                                                                                                                     
03-31 00:26:20.246 13192 13192 F DEBUG   : Abort message: 'jnius/jnius.c:17873: __pyx_pf_5jnius_5jnius_13MetaJavaClass_4resolve_class: assertion "PyBytes_Check(__pyx_v___javainterfaces__)" failed'                                                                       
03-31 00:26:20.246 13192 13192 F DEBUG   :     r0 00000000  r1 00003382  r2 00000006  r3 00000008                                                                                                                                                                          
03-31 00:26:20.246 13192 13192 F DEBUG   :     r4 d6f15978  r5 00000006  r6 d6f15920  r7 0000010c                                                                                                                                                                          
03-31 00:26:20.246 13192 13192 F DEBUG   :     r8 d4607870  r9 00000000  sl d45fa610  fp d4623337                                                                                                                                                                          
03-31 00:26:20.246 13192 13192 F DEBUG   :     ip 00000000  sp d6f125e0  lr f5e80eb7  pc f5e83720  cpsr 600b0010                                                                                                                                                           
03-31 00:26:20.249 13192 13192 F DEBUG   :                                                                                                                                                                                                                                 
03-31 00:26:20.249 13192 13192 F DEBUG   : backtrace:                                                                                                                                                                                                                      
03-31 00:26:20.254 13192 13192 F DEBUG   :     #00 pc 0004a720  /system/lib/libc.so (tgkill+12)                                                                                                                                                                            
03-31 00:26:20.255 13192 13192 F DEBUG   :     #01 pc 00047eb3  /system/lib/libc.so (pthread_kill+34)                                                                                                                                                                      
03-31 00:26:20.255 13192 13192 F DEBUG   :     #02 pc 0001d955  /system/lib/libc.so (raise+10)                                                                                                                                                                             
03-31 00:26:20.255 13192 13192 F DEBUG   :     #03 pc 000194a1  /system/lib/libc.so (__libc_android_abort+34)                                                                                                                                                              
03-31 00:26:20.255 13192 13192 F DEBUG   :     #04 pc 000170e4  /system/lib/libc.so (abort+4)                                                                                                                                                                              
03-31 00:26:20.255 13192 13192 F DEBUG   :     #05 pc 0001b953  /system/lib/libc.so (__libc_fatal+22)                                                                                                                                                                      
03-31 00:26:20.255 13192 13192 F DEBUG   :     #06 pc 0001969b  /system/lib/libc.so (__assert2+18)                                                                                                                                                                         
03-31 00:26:20.255 13192 13192 F DEBUG   :     #07 pc 000234b1  /data/data/org.test.myapp/files/app/crystax_python/site-packages/jnius/jnius.so

main.py

from kivy.app import App
from kivy.uix.label import Label

class MyApp(App):
    def build(self):
        return Label(text='Hello world')

if __name__ == '__main__':
    MyApp().run()

buildozer.spec

requirements = python3crystax,kivy

crystax-ndk-10.3.2-linux-x86_64

I'm not sure if this is python-for-android or pyjnius related issue.

@inclement
Copy link
Member

Interesting, this one is new to me. I'm afraid I'm not sure what's wrong, or what component is to blame.

@AndreMiras
Copy link
Member Author

AndreMiras commented Mar 31, 2018

Yes I'm not sure either :'( I've attached the jnuis.c file:
https://gist.github.com/AndreMiras/7a74ab3cba7d9d2d79102ef83715250b
I need to double check that the assert line within the stacktrace match. I'll update this comment otherwise.
I'll also give a try in a Ubuntu 16.04 VM.
Edit: by uploading the jnuis.c file I see I'm running Cython==0.25.2 while the doc recommends Cython==0.21 https://buildozer.readthedocs.io/en/latest/installation.html
So I'm going to investigate here as well.
Edit2: same error with Cython==0.21.

03-31 18:21:14.896  1852  1970 I python  : [WARNING] [Config      ] Older configuration version detected (0 instead of 19)                                                                                                                                                 
03-31 18:21:14.896  1852  1970 I python  : [WARNING] [Config      ] Upgrading configuration in progress.                                                                                                                                                                   
03-31 18:21:14.909  1852  1970 I python  : [INFO   ] [Logger      ] Record log in /data/user/0/org.test.myapp/files/app/.kivy/logs/kivy_18-03-31_0.txt                                                                                                                     
03-31 18:21:14.909  1852  1970 I python  : [INFO   ] [Kivy        ] v1.10.0                                                                                                                                                                                                
03-31 18:21:14.909  1852  1970 I python  : [INFO   ] [Python      ] v3.5.1 (default, Mar 30 2018, 13:14:12)                                                                                                                                                                
03-31 18:21:14.909  1852  1970 I python  : [GCC 5.3 20151204]                                                                                                                                                                                                              
03-31 18:21:14.947  1852  1970 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/_clock.so: is missing DT_SONAME will use basename as a replacement: "_clock.so"                                                                           
03-31 18:21:14.981  1256  1256 I TrafficMonitor: update:rxPkts:0,txPkts:1,rxBytes:0,txBytes:52                                                                                                                                                                             
03-31 18:21:14.981  1256  1256 I TrafficMonitor: start expired. level:-1                                                                                                                                                                                                   
03-31 18:21:14.981  1256  1256 I TrafficMonitor: gettimer:interval=2000                                                                                                                                                                                                    
03-31 18:21:15.205  1852  1970 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/_event.so: is missing DT_SONAME will use basename as a replacement: "_event.so"                                                                           
03-31 18:21:15.207  1852  1970 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/properties.so: is missing DT_SONAME will use basename as a replacement: "properties.so"                                                                   
03-31 18:21:15.261  1852  1970 I python  : [INFO   ] [Factory     ] 194 symbols loaded                                                                                                                                                                                     
03-31 18:21:15.596  1256  1385 E WifiConfigManager: updateConfiguration freq=2422 BSSID=88:5d:fb:c6:27:3a RSSI=-45 "MIWIFI_2G_DSg6"WPA_PSK                                                                                                                                 
03-31 18:21:15.745  1852  1970 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/graphics/instructions.so: is missing DT_SONAME will use basename as a replacement: "instructions.so"                                                      
03-31 18:21:15.747  1852  1970 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/graphics/buffer.so: is missing DT_SONAME will use basename as a replacement: "buffer.so"                                                                  
03-31 18:21:15.748  1852  1970 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/graphics/vertex.so: is missing DT_SONAME will use basename as a replacement: "vertex.so"                                                                  
03-31 18:21:15.750  1852  1970 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/graphics/cgl.so: is missing DT_SONAME will use basename as a replacement: "cgl.so"                                                                        
03-31 18:21:15.753  1852  1970 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/graphics/vbo.so: is missing DT_SONAME will use basename as a replacement: "vbo.so"                                                                        
03-31 18:21:15.755  1852  1970 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/graphics/compiler.so: is missing DT_SONAME will use basename as a replacement: "compiler.so"                                                              
03-31 18:21:15.756  1852  1970 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/graphics/transformation.so: is missing DT_SONAME will use basename as a replacement: "transformation.so"                                                  
03-31 18:21:15.758  1852  1970 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/graphics/shader.so: is missing DT_SONAME will use basename as a replacement: "shader.so"                                                                  
03-31 18:21:15.760  1852  1970 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/graphics/texture.so: is missing DT_SONAME will use basename as a replacement: "texture.so"                                                                
03-31 18:21:15.764  1852  1970 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/graphics/context_instructions.so: is missing DT_SONAME will use basename as a replacement: "context_instructions.so"                                      
03-31 18:21:16.040  1852  1970 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/core/image/_img_sdl2.so: is missing DT_SONAME will use basename as a replacement: "_img_sdl2.so"                                                          
03-31 18:21:16.067  1852  1970 I python  : [INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_gif (img_pil, img_ffpyplayer ignored)                                                                                                                       
03-31 18:21:16.071  1852  1970 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/graphics/fbo.so: is missing DT_SONAME will use basename as a replacement: "fbo.so"                                                                        
03-31 18:21:16.076  1852  1970 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/graphics/context.so: is missing DT_SONAME will use basename as a replacement: "context.so"                                                                
03-31 18:21:16.085  1852  1970 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/graphics/opengl.so: is missing DT_SONAME will use basename as a replacement: "opengl.so"                                                                  
03-31 18:21:16.089  1852  1970 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/graphics/opengl_utils.so: is missing DT_SONAME will use basename as a replacement: "opengl_utils.so"
03-31 18:21:16.110  1852  1970 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/graphics/vertex_instructions.so: is missing DT_SONAME will use basename as a replacement: "vertex_instructions.so"
03-31 18:21:16.116  1852  1970 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/graphics/stencil_instructions.so: is missing DT_SONAME will use basename as a replacement: "stencil_instructions.so"
03-31 18:21:16.124  1852  1970 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/graphics/gl_instructions.so: is missing DT_SONAME will use basename as a replacement: "gl_instructions.so"
03-31 18:21:16.128  1852  1970 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/graphics/scissor_instructions.so: is missing DT_SONAME will use basename as a replacement: "scissor_instructions.so"
03-31 18:21:16.134  1852  1970 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/weakproxy.so: is missing DT_SONAME will use basename as a replacement: "weakproxy.so"                                                                     
03-31 18:21:16.165  1852  1970 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/core/text/text_layout.so: is missing DT_SONAME will use basename as a replacement: "text_layout.so"
03-31 18:21:16.172  1852  1970 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/kivy/core/text/_text_sdl2.so: is missing DT_SONAME will use basename as a replacement: "_text_sdl2.so"
03-31 18:21:16.174  1852  1970 I python  : [INFO   ] [Text        ] Provider: sdl2                       
03-31 18:21:16.212  1852  1970 W linker  : /data/data/org.test.myapp/files/app/crystax_python/site-packages/jnius/jnius.so: is missing DT_SONAME will use basename as a replacement: "jnius.so"
03-31 18:21:16.250  1852  1970 F libc    : jnius/jnius.c:15765: __pyx_pf_5jnius_5jnius_13MetaJavaClass_4resolve_class: assertion "PyBytes_Check(__pyx_v___javainterfaces__)" failed
03-31 18:21:16.250  1852  1970 F libc    : Fatal signal 6 (SIGABRT), code -6 in tid 1970 (SDLThread)                                    
03-31 18:21:16.257   387   387 W         : debuggerd: handling request: pid=1852 uid=10286 gid=10286 tid=1970
03-31 18:21:16.352  1983  1983 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-31 18:21:16.352  1983  1983 F DEBUG   : Build fingerprint: 'HONOR/NEM-L51/HNNEM-H:7.0/HONORNEM-L51/C432B359:user/release-keys'
03-31 18:21:16.352  1983  1983 F DEBUG   : Revision: '0'                           
03-31 18:21:16.352  1983  1983 F DEBUG   : ABI: 'arm'                                                                                                                                                                                             
03-31 18:21:16.353  1983  1983 F DEBUG   : pid: 1852, tid: 1970, name: SDLThread  >>> org.test.myapp <<<                         
03-31 18:21:16.353  1983  1983 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------          
03-31 18:21:16.357  1983  1983 F DEBUG   : Abort message: 'jnius/jnius.c:15765: __pyx_pf_5jnius_5jnius_13MetaJavaClass_4resolve_class: assertion "PyBytes_Check(__pyx_v___javainterfaces__)" failed'
03-31 18:21:16.357  1983  1983 F DEBUG   :     r0 00000000  r1 000007b2  r2 00000006  r3 00000008                                                                                                        
03-31 18:21:16.357  1983  1983 F DEBUG   :     r4 d6580978  r5 00000006  r6 d6580920  r7 0000010c        
03-31 18:21:16.357  1983  1983 F DEBUG   :     r8 d4921a08  r9 d4275179  sl d492e610  fp d492c2e7        
03-31 18:21:16.357  1983  1983 F DEBUG   :     ip 00000000  sp d657d6c0  lr f5e80eb7  pc f5e83720  cpsr 600d0010                            
03-31 18:21:16.366  1983  1983 F DEBUG   :                                                                      
03-31 18:21:16.366  1983  1983 F DEBUG   : backtrace:                                                                                   
03-31 18:21:16.367  1983  1983 F DEBUG   :     #00 pc 0004a720  /system/lib/libc.so (tgkill+12)                                       
03-31 18:21:16.367  1983  1983 F DEBUG   :     #01 pc 00047eb3  /system/lib/libc.so (pthread_kill+34)                                         
03-31 18:21:16.367  1983  1983 F DEBUG   :     #02 pc 0001d955  /system/lib/libc.so (raise+10)
03-31 18:21:16.367  1983  1983 F DEBUG   :     #03 pc 000194a1  /system/lib/libc.so (__libc_android_abort+34)
03-31 18:21:16.367  1983  1983 F DEBUG   :     #04 pc 000170e4  /system/lib/libc.so (abort+4)                                                   
03-31 18:21:16.367  1983  1983 F DEBUG   :     #05 pc 0001b953  /system/lib/libc.so (__libc_fatal+22)                                                    
03-31 18:21:16.367  1983  1983 F DEBUG   :     #06 pc 0001969b  /system/lib/libc.so (__assert2+18)                                                       
03-31 18:21:16.367  1983  1983 F DEBUG   :     #07 pc 0001c7c5  /data/data/org.test.myapp/files/app/crystax_python/site-packages/jnius/jnius.so                                    
03-31 18:21:16.959   387   387 W         : debuggerd: resuming target 1852

https://gist.github.com/AndreMiras/80eec92d3c2c7d8cc605d7a39e3965e1

@AndreMiras
Copy link
Member Author

That was fixed by kivy/pyjnius#336 if I recall correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants