Skip to content

Tree Shaker crashes with "kernel:die" on Windows when deploying HTTP/SSL or FFI code #3175

@iNV45i0N

Description

@iNV45i0N

Environment

  • OS: Windows 10 64-bit
  • Factor Version: Current staging/release

Describe the bug

When trying to deploy a standalone executable on Windows that requires network sockets/SSL (e.g., http.client or io.sockets.secure) or FFI, the Tree Shaker crashes during the deploy process with a kernel:die critical error.

Steps to Reproduce

  1. Create a simple vocabulary bug-test with the following code (bug-test.factor):

    USING: http.client kernel ;
    IN: bug-test
    
    : test-crash ( -- )
        "[https://www.google.com](https://www.google.com)" http-get drop ;
        
    MAIN: test-crash
  2. Create the following deploy.factor configuration:

    USING: tools.deploy.config ;
    H{
        { deploy-c-types? t }
        { deploy-console? t }
        { deploy-io 3 }
        { deploy-math? t }
        { deploy-name "bug-test" }
        { deploy-reflection 1 }
        { deploy-threads? t }
        { deploy-ui? f }
        { deploy-word-defs? f }
        { deploy-word-props? f }
    }
  3. Run "bug-test" deploy in the listener.

Actual Behavior

The deployer crashes. The listener drops into the low-level debugger:

You have triggered a bug in Factor. Please report.
critical_error: The die word was called by the library.: 0
Starting low level debugger...

The process dump shows:

{ status 1 }

And the Call Stack reveals the crash in the shaker:

executing: kernel:die
...
executing: tools.deploy.shaker:die-with2
executing: tools.deploy.shaker:(deploy)

Expected Behavior

The Tree Shaker should successfully compile the executable and retain the necessary C-types/OpenSSL bindings without crashing the VM. Setting { deploy-word-defs? t } and { deploy-word-props? t } (fat binary) seems to bypass the crash, indicating a flaw in the dead code elimination regarding FFI/SSL on Windows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions