Git Product home page Git Product logo

Comments (8)

leyarotheconquerer avatar leyarotheconquerer commented on July 20, 2024 2

I've duplicated this error on OSX using the following script:

HAI 1.3
    I HAS A counter ITZ 0
    I HAS A number ITZ 0
    IM IN YR loop
        counter R SUM OF counter AN 1
        SUM OF 1 AN 2 
        number R SUM OF IT AN 3
        VISIBLE ":{counter}:>:{number}"
    IM OUTTA YR loop
KTHXBYE

This code segfaults in the first 200 iterations or so. When run on Linux, it runs perfectly fine, so this appears to be an OSX issue. I used XCode to build this, so it may also be a clang issue.

Cursory debugging indicates that the segfault occurs on various calls to free() in the statement evaluation logic.

EDIT: Looks like the error was a double free of the implicit IT variable. I'll create a pull request to fix this.

from lci.

initbar avatar initbar commented on July 20, 2024

Huh.. this looks fun ! I'll also investigate this bug ~

from lci.

initbar avatar initbar commented on July 20, 2024

@jasonhemann After ~50,000 of runs, I'm still unable to reproduce the segfault:

ubuntu@server ~> i=0; while :; do echo "[$i] $(./lci bug.lol)" ; i=$(( i+1 )) ; done 2> bug.log
...
[50000] 6
[50001] 6

I'm just wondering how you have compiled the lci binary. Did you use any optimization flags?

from lci.

jasonhemann avatar jasonhemann commented on July 20, 2024

Hi,

I am compiling future branch, on which I'm up to date. I'm running the Makefile as usual, but I do see two warnings when I compile.

bash-3.2$ sudo make 
Password:
Scanning dependencies of target lci
[ 10%] Building C object CMakeFiles/lci.dir/interpreter.c.o
[ 20%] Building C object CMakeFiles/lci.dir/lexer.c.o
[ 30%] Building C object CMakeFiles/lci.dir/main.c.o
[ 40%] Building C object CMakeFiles/lci.dir/parser.c.o
/Users/jhemann/Documents/lci/parser.c:2914:55: warning: use of logical '||' with constant operand [-Wconstant-logical-operand]
        if (!status) status = acceptToken(&tokens, TT_HASAN) || -1;
                                                             ^  ~~
/Users/jhemann/Documents/lci/parser.c:2914:55: note: use '|' for a bitwise operation
        if (!status) status = acceptToken(&tokens, TT_HASAN) || -1;
                                                             ^~
                                                             |
1 warning generated.
[ 50%] Building C object CMakeFiles/lci.dir/tokenizer.c.o
[ 60%] Building C object CMakeFiles/lci.dir/unicode.c.o
[ 70%] Building C object CMakeFiles/lci.dir/error.c.o
[ 80%] Building C object CMakeFiles/lci.dir/binding.c.o
/Users/jhemann/Documents/lci/binding.c:12:11: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
        while (c = input[pos]) {
               ~~^~~~~~~~~~~~
/Users/jhemann/Documents/lci/binding.c:12:11: note: place parentheses around the assignment to silence this warning
        while (c = input[pos]) {
                 ^
               (             )
/Users/jhemann/Documents/lci/binding.c:12:11: note: use '==' to turn this assignment into an equality comparison
        while (c = input[pos]) {
                 ^
                 ==
1 warning generated.
[ 90%] Building C object CMakeFiles/lci.dir/inet.c.o
[100%] Linking C executable lci
[100%] Built target lci

from lci.

initbar avatar initbar commented on July 20, 2024

@jasonhemann Hmm.. when I compiled it on Docker ubuntu:17.10 image, I also saw the same make log. However, I am still unable to reproduce the issue..

screenshot

from lci.

jasonhemann avatar jasonhemann commented on July 20, 2024

What other information can I supply that would help narrow this down?

from lci.

jasonhemann avatar jasonhemann commented on July 20, 2024

@initbar I'm compiling on OSX 10.10.5, with what I assume is the standard OSX build environment.

from lci.

initbar avatar initbar commented on July 20, 2024

@jasonhemann Hmm, then I'm not sure if I can be helpful 😅 (I don't have any Macs)

from lci.

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.