Hi Ed,

The problem in the compiler is that it invokes hashcode on literals. I
plan on fixing this soon.

The fact that 'foo new' doesn't give you a valid struct is itself not
a bug, though. You need to use <struct>.

Slava

On Mon, Oct 26, 2009 at 9:33 PM, Ed Swartz <[email protected]> wrote:
> Hi,
>
> I get a segfault loading this module (simplified), Linux-x86-32 from
> master (stack trace below).
>
> I looked a bit further and it seems that I should have been using
> "<struct>" here, not "new".  When I change that, the segfault goes away.
> FWIW, "meshData new" works from the listener.
>
> ----------
>
> USING: sequences io classes classes.struct
> math.vectors  alien.c-types io.encodings.binary io.files kernel
> ;
> IN: bugs.meshes
>
>
> STRUCT: meshData
> { foo int }
>
> ;
>
> <PRIVATE
>
> : (read-mesh) ( -- meshData )
>    meshData new
>    ;
>
> PRIVATE>
>
> : read-mesh ( filename -- meshData )
>    binary [ (read-mesh) ] with-file-reader
>    ;
>
> ------
>
>
> Memory protection fault at address 0
>
> (listener)
> M\ interactor stream-read-quot
> handle-interactive
> try-parse
> parse-lines-interactive
> (parse-lines)
> (parse-until)
> parse-step
> use-vocab
> M\ vocab (load-vocab)
> load-source
> parse-file
> parse-stream
> finish-compilation-unit
> M\ optimizing-compiler recompile
> compile-loop
> compile-word
> backend
> optimize-cfg
> value-numbering
> value-numbering-step
> M\ insn process-instruction
> number-values
> expr>vn
> M\ hashtable at*
> M\ tuple tuple-hashcode
> M\ sequence hashcode*
> M\ uchar-array nth-unsafe
> [
>    63 getenv error-thread set-global
>    continuation -> error-continuation set-global rethrow
> ]
>
> -- Ed
>
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Factor-talk mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to