Date: Tue, 28 Mar 2023 21:09:26 +0000 (UTC) From: Andrew Terekhov <andrew_terekhov@yahoo.com> To: "ports@freebsd.org" <ports@freebsd.org> Subject: Segmentation fault when amule starts Message-ID: <1889988356.2071741.1680037766388@mail.yahoo.com> References: <1889988356.2071741.1680037766388.ref@mail.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
------=_Part_2071740_877850499.1680037766386 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, My system is: $ uname -a FreeBSD obama 13.1-RELEASE-p6 FreeBSD 13.1-RELEASE-p6 GENERIC amd64 fully updated wrt to packages and ports. I installed amule package and it segfaulted when started. So I enabled debu= g info for ports and rebuilt amule as port. What else can I do to help fix = the problem? Below is where it crashes: $ lldb amule (lldb) target create "amule" Current executable set to 'amule' (x86_64). (lldb) run Process 22227 launched: '/usr/local/bin/amule' (x86_64) Process 22227 stopped * thread #1, name =3D 'amule', stop reason =3D signal SIGSEGV: invalid addr= ess (fault address: 0x10) =C2=A0=C2=A0=C2=A0 frame #0: 0x0000000801699e85 libcryptopp.so.8`CryptoPP::= (anonymous namespace)::SHA256_HashBlock_CXX(state=3D0x0000000000000010, dat= a=3D0x00007fffffffd440) at sha.cpp:424:5 =C2=A0=C2=A0 384 =C2=A0=C2=A0 =C2=A0 =C2=A0=C2=A0 385 =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 input +=3D SHA1::BLOCKSIZE/sizeof(word32); =C2=A0=C2=A0 386 =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 length -=3D SHA1::BLOCKSIZE; =C2=A0=C2=A0 387 =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 } =C2=A0=C2=A0 388 =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 while (length >=3D S= HA1::BLOCKSIZE); =C2=A0=C2=A0 389 =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 return length; =C2=A0=C2=A0 390 =C2=A0=C2=A0 =C2=A0} =C2=A0=C2=A0 391 =C2=A0=C2=A0 =C2=A0 =C2=A0=C2=A0 392 =C2=A0=C2=A0 =C2=A0// ************************************= ************************* =C2=A0=C2=A0 393 =C2=A0=C2=A0 =C2=A0 =C2=A0=C2=A0 394 =C2=A0=C2=A0 =C2=A0ANONYMOUS_NAMESPACE_BEGIN =C2=A0=C2=A0 395 =C2=A0=C2=A0 =C2=A0 =C2=A0=C2=A0 396 =C2=A0=C2=A0 =C2=A0#define a(i) T[(0-i)&7] =C2=A0=C2=A0 397 =C2=A0=C2=A0 =C2=A0#define b(i) T[(1-i)&7] =C2=A0=C2=A0 398 =C2=A0=C2=A0 =C2=A0#define c(i) T[(2-i)&7] =C2=A0=C2=A0 399 =C2=A0=C2=A0 =C2=A0#define d(i) T[(3-i)&7] =C2=A0=C2=A0 400 =C2=A0=C2=A0 =C2=A0#define e(i) T[(4-i)&7] =C2=A0=C2=A0 401 =C2=A0=C2=A0 =C2=A0#define f(i) T[(5-i)&7] =C2=A0=C2=A0 402 =C2=A0=C2=A0 =C2=A0#define g(i) T[(6-i)&7] =C2=A0=C2=A0 403 =C2=A0=C2=A0 =C2=A0#define h(i) T[(7-i)&7] =C2=A0=C2=A0 404 =C2=A0=C2=A0 =C2=A0 =C2=A0=C2=A0 405 =C2=A0=C2=A0 =C2=A0#define blk0(i) (W[i] =3D data[i]) =C2=A0=C2=A0 406 =C2=A0=C2=A0 =C2=A0#define blk2(i) (W[i&15]+=3Ds1(W[(i-2)&= 15])+W[(i-7)&15]+s0(W[(i-15)&15])) =C2=A0=C2=A0 407 =C2=A0=C2=A0 =C2=A0 =C2=A0=C2=A0 408 =C2=A0=C2=A0 =C2=A0#define Ch(x,y,z) (z^(x&(y^z))) =C2=A0=C2=A0 409 =C2=A0=C2=A0 =C2=A0#define Maj(x,y,z) (y^((x^y)&(y^z))) =C2=A0=C2=A0 410 =C2=A0=C2=A0 =C2=A0 =C2=A0=C2=A0 411 =C2=A0=C2=A0 =C2=A0#define R(i) h(i)+=3DS1(e(i))+Ch(e(i),f= (i),g(i))+SHA256_K[i+j]+(j?blk2(i):blk0(i));\ =C2=A0=C2=A0 412 =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 d(i)+=3Dh(i);h(i)+= =3DS0(a(i))+Maj(a(i),b(i),c(i)) =C2=A0=C2=A0 413 =C2=A0=C2=A0 =C2=A0 =C2=A0=C2=A0 414 =C2=A0=C2=A0 =C2=A0// for SHA256 =C2=A0=C2=A0 415 =C2=A0=C2=A0 =C2=A0#define s0(x) (rotrConstant<7>(x)^rotrC= onstant<18>(x)^(x>>3)) =C2=A0=C2=A0 416 =C2=A0=C2=A0 =C2=A0#define s1(x) (rotrConstant<17>(x)^rotr= Constant<19>(x)^(x>>10)) =C2=A0=C2=A0 417 =C2=A0=C2=A0 =C2=A0#define S0(x) (rotrConstant<2>(x)^rotrC= onstant<13>(x)^rotrConstant<22>(x)) =C2=A0=C2=A0 418 =C2=A0=C2=A0 =C2=A0#define S1(x) (rotrConstant<6>(x)^rotrC= onstant<11>(x)^rotrConstant<25>(x)) =C2=A0=C2=A0 419 =C2=A0=C2=A0 =C2=A0 =C2=A0=C2=A0 420 =C2=A0=C2=A0 =C2=A0void SHA256_HashBlock_CXX(word32 *state= , const word32 *data) =C2=A0=C2=A0 421 =C2=A0=C2=A0 =C2=A0{ =C2=A0=C2=A0 422 =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 word32 W[16]=3D{0}, = T[8]; =C2=A0=C2=A0 423 =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 /* Copy context->sta= te[] to working vars */ -> 424 =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 memcpy(T, state, sizeof(T)); =C2=A0=C2=A0 425 =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 /* 64 operations, pa= rtially loop unrolled */ =C2=A0=C2=A0 426 =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 for (unsigned int j= =3D0; j<64; j+=3D16) =C2=A0=C2=A0 427 =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 { =C2=A0=C2=A0 428 =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 R( 0); R( 1); R( 2); R( 3); =C2=A0=C2=A0 429 =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 R( 4); R( 5); R( 6); R( 7); =C2=A0=C2=A0 430 =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 R( 8); R( 9); R(10); R(11); =C2=A0=C2=A0 431 =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 R(12); R(13); R(14); R(15); =C2=A0=C2=A0 432 =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 } =C2=A0=C2=A0 433 =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 /* Add the working v= ars back into context.state[] */ =C2=A0=C2=A0 434 =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 state[0] +=3D a(0); =C2=A0=C2=A0 435 =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 state[1] +=3D b(0); =C2=A0=C2=A0 436 =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 state[2] +=3D c(0); =C2=A0=C2=A0 437 =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 state[3] +=3D d(0); =C2=A0=C2=A0 438 =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 state[4] +=3D e(0); =C2=A0=C2=A0 439 =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 state[5] +=3D f(0); =C2=A0=C2=A0 440 =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 state[6] +=3D g(0); =C2=A0=C2=A0 441 =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 state[7] +=3D h(0); =C2=A0=C2=A0 442 =C2=A0=C2=A0 =C2=A0} =C2=A0=C2=A0 443 =C2=A0=C2=A0 =C2=A0 =C2=A0=C2=A0 444 =C2=A0=C2=A0 =C2=A0#undef Ch (lldb) bt * thread #1, name =3D 'amule', stop reason =3D signal SIGSEGV: invalid addr= ess (fault address: 0x10) =C2=A0 * frame #0: 0x0000000801699e85 libcryptopp.so.8`CryptoPP::(anonymous= namespace)::SHA256_HashBlock_CXX(state=3D0x0000000000000010, data=3D0x0000= 7fffffffd440) at sha.cpp:424:5 =C2=A0=C2=A0=C2=A0 frame #1: 0x000000080169ad1d libcryptopp.so.8`CryptoPP::= SHA256::HashMultipleBlocks(this=3D0x00007fffffffd430, input=3D0x00007ffffff= fd480, length=3D64) at sha.cpp:977:13 =C2=A0=C2=A0=C2=A0 frame #2: 0x000000080161bcbf libcryptopp.so.8`CryptoPP::= IteratedHashBase<unsigned int, CryptoPP::HashTransformation>::Update(unsign= ed char const*, unsigned long) [inlined] CryptoPP::IteratedHashBase<unsigne= d int, CryptoPP::HashTransformation>::HashBlock(this=3D0x00007fffffffd430, = input=3D0x00007fffffffd440) at iterhash.h:109:4 =C2=A0=C2=A0=C2=A0 frame #3: 0x000000080161bca5 libcryptopp.so.8`CryptoPP::= IteratedHashBase<unsigned int, CryptoPP::HashTransformation>::Update(this= =3D0x00007fffffffd430, input=3D"^\xd1\U00000013$\U0000001c\xb63\a\U00000019= }\x85|\xde=C8=85\x84\xdbA\xc6\xdfw\xa0\xa0\xff\xe7N\xc0t\xa0\x83\U0000001d\= xdd", length=3D32) at iterhash.cpp:38:4 =C2=A0=C2=A0=C2=A0 frame #4: 0x00000008016711e0 libcryptopp.so.8`CryptoPP::= RandomPool::IncorporateEntropy(this=3D0x0000000000877938, input=3D"^\xd1\U0= 0000013$\U0000001c\xb63\a\U00000019}\x85|\xde=C8=85\x84\xdbA\xc6\xdfw\xa0\x= a0\xff\xe7N\xc0t\xa0\x83\U0000001d\xdd", length=3D32) at randpool.cpp:36:7 =C2=A0=C2=A0=C2=A0 frame #5: 0x000000080165b27d libcryptopp.so.8`CryptoPP::= AutoSeededRandomPool::Reseed(this=3D0x0000000000877938, blocking=3Dfalse, s= eedSize=3D32) at osrng.cpp:330:2 =C2=A0=C2=A0=C2=A0 frame #6: 0x0000000000793fbe amule`CryptoPP::AutoSeededR= andomPool::AutoSeededRandomPool(this=3D0x0000000000877938, blocking=3Dfalse= , seedSize=3D32) at osrng.h:171:4 =C2=A0=C2=A0=C2=A0 frame #7: 0x0000000000793e3a amule`::__cxx_global_var_in= it.1() at RandomFunctions.cpp:31:39 =C2=A0=C2=A0=C2=A0 frame #8: 0x0000000000793f7e amule`_GLOBAL__sub_I_Random= Functions.cpp at RandomFunctions.cpp:0 =C2=A0=C2=A0=C2=A0 frame #9: 0x000000080086e0fd ld-elf.so.1 =C2=A0=C2=A0=C2=A0 frame #10: 0x000000080086c38b ld-elf.so.1 ------=_Part_2071740_877850499.1680037766386 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <html><head></head><body><div class=3D"yahoo-style-wrap" style=3D"font-fami= ly:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div dir= =3D"ltr" data-setdir=3D"false"><div><div class=3D"ydp151f08ejb_0 ydp151f08e= X_6MGW ydp151f08eN_6Fd5"><div><div><div class=3D"ydp151f08eqtd-body"><div i= d=3D"ydp151f08eymsg08866" class=3D"ydp151f08eymsg8519294198"><div id=3D"ydp= 151f08eyiv7463743122"><div><div style=3D"font-family:Helvetica Neue, Helvet= ica, Arial, sans-serif;font-size:13px;" class=3D"ydp151f08eyiv7463743122yah= oo-style-wrap"><div dir=3D"ltr">Hi,</div><div dir=3D"ltr"><br></div><div di= r=3D"ltr">My system is:</div><div dir=3D"ltr"><br></div><div dir=3D"ltr"><d= iv>$ uname -a<br>FreeBSD obama 13.1-RELEASE-p6 FreeBSD 13.1-RELEASE-p6 GENE= RIC amd64</div><div><br></div></div><div dir=3D"ltr">fully updated wrt to p= ackages and ports.</div><div dir=3D"ltr"><br></div><div dir=3D"ltr">I installed amule package and it segfaulted when started. So I enabled=20 debug info for ports and rebuilt amule as port. What else can I do to=20 help fix the problem?<br></div><div dir=3D"ltr"><br></div><div dir=3D"ltr">= Below is where it crashes:</div><div dir=3D"ltr"><br></div><div dir=3D"ltr"= ><br></div><div dir=3D"ltr"><div>$ lldb amule<br>(lldb) target create "amul= e"<br>Current executable set to 'amule' (x86_64).<br>(lldb) run<br>Process = 22227 launched: '/usr/local/bin/amule' (x86_64)<br>Process 22227 stopped<br= >* thread #1, name =3D 'amule', stop reason =3D signal SIGSEGV: invalid add= ress (fault address: 0x10)<br> frame #0: 0x0000000801699e85 libcryptopp.so.8`CryptoPP::(anonymous=20 namespace)::SHA256_HashBlock_CXX(state=3D0x0000000000000010,=20 data=3D0x00007fffffffd440) at sha.cpp:424:5<br> 384  = ; <br> 385 &nb= sp; input +=3D SHA1::BLOCKSIZE/sizeof(word32);<br> = 386 length -= =3D SHA1::BLOCKSIZE;<br> 387 &nb= sp; }<br> 388 while (leng= th >=3D SHA1::BLOCKSIZE);<br> 389 &= nbsp; return length;<br> 390 }<br>&nbs= p; 391 <br> 392 // = *************************************************************<br> &nbs= p; 393 <br> 394 ANONYMOUS= _NAMESPACE_BEGIN<br> 395 <br> 39= 6 #define a(i) T[(0-i)&7]<br> 397 = #define b(i) T[(1-i)&7]<br> 398 &= nbsp;#define c(i) T[(2-i)&7]<br> 399 #de= fine d(i) T[(3-i)&7]<br> 400 #define e(i= ) T[(4-i)&7]<br> 401 #define f(i) T[(5-i= )&7]<br> 402 #define g(i) T[(6-i)&7]= <br> 403 #define h(i) T[(7-i)&7]<br>&nbs= p; 404 <br> 405 #de= fine blk0(i) (W[i] =3D data[i])<br> 406 #def= ine blk2(i) (W[i&15]+=3Ds1(W[(i-2)&15])+W[(i-7)&15]+s0(W[(i-15)= &15]))<br> 407 <br> 408 &nbs= p; #define Ch(x,y,z) (z^(x&(y^z)))<br> 409 &nbs= p; #define Maj(x,y,z) (y^((x^y)&(y^z)))<br> 410= <br> 411 #define R(i) h(= i)+=3DS1(e(i))+Ch(e(i),f(i),g(i))+SHA256_K[i+j]+(j?blk2(i):blk0(i));\<br>&n= bsp; 412 d(i)+=3Dh(i);h(i)+=3DS= 0(a(i))+Maj(a(i),b(i),c(i))<br> 413 <br>&nbs= p; 414 // for SHA256<br> 415 &nb= sp; #define s0(x) (rotrConstant<7>(x)^rotrConstant<18>(x)= ^(x>>3))<br> 416 #define s1(x) (rotrCo= nstant<17>(x)^rotrConstant<19>(x)^(x>>10))<br>  = ; 417 #define S0(x) (rotrConstant<2>(x)^rotrConsta= nt<13>(x)^rotrConstant<22>(x))<br> 418 = #define S1(x) (rotrConstant<6>(x)^rotrConstant<11>(x)^ro= trConstant<25>(x))<br> 419 <br> &= nbsp; 420 void SHA256_HashBlock_CXX(word32 *state, const= word32 *data)<br> 421 {<br> 422= word32 W[16]=3D{0}, T[8];<br> &= nbsp; 423 /* Copy context->state[]= to working vars */<br>-> 424 memc= py(T, state, sizeof(T));<br> 425  = ; /* 64 operations, partially loop unrolled */<br> 426 &n= bsp; for (unsigned int j=3D0; j<64; j+=3D= 16)<br> 427 {<br> &n= bsp; 428 R( 0= ); R( 1); R( 2); R( 3);<br> 429 = R( 4); R( 5); R( 6); R( 7);<br> = 430 R( 8); R(= 9); R(10); R(11);<br> 431  = ; R(12); R(13); R(14); R(15);<br> 432 &= nbsp; }<br> 433 &nb= sp; /* Add the working vars back into context.state[] */<= br> 434 state[0] +=3D a(0= );<br> 435 state[1] +=3D = b(0);<br> 436 state[2] += =3D c(0);<br> 437 state[3= ] +=3D d(0);<br> 438 stat= e[4] +=3D e(0);<br> 439 s= tate[5] +=3D f(0);<br> 440  = ; state[6] +=3D g(0);<br> 441 &n= bsp; state[7] +=3D h(0);<br> 442 }<br> = 443 <br> 444 #unde= f Ch<br>(lldb) bt<br>* thread #1, name =3D 'amule', stop reason =3D signal = SIGSEGV: invalid address (fault address: 0x10)<br> * frame #0: 0x0000000801699e85 libcryptopp.so.8`CryptoPP::(anonymous=20 namespace)::SHA256_HashBlock_CXX(state=3D0x0000000000000010,=20 data=3D0x00007fffffffd440) at sha.cpp:424:5<br> frame #1:= =20 0x000000080169ad1d=20 libcryptopp.so.8`CryptoPP::SHA256::HashMultipleBlocks(this=3D0x00007fffffff= d430, input=3D0x00007fffffffd480, length=3D64) at sha.cpp:977:13<br> = frame #2: 0x000000080161bcbf=20 libcryptopp.so.8`CryptoPP::IteratedHashBase<unsigned int,=20 CryptoPP::HashTransformation>::Update(unsigned char const*, unsigned=20 long) [inlined] CryptoPP::IteratedHashBase<unsigned int,=20 CryptoPP::HashTransformation>::HashBlock(this=3D0x00007fffffffd430,=20 input=3D0x00007fffffffd440) at iterhash.h:109:4<br> frame= #3:=20 0x000000080161bca5=20 libcryptopp.so.8`CryptoPP::IteratedHashBase<unsigned int,=20 CryptoPP::HashTransformation>::Update(this=3D0x00007fffffffd430,=20 input=3D"^\xd1\U00000013$\U0000001c\xb63\a\U00000019}\x85|\xde=C8=85\x84\xd= bA\xc6\xdfw\xa0\xa0\xff\xe7N\xc0t\xa0\x83\U0000001d\xdd", length=3D32) at iterhash.cpp:38:4<br> frame #4: 0x000000= 08016711e0=20 libcryptopp.so.8`CryptoPP::RandomPool::IncorporateEntropy(this=3D0x00000000= 00877938, =20 input=3D"^\xd1\U00000013$\U0000001c\xb63\a\U00000019}\x85|\xde=C8=85\x84\xd= bA\xc6\xdfw\xa0\xa0\xff\xe7N\xc0t\xa0\x83\U0000001d\xdd", length=3D32) at randpool.cpp:36:7<br> frame #5: 0x000000= 080165b27d=20 libcryptopp.so.8`CryptoPP::AutoSeededRandomPool::Reseed(this=3D0x0000000000= 877938, blocking=3Dfalse, seedSize=3D32) at osrng.cpp:330:2<br> = frame #6:=20 0x0000000000793fbe=20 amule`CryptoPP::AutoSeededRandomPool::AutoSeededRandomPool(this=3D0x0000000= 000877938, blocking=3Dfalse, seedSize=3D32) at osrng.h:171:4<br> fr= ame #7: 0x0000000000793e3a amule`::__cxx_global_var_init.1() at RandomFunct= ions.cpp:31:39<br> frame #8: 0x0000000000793f7e amule`_GL= OBAL__sub_I_RandomFunctions.cpp at RandomFunctions.cpp:0<br> &nb= sp; frame #9: 0x000000080086e0fd ld-elf.so.1<br> frame #1= 0: 0x000000080086c38b ld-elf.so.1<br><br></div><div><br><br></div></div></d= iv></div></div></div></div></div></div></div></div><div><br></div></div></d= iv></body></html> ------=_Part_2071740_877850499.1680037766386--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1889988356.2071741.1680037766388>