bench_bitcoin segfaults #10801

issue janstary opened this issue on July 12, 2017
  1. janstary commented at 10:00 AM on July 12, 2017: none

    This is 0.14.2 on OpenBSD 6.1-current, compiled without the wallet and the GUI.

    $ gdb /home/hans/bin/bench_bitcoin
    GNU gdb 6.3
    Copyright 2004 Free Software Foundation, Inc.
    GDB is free software, covered by the GNU General Public License, and you are
    welcome to change it and/or distribute copies of it under certain conditions.
    Type "show copying" to see the conditions.
    There is absolutely no warranty for GDB.  Type "show warranty" for details.
    This GDB was configured as "amd64-unknown-openbsd6.1"...
    (gdb) run
    Starting program: /home/hans/bin/bench_bitcoin
    #Benchmark,count,min,max,average,min_cycles,max_cycles,average_cycles
    Base58CheckEncode,196608,0.000005146124749,0.000005236797733,0.000005161274506,15916,16197,15963
    Base58Decode,589824,0.000001735123078,0.000001747022907,0.000001739451060,5366,5403,5380
    Base58Encode,327680,0.000003168810508,0.000003213441232,0.000003180355998,9801,9939,9836
    CCheckQueueSpeed,2816,0.000328578054905,0.000447835773230,0.000366781245578,1016292,1385160,1134457
    CCheckQueueSpeedPrevectorJob,352,0.002760007977486,0.003288529813290,0.003009792755951,8536557,10171505,9309317
    CCoinsCaching,32768,0.000029465882108,0.000033692223951,0.000031760289858,91137,104208,98234
    DeserializeAndCheckBlockTest,52,0.019622266292572,0.020238459110260,0.019728614733769,60691992,62598554,61020789
    DeserializeBlockTest,60,0.017065525054932,0.017243504524231,0.017127350966136,52783352,53332710,52975011
    LockedPool,384,0.002661690115929,0.002693310379982,0.002672916899125,8232624,8330353,8267360
    MempoolEviction,10240,0.000088823959231,0.000106085790321,0.000098063284531,274729,328125,303310
    RIPEMD160,288,0.003512129187584,0.003529816865921,0.003517284161515,10862989,10917788,10879002
    RollingBloom-refresh,1,0.000435000000000,0.000435000000000,0.000435000000000
    RollingBloom-refresh,1,0.000170000000000,0.000170000000000,0.000170000000000
    RollingBloom-refresh,1,0.000169000000000,0.000169000000000,0.000169000000000
    RollingBloom-refresh,1,0.000171000000000,0.000171000000000,0.000171000000000
    RollingBloom-refresh,1,0.000169000000000,0.000169000000000,0.000169000000000
    RollingBloom-refresh,1,0.000169000000000,0.000169000000000,0.000169000000000
    RollingBloom-refresh,1,0.000169000000000,0.000169000000000,0.000169000000000
    RollingBloom-refresh,1,0.000176000000000,0.000176000000000,0.000176000000000
    RollingBloom-refresh,1,0.000169000000000,0.000169000000000,0.000169000000000
    RollingBloom-refresh,1,0.000170000000000,0.000170000000000,0.000170000000000
    RollingBloom-refresh,1,0.000170000000000,0.000170000000000,0.000170000000000
    RollingBloom-refresh,1,0.000171000000000,0.000171000000000,0.000171000000000
    RollingBloom-refresh,1,0.000170000000000,0.000170000000000,0.000170000000000
    RollingBloom-refresh,1,0.000169000000000,0.000169000000000,0.000169000000000
    RollingBloom-refresh,1,0.000183000000000,0.000183000000000,0.000183000000000
    RollingBloom-refresh,1,0.000169000000000,0.000169000000000,0.000169000000000
    RollingBloom-refresh,1,0.000170000000000,0.000170000000000,0.000170000000000
    RollingBloom-refresh,1,0.000169000000000,0.000169000000000,0.000169000000000
    RollingBloom-refresh,1,0.000171000000000,0.000171000000000,0.000171000000000
    RollingBloom-refresh,1,0.000170000000000,0.000170000000000,0.000170000000000
    RollingBloom-refresh,1,0.000170000000000,0.000170000000000,0.000170000000000
    RollingBloom-refresh,1,0.000170000000000,0.000170000000000,0.000170000000000
    RollingBloom,1310720,0.000000798583642,0.000000853880920,0.000000829975761,2470,2641,2567
    SHA1,416,0.002533122897148,0.002587437629700,0.002539083934747,7835033,8002805,7853409
    SHA256,176,0.006167054176331,0.006667971611023,0.006184346296571,19072710,20624052,19128229
    SHA256_32b,4,0.428292512893677,0.430567502975464,0.429430007934570,1324712949,1331752750,1328232850
    SHA512,256,0.004063248634338,0.004452586174011,0.004084899090230,12567756,13770634,12634628
    SipHash_32b,22,0.047202944755554,0.048211455345154,0.047355402599682,145997851,149118766,146470841
    Sleep100ms,10,0.108401417732239,0.110001564025879,0.109679198265076,335289285,340235636,339239562
    Trig,25165824,0.000000037944233,0.000000087388798,0.000000041381791,117,270,127
    
    Program received signal SIGSEGV, Segmentation fault.
    secp256k1_ecdsa_verify (ctx=0x0, sig=0x7f7fffffa280,
        msg32=0x7f7fffffa320 "u\004\227\032nss\035O\n\034\026(\234&\027Hf\214\004yf~Ub\225\207\v\a\002\233-(Y\201[\026\027\230H:w&e]\016\021\b\027H\205T\031\234G\217\020\177\177", pubkey=0x7f7fffffa240) at src/secp256k1.c:298
    298	    ARG_CHECK(secp256k1_ecmult_context_is_built(&ctx->ecmult_ctx));
    Current language:  auto; currently c
    

    OS: OpenBSD 6.1-current/amd64 CPU: Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz RAM: 8GB

  2. jonasschnelli commented at 11:59 AM on July 12, 2017: contributor

    I guess it's unrelated, but just make sure: have you compiled boost with eg++ (see https://github.com/bitcoin/bitcoin/blob/master/doc/build-openbsd.md#building-boost)?

  3. laanwj commented at 12:25 PM on July 13, 2017: member

    Can you add a backtrace please?

  4. laanwj added the label Tests on Jul 13, 2017
  5. laanwj added the label Linux/Unix on Jul 13, 2017
  6. fanquake commented at 2:30 AM on August 13, 2017: member

    @janstary Can you follow up with any more info?

  7. janstary commented at 1:45 PM on August 15, 2017: none

    Here is a gdb session with the crash and backtrace. This is the current git, freshly compiled on OpenBSD 6.1-current/amd64.

    $ gdb bench_bitcoin
    GNU gdb 6.3
    Copyright 2004 Free Software Foundation, Inc.
    GDB is free software, covered by the GNU General Public License, and you are
    welcome to change it and/or distribute copies of it under certain conditions.
    Type "show copying" to see the conditions.
    There is absolutely no warranty for GDB.  Type "show warranty" for details.
    This GDB was configured as "amd64-unknown-openbsd6.1"...
    (gdb) run
    Starting program: /home/hans/bin/bench_bitcoin
    #Benchmark,count,min,max,average,min_cycles,max_cycles,average_cycles
    Base58CheckEncode,131072,0.000007534166798,0.000011787051335,0.000007722825103,23303,36460,23886
    Base58Decode,425984,0.000002356231562,0.000002436776413,0.000002369093776,7287,7536,7327
    Base58Encode,212992,0.000004742440069,0.000004810732207,0.000004780911975,14668,14879,14787
    BenchLockedPool,448,0.002242058515549,0.002331569790840,0.002262501844338,6934706,7211705,6997946
    CCheckQueueSpeed,3328,0.000294718891382,0.000330300070345,0.000306640035258,911574,1021631,948441
    CCheckQueueSpeedPrevectorJob,288,0.003407500684261,0.003555037081242,0.003481316069762,10539449,10995752,10767751
    CCoinsCaching,73728,0.000014740595361,0.000014927703887,0.000014793118074,45592,46172,45755
    DeserializeAndCheckBlockTest,52,0.019660711288452,0.019941091537476,0.019723291580494,60810865,61677652,61004364
    DeserializeBlockTest,60,0.016931474208832,0.017354488372803,0.017022085189819,52369833,53677497,52649530
    FastRandom_1bit,512,0.002045467495918,0.002057187259197,0.002050250303000,6326659,6362948,6341452
    FastRandom_32bit,80,0.012751579284668,0.012899398803711,0.012810724973679,39439481,39898696,39623725
    MempoolEviction,9216,0.000105554237962,0.000116898445413,0.000111183824225,326473,361569,343892
    PrevectorClear,2816,0.000372765585780,0.000377792865038,0.000374598767270,1152966,1168517,1158638
    PrevectorDestructor,3072,0.000349257141352,0.000351581722498,0.000350297195837,1080247,1087456,1083473
    RIPEMD160,288,0.003499060869217,0.003518566489220,0.003508180379868,10822659,10883007,10850849
    RollingBloom-refresh,1,0.00034,0.00034,0.00034
    RollingBloom-refresh,1,0.000166,0.000166,0.000166
    RollingBloom-refresh,1,0.000168,0.000168,0.000168
    RollingBloom-refresh,1,0.000168,0.000168,0.000168
    RollingBloom-refresh,1,0.000166,0.000166,0.000166
    RollingBloom-refresh,1,0.000167,0.000167,0.000167
    RollingBloom-refresh,1,0.000166,0.000166,0.000166
    RollingBloom-refresh,1,0.000168,0.000168,0.000168
    RollingBloom-refresh,1,0.000167,0.000167,0.000167
    RollingBloom-refresh,1,0.000166,0.000166,0.000166
    RollingBloom-refresh,1,0.000196,0.000196,0.000196
    RollingBloom-refresh,1,0.000171,0.000171,0.000171
    RollingBloom-refresh,1,0.000171,0.000171,0.000171
    RollingBloom-refresh,1,0.000172,0.000172,0.000172
    RollingBloom-refresh,1,0.000174,0.000174,0.000174
    RollingBloom-refresh,1,0.000184,0.000184,0.000184
    RollingBloom-refresh,1,0.000168,0.000168,0.000168
    RollingBloom-refresh,1,0.000166,0.000166,0.000166
    RollingBloom-refresh,1,0.000166,0.000166,0.000166
    RollingBloom-refresh,1,0.000167,0.000167,0.000167
    RollingBloom-refresh,1,0.000175,0.000175,0.000175
    RollingBloom-refresh,1,0.000167,0.000167,0.000167
    RollingBloom,1310720,0.000000804811862,0.000000851363438,0.000000836557774,2489,2633,2587
    SHA1,384,0.002602942287922,0.002627596259117,0.002611627181371,8050912,8127191,8077798
    SHA256,176,0.006042242050171,0.006105422973633,0.006065829233690,18688353,18883705,18761682
    SHA256_32b,4,0.431006908416748,0.432384490966797,0.431695699691772,1333109740,1337371208,1335240474
    SHA512,288,0.003862656652927,0.003874972462654,0.003867747055160,11947200,11985307,11962985
    SipHash_32b,20,0.050858497619629,0.051098942756653,0.050977694988251,157307389,158056665,157674651
    Sleep100ms,10,0.106868982315063,0.110013008117676,0.109375691413879,330550164,340271758,338300920
    Trig,25165824,0.000000037258133,0.000000087492026,0.000000042538564,115,270,131
    
    Program received signal SIGSEGV, Segmentation fault.
    secp256k1_ecdsa_verify (ctx=0x0, sig=0x7f7ffffca898,
        msg32=0x7f7ffffca978 "u\004\227\032nss\035O\n\034\026(\234&\027Hf\214\004yf~Ub\225\207\v\a\002\233-(Y\201[\026\027\230H:w&e]\016\021\b\027H\205T\031\234G\217\020",
        pubkey=0x7f7ffffca8d8) at secp256k1.c:298
    298	secp256k1.c: No such file or directory.
    	in secp256k1.c
    Current language:  auto; currently c
    (gdb) bt
    [#0](/bitcoin-bitcoin/0/)  secp256k1_ecdsa_verify (ctx=0x0, sig=0x7f7ffffca898,
        msg32=0x7f7ffffca978 "u\004\227\032nss\035O\n\034\026(\234&\027Hf\214\004yf~Ub\225\207\v\a\002\233-(Y\201[\026\027\230H:w&e]\016\021\b\027H\205T\031\234G\217\020",
        pubkey=0x7f7ffffca8d8) at secp256k1.c:298
    Die: DW_TAG_<unknown> (abbrev = 50, offset = 23165369)
    	has children: FALSE
    	attributes:
    		DW_AT_type (DW_FORM_ref4) constant ref: 23157709 (adjusted)
    Dwarf Error: Cannot find type of die [in module /home/hans/bin/bench_bitcoin]
    (gdb) quit
    The program is running.	 Exit anyway? (y or n) y
    
  8. laanwj commented at 2:19 PM on August 15, 2017: member

    secp256k1_ecdsa_verify (ctx=0x0

    That seems to be the problem - these functions must always be called with a context. Strange.

  9. laanwj commented at 4:53 PM on August 17, 2017: member

    Strange - I just tried to reproduce this with master, I cannot reproduce the problem. bench_bitcoin as well as the tests run succesfully.

    Can you retry with master or 0.15.0rc1?

  10. MarcoFalke commented at 2:28 AM on November 28, 2017: member

    @janstary Can you either retry with master or latest release and let us know the commit id you used to reproduce?

  11. MarcoFalke closed this on Jan 16, 2018

  12. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me