X10 Launcher fails with buffer overflow if X10_HOSTFILE does not exist

Description

If a non-existent host file is specified, the X10 Launcher crashes with a buffer overflow. It should check for the existence of the file and print a nice error message.

[noformat]
$ X10_HOSTFILE=dummy X10_NPLACES=2 x10 MyProgram

  •  

    •  

      • buffer overflow detected ***: /home/jjmiltho/x10/x10.dist/bin/X10Launcher terminated
        ======= Backtrace: =========
        /lib/x86_64-linux-gnu/libc.so.6(+0x7329f)[0x7fd3b235e29f]
        /lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x5c)[0x7fd3b23f5bbc]
        /lib/x86_64-linux-gnu/libc.so.6(+0x109a90)[0x7fd3b23f4a90]
        /lib/x86_64-linux-gnu/libc.so.6(+0x10a014)[0x7fd3b23f5014]
        /home/jjmiltho/x10/x10.dist/bin/X10Launcher[0x402781]
        /home/jjmiltho/x10/x10.dist/bin/X10Launcher[0x402ade]
        /home/jjmiltho/x10/x10.dist/bin/X10Launcher[0x401d27]
        /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7fd3b230cf45]
        /home/jjmiltho/x10/x10.dist/bin/X10Launcher[0x401e12]

$ X10_HOSTFILE=dummy X10_NPLACES=2 ./a.out

  •  

    •  

      • buffer overflow detected ***: ./a.out terminated
        ======= Backtrace: =========
        /lib/x86_64-linux-gnu/libc.so.6(+0x7329f)[0x7f033d98d29f]
        /lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x5c)[0x7f033da24bbc]
        /lib/x86_64-linux-gnu/libc.so.6(+0x109a90)[0x7f033da23a90]
        /lib/x86_64-linux-gnu/libc.so.6(+0x10a014)[0x7f033da24014]
        /home/jjmiltho/x10/x10.dist/lib/libx10rt_sockets.so(_ZN8Launcher10initializeEiPPc+0x231)[0x7f033e50ae41]
        /home/jjmiltho/x10/x10.dist/lib/libx10rt_sockets.so(_ZN8Launcher5SetupEiPPc+0x8e)[0x7f033e50b19e]
        /home/jjmiltho/x10/x10.dist/lib/libx10rt_sockets.so(x10rt_net_init+0xcf)[0x7f033e509bef]
        /home/jjmiltho/x10/x10.dist/lib/libx10rt_sockets.so(x10rt_lgl_init+0x2c)[0x7f033e5114bc]
        /home/jjmiltho/x10/x10.dist/stdlib/lib/libx10.so(_ZN6x10aux12network_initEiPPc+0x19)[0x7f033f7e1dc9]
        /home/jjmiltho/x10/x10.dist/stdlib/lib/libx10.so(+0x723715)[0x7f033f7df715]
        /home/jjmiltho/x10/x10.dist/lib/libgc.so.1(GC_inner_start_routine+0x53)[0x7f033ed724f3]
        /home/jjmiltho/x10/x10.dist/lib/libgc.so.1(GC_call_with_stack_base+0x12)[0x7f033ed6d592]
        /lib/x86_64-linux-gnu/libpthread.so.0(+0x8184)[0x7f033eb3c184]
        /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7f033da1437d]
        [noformat]

Environment

Managed and Native X10

Status

Assignee

Josh Milthorpe

Reporter

Josh Milthorpe

Labels

None

External issue ID

None

Components

Fix versions

Affects versions

X10 2.6.0

Priority

Medium
Configure