SEGV with non-existent constant #996

Closed
Util opened this Issue Oct 3, 2013 · 2 comments

Projects

None yet

3 participants

@Util
Member
Util commented Oct 3, 2013

Reported by: zefram@fysh.org

Got a SEGV from dubious PIR code:

$ cat t16.pir
.sub main
        .const pmc a = "b"
        .return(a)
.end
$ ./parrot t16.pir
zsh: segmentation fault  ./parrot t16.pir

-zefram

osname= linux
osvers= 3.2.0-4-amd64
arch=   x86_64-linux-gnu-thread-multi
cc=     cc

---
Flags:
    category=core
    severity=low
    ack=no

---
Summary of my parrot 5.5.0 configuration:
  configdate='Sun Sep 22 18:01:32 2013 GMT'
  Platform:
    osname=linux, archname=x86_64-linux-gnu-thread-multi
    perl=/usr/bin/perl
  Compiler:
    cc='cc', ccflags='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fstack-protector  -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DDISABLE_GC_DEBUG=1 -DNDEBUG -DHAS_GETTEXT',
  Linker and Libraries:
    link='cc', linkflags=' -fstack-protector -L/usr/local/lib -Wl,-E',
    ld='cc', ldflags=' -fstack-protector -L/usr/local/lib',
    cc_ldflags='',
    libs='-ldl -lm -lpthread -lcrypt -lrt -lgmp -lreadline '
  Dynamic Linking:
    cc_shared='-fPIC',
    link_dynamic='-Wl,-E',
    ld_share_flags='-shared -L/usr/local/lib -fstack-protector -fPIC',
    ld_load_flags='-shared -L/usr/local/lib -fstack-protector -fPIC'
  Extensions:
    o='.o', a='.a', exe='',
    share_ext='.so', load_ext='.so'
  Misc Programs:
    ar='ar', ranlib=':',
    make='make', make_set_make='#'
  Types:
    iv=long, intvalsize=8, intsize=4, opcode_t=long, opcode_t_size=8,
    ptrsize=8,  byteorder=12345678,
    nv=double, numvalsize=8, doublesize=8, longdoublesize=16

---
Environment:
    HOME =/home/zefram
    LANG  (unset)
    LANGUAGE  (unset)
    LD_LIBRARY_PATH  (unset)
    LOGDIR  (unset)
    PATH =/home/zefram/usr/perl/util:/home/zefram/pub/x86_64-unknown-linux-gnu/bin:/home/zefram/pub/common/bin:/usr/bin:/bin:/usr/local/bin:/usr/games
    SHELL =/usr/bin/zsh
@NotFound NotFound added a commit that referenced this issue Oct 12, 2013
@NotFound NotFound Fix SEGV from #996 9983b88
@NotFound
Member

Fixed in 07dfdb4..9983b88
This avoids the segfault, But I think the issue shouldn't be closed until a better dignostic is provided for this condition.

@rurban rurban added a commit that referenced this issue Mar 2, 2014
@rurban rurban [test] add 2 testcases to t/compilers/imcc/syn/const.t
#1024 TODO
and #996 fixed.
Thanks to zefram for the testcases
a8b2c78
@rurban
Member
rurban commented Mar 5, 2014

dying with "wrong .const value" is good enough for me.

$ ./parrot t/compilers/imcc/syn/const_40.pir 
error:imcc:wrong .const value
    in file 't/compilers/imcc/syn/const_40.pir' line 3
@rurban rurban closed this Mar 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment