Skip to content

Unfriendly Crash #40

Open
Open
@jcburley

Description

@jcburley

I tried running a program that expected at least one argument, without providing arguments, and got this:

$ ./cljc
GC Warning: Failed to expand heap by -4096 bytes
GC Warning: Failed to expand heap by -4096 bytes
GC Warning: Out of Memory! Heap size: 0 MiB. Returning NULL!
Segmentation fault

Seems a little unfriendly. Perhaps there's a reasonable way to avoid this and do something more elegant instead?

Here's the source (it'll look familiar):

(ns cljc.user)

(defn -main
  [arg & args]
  (println "Here are your args:")
  (flush)
  (apply println (cons arg args)))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions