gdb调试_#0 0x00007ffff41ce387 in raise () from /usr/lib64/-程序员宅基地

技术标签: gdb  shell  linux  编程  gnu  

  1. Ubuntu gdb 调试 过程
    jin@ubuntu:~/jin/gdb$ gdb -v
    GNU gdb (Ubuntu/Linaro 7.4-2012.02-0ubuntu2) 7.4-2012.02
    Copyright (C) 2012 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "x86_64-linux-gnu".
    For bug reporting instructions, please see:
    <http://bugs.launchpad.net/gdb-linaro/>.
    
    jin@ubuntu:~/jin/gdb$ gdb -v
    GNU gdb (Ubuntu/Linaro 7.4-2012.02-0ubuntu2) 7.4-2012.02
    Copyright (C) 2012 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "x86_64-linux-gnu".
    For bug reporting instructions, please see:
    <http://bugs.launchpad.net/gdb-linaro/>.
    jin@ubuntu:~/jin/gdb$ 
    jin@ubuntu:~/jin/gdb$ 
    jin@ubuntu:~/jin/gdb$ 
    jin@ubuntu:~/jin/gdb$ gdb a.out 
    GNU gdb (Ubuntu/Linaro 7.4-2012.02-0ubuntu2) 7.4-2012.02
    Copyright (C) 2012 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "x86_64-linux-gnu".
    For bug reporting instructions, please see:
    <http://bugs.launchpad.net/gdb-linaro/>...
    Reading symbols from /home/jin/jin/gdb/a.out...(no debugging symbols found)...done.
    (gdb) r
    Starting program: /home/jin/jin/gdb/a.out 
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    123
    [New Thread 0x7ffff77fb700 (LWP 11897)]
    Process_pid=[11894]
    This is the main process.
    This is the main process.
    This is the main process.
    This is a pthread. 0
    This is a pthread. 1
    This is a pthread. 2
    This is a pthread. 3
    This is a pthread. 4
    This is a pthread. 5
    ^C
    Program received signal SIGINT, Interrupt.
    0x00007ffff7bc6148 in pthread_join () from /lib/x86_64-linux-gnu/libpthread.so.0
    (gdb) i threads
      Id   Target Id         Frame 
      2    Thread 0x7ffff77fb700 (LWP 11897) "a.out" 0x00007ffff78be06d in nanosleep () from /lib/x86_64-linux-gnu/libc.so.6
    * 1    Thread 0x7ffff7fe6700 (LWP 11894) "a.out" 0x00007ffff7bc6148 in pthread_join () from /lib/x86_64-linux-gnu/libpthread.so.0
    (gdb) bt
    #0  0x00007ffff7bc6148 in pthread_join () from /lib/x86_64-linux-gnu/libpthread.so.0
    #1  0x0000000000400832 in main ()
    (gdb) c
    Continuing.
    This is a pthread. 6
    This is a pthread. 7
    This is a pthread. 8
    This is a pthread. 9
    This is a pthread. 10
    This is a pthread. 11
    This is a pthread. 12
    This is a pthread. 13
    ^C
    Program received signal SIGINT, Interrupt.
    0x00007ffff7bc6148 in pthread_join () from /lib/x86_64-linux-gnu/libpthread.so.0
    (gdb) q
    A debugging session is active.
    
    	Inferior 1 [process 11894] will be killed.
    
    Quit anyway? (y or n) y
    jin@ubuntu:~/jin/gdb$ 
    
    signal(SIGINT, sigroutine);
    printf( "Process_pid=[%d]\n", getpid() );
                                                      
    void sigroutine(int unused)
    {
        printf("Catch a signal SIGINT \n");
    	//exit(1);
    }
    
    
    (gdb) r
    Starting program: /home/jin/jin/gdb/a.out 
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    123
    [New Thread 0x7ffff77fb700 (LWP 12106)]
    Process_pid=[12103]
    This is a pthread. 0
    This is the main process.
    This is the main process.
    This is the main process.
    This is a pthread. 1
    This is a pthread. 2
    This is a pthread. 3
    ^C
    Program received signal SIGINT, Interrupt.
    0x00007ffff7bc6148 in pthread_join () from /lib/x86_64-linux-gnu/libpthread.so.0
    (gdb) signal SIGINT
    Continuing with signal SIGINT.
    Catch a signal SIGINT 
    This is a pthread. 4
    This is a pthread. 5
    This is a pthread. 6
    This is a pthread. 7
    This is a pthread. 8
    This is a pthread. 9
    This is a pthread. 10
    
    jin@ubuntu:~/jin/gdb$ cat /proc/sys/kernel/core_pattern
    /home/jin/jin/gdb/%t-%e-%p-%c.core
    jin@ubuntu:~/jin/gdb$ 
    jin@ubuntu:~/jin/gdb$ ulimit -c
    10240
    jin@ubuntu:~/jin/gdb$ ./a.out 
    123
    Process_pid=[12418]
    This is the main process.
    This is the main process.
    This is the main process.
    This is a pthread. 0
    This is a pthread. 1
    Segmentation fault (core dumped)
    jin@ubuntu:~/jin/gdb$ 
    jin@ubuntu:~/jin/gdb$ ls
    1646235990-a.out-12412-10485760.core  1646236045-a.out-12418-10485760.core  a.out  test.cpp  test.cpp~
    jin@ubuntu:~/jin/gdb$ rm 164623*
    jin@ubuntu:~/jin/gdb$ ./a.out 
    123
    Process_pid=[12460]
    This is the main process.
    This is the main process.
    This is the main process.
    This is a pthread. 0
    This is a pthread. 1
    Segmentation fault (core dumped)
    jin@ubuntu:~/jin/gdb$ cat 1646236077-a.out-12460-10485760.core 
    ELF>@@8�x @ `0`@�]P���$`��$��`�
                                                                             �$p`�p&�$�`�`F�$@@���F�$  ���F�$PP�G�$���H�$���h�$ ��h�$0��h�$@@p��h�$ p����$00��Њ�$00Ѓ��$����$  �����   �����0�`�����PCORE
    
                                                                                 �0*0�0*0¶��0@�����0����m �$�������������$@3�����+���$�CORER$@���0*0�0*0a.out./a.out 0CORE!�����d@@8	�h�$    0@
               �
    ��yĶ���߶���Ķ��CORE�������������@LINUX�������������PCORE
    
                                                                                  �0*0�0*0R	@`�F�$Њ�$�Њ�$��������Њ�$-�$3��
    �$+
    �$CORE���%%%%%%%%%%%%%%%%�@LINUX���%%%%%%%%%%%%%%%%�ELF>0@@x@8	@@@@@@��88@8@@@$
                                                                                                                         $
                                                                                                                           ``8H @@`@`��TT@T@DDP�td�	�	@�	@LLQ�tdR�td``��/lib64/ld-linux-x86-64.so.2GNUGNU���"o�@X�q�Ns^)
    L%afmzZA 4 tlibpthread.so.0_Jv_RegisterClassespthread_createpthread_join__gmon_start__libc.so.6signalputsgetpidprintfsleep__libc_start_mainGLIBC_2.2.5P ui	�ui	�````` `(`08`
    H����Z�UH���5J
     �%L
     @�%J
     h������%B
     h������%:
     h������%2
     h������%*
     h������%"
     h������%
     h������%
     h�p���1�I��^H��H���PTI��@H��@H�ǒ@��������H�H�y	 H��t��H�Ð������������UH��SH��=�	 uK�0`H��	 H��(`H��H��H9�s$fDH��H��	 ��(`H��	 H9�r��s	 H�[]�fff.�H�=@ UH��t�H��]�8`��]Ð�UH��H�E�H�E��]�UH�������]�UH��H�� H�}��E��"�E��ƿ<	@�������������E��}�/u����u���UH��H���}��S	@�0�����UH��H�� H�E��j	@����H�E���4@�H��������E��}�t
    �o	@������{@�����������ƿ�	@�������E���	@������E��}�����u������������H�E��H���������Ð�������H�l$�L�d$�H�-� L�%� L�l$�L�t$�L�|$�H�\$�H��8L)�A��I��H��I�������H��t1@L��L��D��A��H��H9�u�H�\H�l$L�d$L�l$ L�t$(L�|$0H��8��Ð�������������UH��SH�H� H���t�`DH���H�H���u�H�[]Ð�H��O���H��This is a pthread. %d
    Create pthread error!Process_pid=[%d]
    This is the main process.;����d`����u������������������
                                                              ����,,���TzRx
                                                                                   �$�����FJ
    P                                                                                          �?;*3$"D����A�C
     d����
    F     A�C
    B����GA�C
    R�����A�C
    ������A�C
      $�h����Q��_@��
                        ��������������������P
    (       @���o�@�@�@                       �@
    �
    �$P_�$@�$!�	���op@���o���oX@@`�"��$�1j�$@�G�$p��$�.�$1�$
    �$^C
    jin@ubuntu:~/jin/gdb$ 
    jin@ubuntu:~/jin/gdb$ ls
    1646236077-a.out-12460-10485760.core  a.out  test.cpp  test.cpp~
    jin@ubuntu:~/jin/gdb$ gdb a.out 1646236077-a.out-12460-10485760.core 
    GNU gdb (Ubuntu/Linaro 7.4-2012.02-0ubuntu2) 7.4-2012.02
    Copyright (C) 2012 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "x86_64-linux-gnu".
    For bug reporting instructions, please see:
    <http://bugs.launchpad.net/gdb-linaro/>...
    Reading symbols from /home/jin/jin/gdb/a.out...(no debugging symbols found)...done.
    Illegal process-id: 1646236077-a.out-12460-10485760.core.
    [New LWP 12460]
    [New LWP 12461]
    
    warning: Can't read pathname for load map: Input/output error.
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    Core was generated by `./a.out'.
    Program terminated with signal 11, Segmentation fault.
    #0  0x0000000000400724 in fun2() ()
    (gdb) bt
    #0  0x0000000000400724 in fun2() ()
    #1  0x0000000000400732 in fun1() ()
    #2  0x0000000000400830 in main ()
    (gdb) i threads
      Id   Target Id         Frame 
      2    Thread 0x7f24970af700 (LWP 12461) 0x00007f2497198f2d in write () from /lib/x86_64-linux-gnu/libc.so.6
    * 1    Thread 0x7f249789b700 (LWP 12460) 0x0000000000400724 in fun2() ()
    (gdb) 
    
    
    
    jin@ubuntu:~/jin/gdb$ ls 1646236077-a.out-12460-10485760.core -l
    -rw------- 1 jin jin 8794112 Mar  2 07:47 1646236077-a.out-12460-10485760.core
    jin@ubuntu:~/jin/gdb$ 
    

#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdio.h>
#include <signal.h>
#include <stdlib.h>
#include <pthread.h>

int fun2()
{
  printf("This is a fun2.\n");
  char *prt = 0;
  char *ptr = "test";
  //free(ptr);
  *prt = 0;
}

int fun1()
{
  fun2();
}

void *thread(void *arg)
{
  int i;
  for (i = 0; i < 30000; i++)
  {
    printf("This is a pthread. %d\n", i);
    sleep(1);
  }
}

void sigroutine(int unused)
{
  printf("Catch a signal SIGINT \n");
}

int main()
{
  char *prt = 0;
  printf("123\r\n");
  ///

  pthread_t id;
  int i, ret;
  ret = pthread_create(&id, NULL, thread, NULL);
  if (ret != 0)
  {
    printf("Create pthread error!\n");
    exit (1);
  }

  signal(SIGINT, sigroutine);
  printf("Process_pid=[%d]\n", getpid());

  for (i = 0; i < 3; i++)
    printf("This is the main process.\n");
  pthread_join(id, NULL);

  ///
  // while(1)
  if (0)
  {
    sleep(1);
    fun1();
    //*prt =0;
  }
}
int fun2()
{
  printf("This is a fun2.\n");
  char *prt = 0;
  char *ptr = "test";
  free(ptr);//14
  *prt = 0;
}

g++ test.cpp -lpthread -g


Starting program: /home/jin/jin/gdb/a.out 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
123
[New Thread 0x7ffff77fb700 (LWP 12785)]
Process_pid=[12782]
This is the main process.
This is the main process.
This is the main process.
This is a pthread. 0
This is a fun2.
This is a pthread. 1
*** glibc detected *** /home/jin/jin/gdb/a.out: free(): invalid pointer: 0x00000000004009bc ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7da66)[0x7ffff7879a66]
/home/jin/jin/gdb/a.out[0x400792]
/home/jin/jin/gdb/a.out[0x4007a4]
/home/jin/jin/gdb/a.out[0x4008a2]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed)[0x7ffff781d7ed]
/home/jin/jin/gdb/a.out[0x4006a9]
======= Memory map: ========
00400000-00401000 r-xp 00000000 08:01 4200174                            /home/jin/jin/gdb/a.out
00600000-00601000 r--p 00000000 08:01 4200174                            /home/jin/jin/gdb/a.out
00601000-00602000 rw-p 00001000 08:01 4200174                            /home/jin/jin/gdb/a.out
00602000-00623000 rw-p 00000000 00:00 0                                  [heap]
7ffff6dd3000-7ffff6de8000 r-xp 00000000 08:01 659004                     /lib/x86_64-linux-gnu/libgcc_s.so.1
7ffff6de8000-7ffff6fe7000 ---p 00015000 08:01 659004                     /lib/x86_64-linux-gnu/libgcc_s.so.1
7ffff6fe7000-7ffff6fe8000 r--p 00014000 08:01 659004                     /lib/x86_64-linux-gnu/libgcc_s.so.1
7ffff6fe8000-7ffff6fe9000 rw-p 00015000 08:01 659004                     /lib/x86_64-linux-gnu/libgcc_s.so.1
7ffff6ffa000-7ffff6ffb000 rw-p 00000000 00:00 0 
7ffff6ffb000-7ffff6ffc000 ---p 00000000 00:00 0 
7ffff6ffc000-7ffff77fc000 rw-p 00000000 00:00 0 
7ffff77fc000-7ffff79b3000 r-xp 00000000 08:01 664893                     /lib/x86_64-linux-gnu/libc-2.15.so
7ffff79b3000-7ffff7bb2000 ---p 001b7000 08:01 664893                     /lib/x86_64-linux-gnu/libc-2.15.so
7ffff7bb2000-7ffff7bb6000 r--p 001b6000 08:01 664893                     /lib/x86_64-linux-gnu/libc-2.15.so
7ffff7bb6000-7ffff7bb8000 rw-p 001ba000 08:01 664893                     /lib/x86_64-linux-gnu/libc-2.15.so
7ffff7bb8000-7ffff7bbd000 rw-p 00000000 00:00 0 
7ffff7bbd000-7ffff7bd5000 r-xp 00000000 08:01 664899                     /lib/x86_64-linux-gnu/libpthread-2.15.so
7ffff7bd5000-7ffff7dd4000 ---p 00018000 08:01 664899                     /lib/x86_64-linux-gnu/libpthread-2.15.so
7ffff7dd4000-7ffff7dd5000 r--p 00017000 08:01 664899                     /lib/x86_64-linux-gnu/libpthread-2.15.so
7ffff7dd5000-7ffff7dd6000 rw-p 00018000 08:01 664899                     /lib/x86_64-linux-gnu/libpthread-2.15.so
7ffff7dd6000-7ffff7dda000 rw-p 00000000 00:00 0 
7ffff7dda000-7ffff7dfc000 r-xp 00000000 08:01 664901                     /lib/x86_64-linux-gnu/ld-2.15.so
7ffff7fe5000-7ffff7fe8000 rw-p 00000000 00:00 0 
7ffff7ff8000-7ffff7ffb000 rw-p 00000000 00:00 0 
7ffff7ffb000-7ffff7ffc000 r-xp 00000000 00:00 0                          [vdso]
7ffff7ffc000-7ffff7ffd000 r--p 00022000 08:01 664901                     /lib/x86_64-linux-gnu/ld-2.15.so
7ffff7ffd000-7ffff7fff000 rw-p 00023000 08:01 664901                     /lib/x86_64-linux-gnu/ld-2.15.so
7ffffffde000-7ffffffff000 rw-p 00000000 00:00 0                          [stack]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]

Program received signal SIGABRT, Aborted.
0x00007ffff7832035 in raise () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) where
#0  0x00007ffff7832035 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ffff783579b in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x00007ffff786f22e in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#3  0x00007ffff7879a66 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#4  0x0000000000400792 in fun2 () at test.cpp:14
#5  0x00000000004007a4 in fun1 () at test.cpp:20
#6  0x00000000004008a2 in main () at test.cpp:62
(gdb) bt
#0  0x00007ffff7832035 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ffff783579b in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x00007ffff786f22e in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#3  0x00007ffff7879a66 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#4  0x0000000000400792 in fun2 () at test.cpp:14
#5  0x00000000004007a4 in fun1 () at test.cpp:20
#6  0x00000000004008a2 in main () at test.cpp:62
(gdb) f 4
#4  0x0000000000400792 in fun2 () at test.cpp:14
14	  free(ptr);
(gdb) disassemble 
Dump of assembler code for function fun2():
   0x0000000000400764 <+0>:	push   %rbp
   0x0000000000400765 <+1>:	mov    %rsp,%rbp
   0x0000000000400768 <+4>:	sub    $0x10,%rsp
   0x000000000040076c <+8>:	mov    $0x4009ac,%edi
   0x0000000000400771 <+13>:	callq  0x400610 <puts@plt>
   0x0000000000400776 <+18>:	movq   $0x0,-0x10(%rbp)
   0x000000000040077e <+26>:	movq   $0x4009bc,-0x8(%rbp)
   0x0000000000400786 <+34>:	mov    -0x8(%rbp),%rax
   0x000000000040078a <+38>:	mov    %rax,%rdi
   0x000000000040078d <+41>:	callq  0x4005f0 <free@plt>
=> 0x0000000000400792 <+46>:	mov    -0x10(%rbp),%rax
   0x0000000000400796 <+50>:	movb   $0x0,(%rax)
   0x0000000000400799 <+53>:	leaveq 
   0x000000000040079a <+54>:	retq   
End of assembler dump.
(gdb) backtrace
#0  0x00007ffff7832035 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ffff783579b in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x00007ffff786f22e in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#3  0x00007ffff7879a66 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#4  0x0000000000400792 in fun2 () at test.cpp:14
#5  0x00000000004007a4 in fun1 () at test.cpp:20
#6  0x00000000004008a2 in main () at test.cpp:62
(gdb) frame 4
#4  0x0000000000400792 in fun2 () at test.cpp:14
14	  free(ptr);
(gdb) 
g++ test.cpp -lpthread

7ffff7ffd000-7ffff7fff000 rw-p 00023000 08:01 664901                     /lib/x86_64-linux-gnu/ld-2.15.so
7ffffffde000-7ffffffff000 rw-p 00000000 00:00 0                          [stack]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]

Program received signal SIGABRT, Aborted.
0x00007ffff7832035 in raise () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0  0x00007ffff7832035 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ffff783579b in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2  0x00007ffff786f22e in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#3  0x00007ffff7879a66 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#4  0x0000000000400792 in fun2() ()
#5  0x00000000004007a4 in fun1() ()
#6  0x00000000004008a2 in main ()
(gdb) f 4
#4  0x0000000000400792 in fun2() ()
(gdb) 

int fun2()
{
  printf("This is a fun2.\n");
  char *prt = 0;
  char *ptr = "test";
  //free(ptr);
  *prt = 0;//15
}

g++ test.cpp -lpthread -g

(gdb) bt
#0  0x000000000040073a in fun2 () at test.cpp:15
#1  0x0000000000400748 in fun1 () at test.cpp:20
#2  0x0000000000400846 in main () at test.cpp:62
(gdb) f 0
#0  0x000000000040073a in fun2 () at test.cpp:15
15	  *prt = 0;
(gdb) 

//

g++ test.cpp -lpthread -g1
g++ test.cpp -lpthread -g0

(gdb) f 0
#0  0x000000000040073a in fun2 ()
(gdb) 

//

g++ test.cpp -lpthread -g2
(gdb) f 0
#0  0x000000000040073a in fun2 () at test.cpp:15
15	  *prt = 0;

 g++ test.cpp -lpthread -g1

$ gdb a.exe
GNU gdb (GDB) (Cygwin 10.2-1) 10.2
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-cygwin".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from a.exe...
(gdb) r
Starting program: /cygdrive/f/jin/gdb/a.exe
[New Thread 36004.0x5ccc]
[New Thread 36004.0x2d7c]
[New Thread 36004.0x8f5c]
123
[New Thread 36004.0x6644]
This is a pthread. 0
Process_pid=[982]
This is the main process.
This is the main process.
This is the main process.
This is a pthread. 1
This is a fun2.

Thread 1 "a" received signal SIGSEGV, Segmentation fault.
0x00000001004010ae in fun2 () at test.cpp:15
15        *prt = 0;
(gdb)

gdb调试coredump(使用篇)_瞌睡的洋葱的博客-程序员宅基地_gdb调试core文件

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/jinchengzhou/article/details/123242760

智能推荐

Android ConstraintLayout2.0 过度动画MotionLayout MotionScene3_android onoffsetchanged-程序员宅基地

文章浏览阅读335次。待老夫kotlin大成,扩展:MotionLayout 与 CoordinatorLayout,DrawerLayout,ViewPager 的 交互众所周知,MotionLayout 的 动画是有完成度的 即Progress ,他在0-1之间变化,一.CoordinatorLayout 与AppBarLayout 交互时,其实就是监听 offsetliner 这个 偏移量的变化 同样..._android onoffsetchanged

【转】多核处理器的工作原理及优缺点_多核处理器怎么工作-程序员宅基地

文章浏览阅读8.3k次,点赞3次,收藏19次。【转】多核处理器的工作原理及优缺点《处理器关于多核概念与区别 多核处理器工作原理及优缺点》原文传送门  摘要:目前关于处理器的单核、双核和多核已经得到了普遍的运用,今天我们主要说说关于多核处理器的一些相关概念,它的工作与那里以及优缺点而展开的分析。1、多核处理器  多核处理器是指在一枚处理器中集成两个或多个完整的计算引擎(内核),此时处理器能支持系统总线上的多个处理器,由总..._多核处理器怎么工作

个人小结---eclipse/myeclipse配置lombok_eclispe每次运行个新项目都需要重新配置lombok吗-程序员宅基地

文章浏览阅读306次。1. eclipse配置lombok 拷贝lombok.jar到eclipse.ini同级文件夹下,编辑eclipse.ini文件,添加: -javaagent:lombok.jar2. myeclipse配置lombok myeclipse像eclipse配置后,定义对象后,直接访问方法,可能会出现飘红的报错。 如果出现报错,可按照以下方式解决。 ..._eclispe每次运行个新项目都需要重新配置lombok吗

【最新实用版】Python批量将pdf文本提取并存储到txt文件中_python批量读取文字并批量保存-程序员宅基地

文章浏览阅读1.2w次,点赞31次,收藏126次。#注意:笔者在2021/11/11当天调试过这个代码是可用的,由于pdfminer版本的更新,网络上大多数的语法没有更新,我也是找了好久的文章才修正了我的代码,仅供学习参考。1、把pdf文件移动到本代码文件的同一个目录下,笔者是在pycharm里面运行的项目,下图中的x1文件夹存储了我需要转换成文本文件的所有pdf文件。然后要在此目录下创建一个存放转换后的txt文件的文件夹,如图中的txt文件夹。2、编写代码 (1)导入所需库# coding:utf-8import ..._python批量读取文字并批量保存

【C语言初阶】内存管理(内存的分配方式、常见的内存错误即对策、杜绝”野指针“)_函数造成的内存错误怎么解决-程序员宅基地

文章浏览阅读646次。内存的分配方式、常见的内存错误即对策、指针与数组的对比、free、杜绝“野指针“、内存耗尽怎么办、malloc/free 的使用要点_函数造成的内存错误怎么解决

6.UE4的多维数组_ue 二维数组-程序员宅基地

文章浏览阅读4.2k次。一. 多维数组的概念1. 一维像线,array[0],索引2. 二维像表格(面),array[0][0],行列3. 三维像立方体,array[0][0][0],行列厚度二. 三维数组在虚拟漫游中的应用使用三维数组表示一栋楼的数据设定结构体 RoomInfo属性 变量名称 数据类型面积 RoomAreaF 单价 Price_ue 二维数组

随便推点

debounce与throttle区别及其应用场景_throttle和debounce应用在哪些场景-程序员宅基地

文章浏览阅读513次。目录概念debouncethrottle实现debouncethrottle应用场景debouncethrottle场景举例debouncethrottle概念debounce字面理解是“防抖”,何谓“防抖”,就是连续操作结束后再执行,以网页滚动为例,debounce要等到用户停止滚动后才执行,将连续多次执行合并为一次执行。throttle字面理解是“节流”,何谓“节流”,就是确保一段时..._throttle和debounce应用在哪些场景

java操作mongdb【超详细】_java 操作mongodb-程序员宅基地

文章浏览阅读526次。regex() $regex 正则表达式用于模式匹配,基本上是用于文档中的发现字符串 (下面有例子)注意:若未加 @Field("名称") ,则识别mongdb集合中的key名为实体类属性名。也可以对数组进行索引,如果被索引的列是数组时,MongoDB会索引这个数组中的每一个元素。也可以对整个Document进行索引,排序是预定义的按插入BSON数据的先后升序排列。save: 若新增数据的主键已经存在,则会对当前已经存在的数据进行修改操作。_java 操作mongodb

github push 推送代码失败. 使用ssh rsa key. remote: Support for password authentication was removed._git push remote: support for password authenticati-程序员宅基地

文章浏览阅读1k次。今天push代码到github仓库时出现这个报错TACKCHEN-MB0:tc-image tackchen$ git pushremote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.remote: Please see https://github.blog/2020-12-15-token-authentication_git push remote: support for password authentication was removed on august 1

#程序员因薪资不满拒绝offer,HR:你只能是个程序员了_因薪资问题拒绝offer-程序员宅基地

文章浏览阅读1w次,点赞21次,收藏8次。职场上,公司与求职者是处于一种平等关系,你看重我能力,而我看重的是薪资和发展平台。对于双方来说,接受与拒绝都很正常,被拒绝也应该理性看待。但是就有一名程序员在求职过程中,公司看重他的技能,让HR和他谈薪资,而该程序员对于该公司给出的薪资并不满意,从而礼貌拒绝了。可是没想到该HR却生气称:估计你一辈子就是个程序员。从网友曝光的聊天记录来看,HR刚开始给程序员开出15K的薪资,而程序员则表示太..._因薪资问题拒绝offer

NPOI 在 System.IO.FileNotFoundException 中第一次偶然出现的“mscorlib.dll”类型的异常_在system.io.filenotfund 第一次偶现的 mscorlib-程序员宅基地

文章浏览阅读6.1k次。 本人环境是:VS2008 64位系统 。报错的版本是NPOI 2.1.3 binary(2.1.3之前都不可以) 。之后换上NPOI binary 2.1.3.1版本 错误消失,正常启动!NPOI官网: https://npoi.codeplex.com/..._在system.io.filenotfund 第一次偶现的 mscorlib

A survey of Large Lanuage models_a survey of large language models-程序员宅基地

文章浏览阅读720次。Reddit link:高赞链接,知乎或者贴吧类似的;2.预训练数据的数量,随着大语言模型参数规模的增加,需要增加更多数据,chinchilla表明,现有许多大语言模型由于缺乏足够的预训练数据而受到次优训练的影响,llama表明,随着更多数据和更长时间的训练,较小的模型可以实现良好的性能。LLM,语言建模目标是通过单词预测对模型参数进行预训练,但缺乏对人类价值观和偏好的考虑,提出人类对齐,使大语言模型行为能够符合人类的期望,但是与初始的预训练和适应微调不同,语言模型的对齐需要考虑不同的标准。_a survey of large language models