GithubHelp home page GithubHelp logo

Comments (4)

romanovj avatar romanovj commented on July 17, 2024

aarch64


~/Demolito/src $ make
clang -march=native -std=gnu11 -DNDEBUG  -fsanitize=address -fsanitize=undefined -O1 -g -flto -Wfatal-errors -Wall -Wextra -Wshadow -Wstrict-prototypes -Wsign-conversion -Wmissing-prototypes -Wcast-align -Wmissing-variable-declarations -Wshorten-64-to-32 -Wimplicit-int-conversion -Wimplicit-int-float-conversion -DVERSION=\"dev\" ./*.c -o demolito -s -lm -lpthread
~/Demolito/src $ ./demolito bench
br1kq1r1/pppppp1p/3nn1p1/8/6P1/1P1NN3/P1PPPP1P/R2KQ1RB b Kkq - 0 5
position.c:564:15: runtime error: index 6 out of bounds for type 'int[6]'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior position.c:564:15 in
=================================================================
==24906==ERROR: AddressSanitizer: global-buffer-overflow on address 0x005b19c2f6f8 at pc 0x005b19c08dc0 bp 0x005df0bfab30 sp 0x005df0bfab28
READ of size 4 at 0x005b19c2f6f8 thread T1
    #0 0x5b19c08dbc  (/data/data/com.termux/files/home/Demolito/src/demolito+0x3bdbc)
    #1 0x5b19c13450  (/data/data/com.termux/files/home/Demolito/src/demolito+0x46450)
    #2 0x5b19c0d180  (/data/data/com.termux/files/home/Demolito/src/demolito+0x40180)
    #3 0x5b19c0b998  (/data/data/com.termux/files/home/Demolito/src/demolito+0x3e998)
    #4 0x7df1dc6760 in __pthread_start(void*) pthread_create.cpp
    #5 0x7df1d63470 in __start_thread clone.cpp

0x005b19c2f6f8 is located 0 bytes to the right of global variable 'PieceValue' defined in './tune.c' (0x5b19c2f6e0) of size 24
SUMMARY: AddressSanitizer: global-buffer-overflow (/data/data/com.termux/files/home/Demolito/src/demolito+0x3bdbc)
Shadow bytes around the buggy address:
  0x001b63385e80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x001b63385e90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x001b63385ea0: 00 00 00 00 00 00 00 00 04 f9 f9 f9 00 00 00 00
  0x001b63385eb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x001b63385ec0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x001b63385ed0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00[f9]
  0x001b63385ee0: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00
  0x001b63385ef0: 00 00 00 00 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
  0x001b63385f00: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
  0x001b63385f10: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
  0x001b63385f20: f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9 f9
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
Thread T1 created by T0 here:
    #0 0x7df3106aa8 in pthread_create out/lib/compiler-rt-aarch64/out/llvm-project/compiler-rt/lib/asan/asan_interceptors.cpp:208:3
    #1 0x5b19c0b018  (/data/data/com.termux/files/home/Demolito/src/demolito+0x3e018)
    #2 0x5b19c00954  (/data/data/com.termux/files/home/Demolito/src/demolito+0x33954)
    #3 0x7df1d5a1f4 in __libc_init (/apex/com.android.runtime/lib64/bionic/libc.so+0x4a1f4) (BuildId: 8f3a8e9a34c28768dc32f5d6eb26ddf3)
    #4 0x5b19bf22ec  (/data/data/com.termux/files/home/Demolito/src/demolito+0x252ec)

==24906==ABORTING
Aborted

from demolito.

lucasart avatar lucasart commented on July 17, 2024

Thanks for spotting this. Looks wrong indeed, will have a look

from demolito.

lucasart avatar lucasart commented on July 17, 2024

Fixed bf19a1e. Bug was introduced here 2e1656d. Previously SeeValue[] had a trailing zero which is needed when to square is empty (numerical value for that is 6, one above max piece index).

Previous compiler versions (and/or architecture?) left this bug hidden, with a padding zero there, which happened to be the correct value.

from demolito.

sk0kanik avatar sk0kanik commented on July 17, 2024

thanks.

from demolito.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.