Giter VIP home page Giter VIP logo

piccolo's People

Contributors

marcasrealaccount avatar nikos1001 avatar th3t3chn0g1t avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

piccolo's Issues

Calling `piccolo_loadPackage` with a nonexistent package causes a segfault

This feels like undesirable behaviour? Since most other internal errors produce a graceful exit - whereas with this the following happens:

Could not load package asd
[1]    19239 segmentation fault (core dumped)  build/piccolo asd

The error is acknowledged but the engine still crashes.

The issue seems to be that the engine tries to run the package despite the failed load:

...
   86       engine->hadError = false;
   87       while(true) {
   88           engine->frames[engine->currFrame].prevIp = engine->frames[engine->currFrame].ip;
-> 89           piccolo_OpCode opcode = READ_BYTE();
   90           switch(opcode) {
   91               case PICCOLO_OP_RETURN:
   92                   engine->currFrame--;

And the backtrace

* thread #1, name = 'piccolo', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
  * frame #0: 0x000055555555a652 piccolo`run(engine=0x00007fffffefae10) at engine.c:89:33
    frame #1: 0x000055555555e317 piccolo`piccolo_executeBytecode(engine=0x00007fffffefae10, bytecode=0x0000555555567868) at engine.c:550:12
    frame #2: 0x000055555555e26a piccolo`piccolo_executePackage(engine=0x00007fffffefae10, package=0x0000555555567850) at engine.c:541:19
    frame #3: 0x000055555555591c piccolo`main(argc=2, argv=0x00007fffffffdf58) at main.c:154:9

I think a solution to this could be to just error-out of the program or to at least report to the caller if the loading failed and not to continue to initialize the package

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.