Ошибка сегментации, вызванная проблемой, связанной с датой - PullRequest
0 голосов
/ 18 октября 2019

Я получил ошибку сегментации из-за проблемы с датой. верхняя часть дампа стека выглядит следующим образом.

-----------------  lwp# 2 / thread# 2  --------------------
 fffffc7ffa19333a read     (61, 61ac2c64, 1400)
 fffffc7ffa172a8c fread () + dc
 fffffc7ff008c250 sigsegv_handler () + 1b0
 fffffc7ffa18dee6 __sighndlr () + 6
 fffffc7ffa1827a2 call_user_handler () + 252
 fffffc7ffa1829ce sigacthandler (b, fffffc7fef8f6b60, fffffc7fef8f64b0) + ee
 --- called from signal handler with signal 11 (SIGSEGV) ---
 fffffc7ff0bf0071 __1cEDate2t5B6M_v_ () + 71
 fffffc7ffefcbb9c __1cG__CrunKvector_con6FpvLLpF1_v3_v_ () + 4c
 fffffc7ff0e420a9 __1cLHybridArray4nEDate_UMUH_2t5B6M_v_ () + 79
 fffffc7ff0e2866a __1cHDateSet2t5B6M_v_ () + 4a
 fffffc7ff0befcf4 __1cHRateSet2t5B6M_v_ () + 24
 fffffc7ff0bf5149 __1cKBondStruct2t5B6M_v_ () + 139
 fffffc7ff0c9cd42 __1cKlongTCurve6FpnFCurve_pnCDZ_pnGRawPar_pdpknEDate_pknHDetails__i_ () + 62
 ...

Вот значения текущих регистров и кода разборки вызовов longTCurve () и oneCurve ():

> $r
%rax = 0x00000000f82e71a0       %r8  = 0x00000000efad2938
%rbx = 0x00000000f82ee390       %r9  = 0x00000000efae70c0
%rcx = 0x00000000f82ee488       %r10 = 0x00000000efae70c0
%rdx = 0x00000000f82e71a0       %r11 = 0x00000000f82ee488
%rsi = 0x00000000f82e0d60       %r12 = 0x0000000000000000
%rdi = 0x00000000f82d8fe0       %r13 = 0x0000000000000002
                                %r14 = 0x000000000761e9b0
                                %r15 = 0x000000003f53e080

%cs = 0x004b    %fs = 0x0000    %gs = 0x0000
%ds = 0x0043    %es = 0x0043    %ss = 0x0043

%rip = 0xfffffc7ff0c9ccf0 libBnsInternals.so`int longTCurve+0x10
%rbp = 0xfffffc7fef9f76d0
%rsp = 0xfffffc7fef8f6e20

%rflags = 0x00010282
  id=0 vip=0 vif=0 ac=0 vm=0 rf=1 nt=0 iopl=0x0
  status=<of,df,IF,tf,SF,zf,af,pf,cf>

%gsbase = 0x0000000000000000
%fsbase = 0xfffffc7ff9f40a00
%trapno = 0xe
   %err = 0x6





>  fffffc7ff0bf0071::dis
libBnsInternals.so`Date::Date #Nvariant 1+0x48: movq   $0xc,%rcx
libBnsInternals.so`Date::Date #Nvariant 1+0x4f: leaq   -0x18(%rbp),%rdi
libBnsInternals.so`Date::Date #Nvariant 1+0x53: movq   (%rdi),%rdi
libBnsInternals.so`Date::Date #Nvariant 1+0x56: addq   %rcx,%rdi
libBnsInternals.so`Date::Date #Nvariant 1+0x59: movl   %eax,(%rdi)
libBnsInternals.so`Date::Date #Nvariant 1+0x5b: movl   $0x1,%edi
libBnsInternals.so`Date::Date #Nvariant 1+0x60: movq   $0x10,%rax
libBnsInternals.so`Date::Date #Nvariant 1+0x67: leaq   -0x18(%rbp),%rcx
libBnsInternals.so`Date::Date #Nvariant 1+0x6b: movq   (%rcx),%rcx
libBnsInternals.so`Date::Date #Nvariant 1+0x6e: addq   %rax,%rcx
libBnsInternals.so`Date::Date #Nvariant 1+0x71: movl   %edi,(%rcx)
libBnsInternals.so`Date::Date #Nvariant 1+0x73: movl   $0x76c,%ecx
libBnsInternals.so`Date::Date #Nvariant 1+0x78: movq   $0x14,%rdi
libBnsInternals.so`Date::Date #Nvariant 1+0x7f: leaq   -0x18(%rbp),%rax
libBnsInternals.so`Date::Date #Nvariant 1+0x83: movq   (%rax),%rax
libBnsInternals.so`Date::Date #Nvariant 1+0x86: addq   %rdi,%rax
libBnsInternals.so`Date::Date #Nvariant 1+0x89: movl   %ecx,(%rax)
libBnsInternals.so`Date::Date #Nvariant 1+0x8b: addq   $0x18,%rsp
libBnsInternals.so`Date::Date #Nvariant 1+0x8f: popq   %r15
libBnsInternals.so`Date::Date #Nvariant 1+0x91: leave
libBnsInternals.so`Date::Date #Nvariant 1+0x92: ret

>  fffffc7ffefcbb9c::dis
libCrun.so.1`void __Crun::vector_con+0x2f:      je     +0x69    <libCrun.so.1`void __Crun::vector_con+0x98>
libCrun.so.1`void __Crun::vector_con+0x31:      cmpq   %rbx,%r14
libCrun.so.1`void __Crun::vector_con+0x34:      jae    +0x64    <libCrun.so.1`void __Crun::vector_con+0x98>
libCrun.so.1`void __Crun::vector_con+0x36:      movq   %r14,%r12
libCrun.so.1`void __Crun::vector_con+0x39:      nop
libCrun.so.1`void __Crun::vector_con+0x3d:      nop
libCrun.so.1`void __Crun::vector_con+0x40:      movq   %r12,%rdi
libCrun.so.1`void __Crun::vector_con+0x43:      xorl   %eax,%eax
libCrun.so.1`void __Crun::vector_con+0x45:      movq   -0x38(%rbp),%r8
libCrun.so.1`void __Crun::vector_con+0x49:      call   *%r8
libCrun.so.1`void __Crun::vector_con+0x4c:      addq   %r13,%r12
libCrun.so.1`void __Crun::vector_con+0x4f:      cmpq   %rbx,%r12
libCrun.so.1`void __Crun::vector_con+0x52:      jb     -0x12    <libCrun.so.1`void __Crun::vector_con+0x40>
libCrun.so.1`void __Crun::vector_con+0x54:      jmp    +0x44    <libCrun.so.1`void __Crun::vector_con+0x98>
libCrun.so.1`void __Crun::vector_con+0x56:      movq   -0x40(%rbp),%rsp
libCrun.so.1`void __Crun::vector_con+0x5a:      call   -0x42ba  <PLT=libCrun.so.1`bool __Crun::ex_skip>
libCrun.so.1`void __Crun::vector_con+0x5f:      testb  %al,%al
libCrun.so.1`void __Crun::vector_con+0x61:      jne    +0x46    <libCrun.so.1`void __Crun::vector_con+0xa7>
libCrun.so.1`void __Crun::vector_con+0x63:      testq  %r15,%r15
libCrun.so.1`void __Crun::vector_con+0x66:      je     +0x1d    <libCrun.so.1`void __Crun::vector_con+0x83>
libCrun.so.1`void __Crun::vector_con+0x68:      cmpq   %r14,%r12
...
...

> fffffc7ff0bf5149::dis
libBnsInternals.so`BondStruct::BondStruct #Nvariant 1+0x113:    addq   %rax,%rdi
libBnsInternals.so`BondStruct::BondStruct #Nvariant 1+0x116:    movq   %rdi,%rdi
libBnsInternals.so`BondStruct::BondStruct #Nvariant 1+0x119:    call   -0x220e9 <PLT=libBnsInternals.so`Date::Date #Nvariant 1>
libBnsInternals.so`BondStruct::BondStruct #Nvariant 1+0x11e:    movl   %eax,%eax
libBnsInternals.so`BondStruct::BondStruct #Nvariant 1+0x120:    movq   $0x2e8,%rax
libBnsInternals.so`BondStruct::BondStruct #Nvariant 1+0x127:    leaq   -0x18(%rbp),%rdi
libBnsInternals.so`BondStruct::BondStruct #Nvariant 1+0x12b:    movq   (%rdi),%rdi
libBnsInternals.so`BondStruct::BondStruct #Nvariant 1+0x12e:    addq   %rax,%rdi
libBnsInternals.so`BondStruct::BondStruct #Nvariant 1+0x131:    movq   %rdi,%rdi
libBnsInternals.so`BondStruct::BondStruct #Nvariant 1+0x134:    call   -0x22074 <PLT=libBnsInternals.so`RateSet::RateSet #Nvariant 1>
libBnsInternals.so`BondStruct::BondStruct #Nvariant 1+0x139:    movl   %eax,%eax
libBnsInternals.so`BondStruct::BondStruct #Nvariant 1+0x13b:    movq   $0x28330,%rax
libBnsInternals.so`BondStruct::BondStruct #Nvariant 1+0x142:    leaq   -0x18(%rbp),%rdi
libBnsInternals.so`BondStruct::BondStruct #Nvariant 1+0x146:    movq   (%rdi),%rdi
libBnsInternals.so`BondStruct::BondStruct #Nvariant 1+0x149:    addq   %rax,%rdi
libBnsInternals.so`BondStruct::BondStruct #Nvariant 1+0x14c:    movq   %rdi,%rdi
libBnsInternals.so`BondStruct::BondStruct #Nvariant 1+0x14f:    call   -0x21c3f <PLT=libBnsInternals.so`Cashflow::Cashflow #Nvariant 1>
libBnsInternals.so`BondStruct::BondStruct #Nvariant 1+0x154:    movl   %eax,%eax
libBnsInternals.so`BondStruct::BondStruct #Nvariant 1+0x156:    movq   $0x58408,%rax
libBnsInternals.so`BondStruct::BondStruct #Nvariant 1+0x15d:    leaq   -0x18(%rbp),%rdi
libBnsInternals.so`BondStruct::BondStruct #Nvariant 1+0x161:    movq   (%rdi),%rdi
>  fffffc7ff0c9cd42::dis
libBnsInternals.so`int longTCurve+0x32: movq   %rdx,(%rax)
libBnsInternals.so`int longTCurve+0x35: leaq   0xffffffffffeff790(%rbp),%rdx
libBnsInternals.so`int longTCurve+0x3c: movq   %rcx,(%rdx)
libBnsInternals.so`int longTCurve+0x3f: leaq   0xffffffffffeff788(%rbp),%rdx
libBnsInternals.so`int longTCurve+0x46: movq   %r8,(%rdx)
libBnsInternals.so`int longTCurve+0x49: leaq   0xffffffffffeff780(%rbp),%rdx
libBnsInternals.so`int longTCurve+0x50: movq   %r9,(%rdx)
libBnsInternals.so`int longTCurve+0x53: leaq   0xffffffffffeff7b0(%rbp),%rdx
libBnsInternals.so`int longTCurve+0x5a: movq   %rdx,%rdi
libBnsInternals.so`int longTCurve+0x5d: call   -0xc8f8d <PLT=libBnsInternals.so`BondStruct::BondStruct #Nvariant 1>
libBnsInternals.so`int longTCurve+0x62: movl   %eax,%eax
libBnsInternals.so`int longTCurve+0x64: leaq   0x559cd5(%rip),%rax
libBnsInternals.so`int longTCurve+0x6b: movsd  0x80(%rax),%xmm0
libBnsInternals.so`int longTCurve+0x73: movsd  %xmm0,-0xc0(%rbp)
libBnsInternals.so`int longTCurve+0x7b: movq   $0xc0,%rax
libBnsInternals.so`int longTCurve+0x82: leaq 0xffffffffffeff798(%rbp),%rdi
libBnsInternals.so`int longTCurve+0x89: movq   (%rdi),%rdi
libBnsInternals.so`int longTCurve+0x8c: addq   %rax,%rdi
libBnsInternals.so`int longTCurve+0x8f: movl   (%rdi),%edi
libBnsInternals.so`int longTCurve+0x91: movq   $0xc4,%rax
libBnsInternals.so`int longTCurve+0x98: leaq 0xffffffffffeff798(%rbp),%rdx
>  fffffc7ff0c9dc48::dis
libBnsInternals.so`int oneTCurve+0xf6:  leaq   -0x38(%rbp),%r10
libBnsInternals.so`int oneTCurve+0xfa:  movq   (%r10),%r10
libBnsInternals.so`int oneTCurve+0xfd:  movq   %rax,%rdi
libBnsInternals.so`int oneTCurve+0x100: movq   %rsi,%rsi
libBnsInternals.so`int oneTCurve+0x103: movq   -0x58(%rbp),%rax
libBnsInternals.so`int oneTCurve+0x107: movq   %rax,%rdx
libBnsInternals.so`int oneTCurve+0x10a: movq   %r11,%rcx
libBnsInternals.so`int oneTCurve+0x10d: movq   %r8,%r8
libBnsInternals.so`int oneTCurve+0x110: movq   %r10,%r9
libBnsInternals.so`int oneTCurve+0x113: call   -0xc6923 <PLT=libBnsInternals.so`int longTCurve>
libBnsInternals.so`int oneTCurve+0x118: movl   %eax,%eax
libBnsInternals.so`int oneTCurve+0x11a: xorl   %eax,%eax
libBnsInternals.so`int oneTCurve+0x11c: movl   %eax,-0x18(%rbp)
libBnsInternals.so`int oneTCurve+0x11f: leaq   -0x18(%rbp),%rax
libBnsInternals.so`int oneTCurve+0x123: movl   (%rax),%eax
libBnsInternals.so`int oneTCurve+0x125: movq   $0x38,%rdi
libBnsInternals.so`int oneTCurve+0x12c: leaq   -0x28(%rbp),%rsi
libBnsInternals.so`int oneTCurve+0x130: movq   (%rsi),%rsi
libBnsInternals.so`int oneTCurve+0x133: addq   %rdi,%rsi
libBnsInternals.so`int oneTCurve+0x136: movl   (%rsi),%esi
libBnsInternals.so`int oneTCurve+0x138: cmpl   %esi,%eax

IsМожно выяснить, какие значения параметров были переданы в longTCurve ()?

. Подписи longTCurve и oneCurve заключаются в следующем. longTCurve вызывается изнутри oneCurve:

int  longTCurve( Curve          *curve,
             DZ             *curveDz,
             RawPar         *rawPar,
             double         *rawParRate,
             const Date     *today,
             const Details  *details )

 int oneTCurve( Curve            *tCurve,
           RawPar           *rawPar,
           const Details    *details,
           const Date       *today,
           double           *rawRate,
           DZ               *curveRate )
...