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

rtkrcv crashes on systems with uClibc-ng or musl #111

Open
sonicpp opened this issue Mar 12, 2022 · 0 comments
Open

rtkrcv crashes on systems with uClibc-ng or musl #111

sonicpp opened this issue Mar 12, 2022 · 0 comments

Comments

@sonicpp
Copy link

sonicpp commented Mar 12, 2022

Hi,
rtkrcv crashes on systems using other libc than glibc (like musl or uclibc-ng). Can reproduce it on Pinephone (alpine w/ musl) and Raspberry Pi 0w (buildroot w/ both musl and uclibc-ng).

It does not crash on start, but when I connect via telnet and try to print status. It crashes in prstatus() of rtkrcv.c and I do not know why.

Maybe the stack is corrupted or something?

/Dilna/build/gnss-pi-uclibc-debug/host/bin/arm-buildroot-linux-uclibcgnueabihf-gdb -ix ~/Dilna/build/gnss-pi-uclibc-debug/staging/usr/share/buildroot/gdbinit rtkrcv
(gdb) target remote 192.168.0.196:2345                                                                                
Remote debugging using 192.168.0.196:2345                                                                             
Reading symbols from /home/jan/Dilna/build/gnss-pi-uclibc-debug/host/arm-buildroot-linux-uclibcgnueabihf/sysroot/lib/ld-uClibc.so.0...                                                                                                      
(No debugging symbols found in /home/jan/Dilna/build/gnss-pi-uclibc-debug/host/arm-buildroot-linux-uclibcgnueabihf/sysroot/lib/ld-uClibc.so.0)                                                                                              
0xb6eec148 in _start () from /home/jan/Dilna/build/gnss-pi-uclibc-debug/host/arm-buildroot-linux-uclibcgnueabihf/sysroot/lib/ld-uClibc.so.0                                                                                                 
(gdb) set args -s -p 8000 -o /etc/svi-lin.conf                                                                        
(gdb) b prstatus                                                                                                      
Breakpoint 1 at 0x4a66c8: file ../rtkrcv.c, line 629.                                                                 
(gdb) c                                                                                                               
Continuing.                                                                                                           
[New Thread 269.271]                                                                                                                                                                                                                        
[Switching to Thread 269.271]                                                                                                                                                                                                               
                                                                                                                                                                                                                                            
Thread 2 "rtkrcv" hit Breakpoint 1, prstatus (vt=vt@entry=0x260cee8) at ../rtkrcv.c:629                                                                                                                                                     
629         const char *svrstate[]={"stop","run"},*type[]={"rover","base","corr"};                                                                                                                                                          
(gdb) x/50i 0x4a66c8                                                                                                                                                                                                                        
   0x4a66c8 <prstatus>: push    {r4, r5, r6, r7, r8, r9, r10, r11, lr}                                                                                                                                                                      
   0x4a66cc <prstatus+4>:       vpush   {d8-d14}                                                                                                                                                                                            
   0x4a66d0 <prstatus+8>:       sub     sp, sp, #2686976        ; 0x290000                                                                                                                                                                  
   0x4a66d4 <prstatus+12>:      sub     sp, sp, #6464   ; 0x1940                                                                                                                                                                            
   0x4a66d8 <prstatus+16>:      sub     sp, sp, #52     ; 0x34                                                                                                                                                                              
   0x4a66dc <prstatus+20>:      add     r1, sp, #6464   ; 0x1940                                                                                                                                                                            
   0x4a66e0 <prstatus+24>:      add     r1, r1, #48     ; 0x30                                                                                                                                                                              
   0x4a66e4 <prstatus+28>:      vmov    s24, r0                                                                                                                                                                                             
   0x4a66e8 <prstatus+32>:      mov     r0, r1                                                                                                                                                                                              
   0x4a66ec <prstatus+36>:      mov     r8, #0                                                                                                                                                                                              
   0x4a66f0 <prstatus+40>:      ldr     r12, [pc, #1632]        ; 0x4a6d58 <prstatus+1680>                                                                                                                                                  
   0x4a66f4 <prstatus+44>:      ldr     r2, [pc, #1632] ; 0x4a6d5c <prstatus+1684>                                                                                                                                                          
   0x4a66f8 <prstatus+48>:      add     r9, sp, #2416   ; 0x970                                                                                                                                                                             
   0x4a66fc <prstatus+52>:      sub     lr, r1, #6208   ; 0x1840                                                                                                                                                                            
   0x4a6700 <prstatus+56>:      ldr     r1, [pc, #1624] ; 0x4a6d60 <prstatus+1688>                                                                                                                                                          
   0x4a6704 <prstatus+60>:      add     r12, pc, r12
   0x4a6708 <prstatus+64>:      add     r2, pc, r2
   0x4a670c <prstatus+68>:      sub     r3, r9, #2320   ; 0x910
   0x4a6710 <prstatus+72>:      sub     r5, r9, #2144   ; 0x860
   0x4a6714 <prstatus+76>:      sub     r3, r3, #4
=> 0x4a6718 <prstatus+80>:      str     r2, [r9, #-2332]        ; 0xfffff6e4
   0x4a671c <prstatus+84>:      add     r10, r12, #184  ; 0xb8
   0x4a6720 <prstatus+88>:      add     r2, r12, #172   ; 0xac
   0x4a6724 <prstatus+92>:      add     r1, pc, r1
   0x4a6728 <prstatus+96>:      sub     r5, r5, #12
   0x4a672c <prstatus+100>:     sub     r7, r0, #6400   ; 0x1900
   0x4a6730 <prstatus+104>:     str     r1, [r9, #-2328]        ; 0xfffff6e8
   0x4a6734 <prstatus+108>:     str     r0, [sp, #36]   ; 0x24
   0x4a6738 <prstatus+112>:     ldm     r2, {r0, r1, r2}
   0x4a673c <prstatus+116>:     stm     r3, {r0, r1, r2}
   0x4a6740 <prstatus+120>:     ldm     r10!, {r0, r1, r2, r3}
   0x4a6744 <prstatus+124>:     stmia   r5!, {r0, r1, r2, r3}
   0x4a6748 <prstatus+128>:     ldm     r10, {r0, r1, r2, r3}
   0x4a674c <prstatus+132>:     add     r4, r12, #216   ; 0xd8
   0x4a6750 <prstatus+136>:     str     r7, [sp, #40]   ; 0x28
   0x4a6754 <prstatus+140>:     sub     lr, lr, #12
   0x4a6758 <prstatus+144>:     sub     r7, r7, #8
   0x4a675c <prstatus+148>:     stm     r5, {r0, r1, r2, r3}
   0x4a6760 <prstatus+152>:     str     r7, [sp, #32]
   0x4a6764 <prstatus+156>:     ldm     r4!, {r0, r1, r2, r3}
   0x4a6768 <prstatus+160>:     stmia   lr!, {r0, r1, r2, r3}
   0x4a676c <prstatus+164>:     ldm     r4!, {r0, r1, r2, r3}
   0x4a6770 <prstatus+168>:     stmia   lr!, {r0, r1, r2, r3}
   0x4a6774 <prstatus+172>:     ldr     r3, [r4]
   0x4a6778 <prstatus+176>:     ldr     r2, [sp, #40]   ; 0x28
   0x4a677c <prstatus+180>:     str     r3, [lr]
   0x4a6780 <prstatus+184>:     sub     r6, r9, #2208   ; 0x8a0
   0x4a6784 <prstatus+188>:     ldr     r3, [sp, #32]
   0x4a6788 <prstatus+192>:     add     r12, r12, #252  ; 0xfc
   0x4a678c <prstatus+196>:     sub     r6, r6, #12
(gdb) bt
#0  0x004a6718 in prstatus (vt=0xb6a6f640, vt@entry=0x260cee8) at ../rtkrcv.c:629
#1  0x004aad40 in cmd_status (vt=<optimized out>, narg=1, args=0xb6cff7cc) at ../rtkrcv.c:1054
#2  con_thread (arg=0x0) at ../rtkrcv.c:1396
#3  0xb6eb812c in start_thread () from /home/jan/Dilna/build/gnss-pi-uclibc-debug/host/arm-buildroot-linux-uclibcgnueabihf/sysroot/lib//libc.so.0
#4  0xb6e67a04 in clone () from /home/jan/Dilna/build/gnss-pi-uclibc-debug/host/arm-buildroot-linux-uclibcgnueabihf/sysroot/lib//libc.so.0

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

No branches or pull requests

1 participant