Ticket #2173 (new bug)

Opened 3 years ago

Last modified 3 years ago

parrot_debugger --help coredumps

Reported by: dukeleto Owned by:
Priority: major Milestone:
Component: tools Version: 3.6.0
Severity: medium Keywords:
Cc: Language:
Patch status: Platform: all

Description

This is pretty sad:

$ ./parrot_debugger --help
Segmentation fault (core dumped)

Change History

Changed 3 years ago by dukeleto

  • owner dukeleto deleted

Changed 3 years ago by jkeenan

darwin/ppc variant:

$ ./parrot_debugger --help
Bus error

Since the rap on parrot_debugger was always bad, I never had occasion to try it until a couple of weeks ago (when I tried this very command). So I have to wonder: Did the --help option ever do something useful? If so, perhaps we should find out when it started to fail, and why.

Thank you very much.

kid51

Changed 3 years ago by ligne

there are two levels of problem here:

firstly, --help isn't being treated as a flag, but as the name of a file to load. there's no code to handle that case, so it's presumably never worked.

but parrot_debugger also segfaults when fed any file that doesn't end in ".pbc":

$ ./parrot_debugger ops2c.pbc </dev/null
Parrot 3.7.0-devel Debugger
(Please note: the debugger is currently under reconstruction)

(pdb)
$ ./parrot_debugger ops2c.pir
Segmentation fault (core dumped)
$

according to gdb:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7ae1f7b in Parrot_gc_allocate_memory_chunk_with_interior_pointers (interp=0x1a00, size=480) at src/gc/api.c:667
667	    return interp->gc_sys->allocate_memory_chunk_with_interior_pointers(interp, size);
(gdb) bt
#0  0x00007ffff7ae1f7b in Parrot_gc_allocate_memory_chunk_with_interior_pointers (interp=0x1a00, size=480) at src/gc/api.c:667
#1  0x00007ffff7b3d2a9 in Parrot_pf_new (interp=0x1a00, is_mapped=0) at src/packfile/api.c:1355
#2  0x00007ffff7b3d45a in PackFile_new (interp=0x1a00, is_mapped=0) at src/packfile/api.c:1388
#3  0x00007ffff7c641a1 in imcc_run_compilation_internal (imcc=0x6abe28, source=0x786158, is_file=1, is_pasm=0) at compilers/imcc/main.c:555
#4  0x00007ffff7c640f6 in imcc_run_compilation_reentrant (imcc=0x6abe28, fullname=0x786158, is_file=1, is_pasm=0) at compilers/imcc/main.c:527
#5  0x00007ffff7c64067 in imcc_compile_file (imcc=0x6abe28, fullname=0x786158, is_pasm=0) at compilers/imcc/main.c:504
#6  0x00007ffff7afdebc in Parrot_compile_file (interp=0x60a010, fullname=0x786158, is_pasm=0) at src/interp/inter_misc.c:207
#7  0x00000000004015d9 in main (argc=2, argv=0x7fffffffe008) at frontend/parrot_debugger/main.c:213
(gdb) fr 3
#3  0x00007ffff7c641a1 in imcc_run_compilation_internal (imcc=0x6abe28, source=0x786158, is_file=1, is_pasm=0) at compilers/imcc/main.c:555
555	    PackFile * const pf_raw      = PackFile_new(imcc->interp, 0);
(gdb) p *imcc
$1 = {interp = 0x1a00, prev = 0x0, imc_units = 0x0, last_unit = 0x0, cur_unit = 0x0, sr_return = 0x0, cur_namespace = 0x0, top_node = 0x0, state = 0x0, error_message = 0x0, cur_call = 0x0, cur_obj = 0x0, 
  adv_named_id = 0x0, heredoc_end = 0x0, heredoc_content = 0x0, cur_macro_name = 0x0, is_def = 0, frames = 0x0, globals = 0x0, macro_buffer = 0x0, macros = 0x1200, debug_seg = 0x0, pc = 0x0, regs = {
    0x0 <repeats 100 times>}, keys = {0x0 <repeats 16 times>}, asm_state = AsmDefault, ghash = {data = 0x0, size = 0, entries = 0}, jump_buf = {{__jmpbuf = {0, 0, 0, 0, 0, 0, 0, 0}, __mask_was_saved = 0, 
      __saved_mask = {__val = {0 <repeats 16 times>}}}}, IMCC_DEBUG = 0, cnr = 0, debug = 0, dont_optimize = 0, emitter = 0, error_code = 0, expect_pasm = 0, imcc_warn = 0, in_pod = 0, ins_line = 0, 
  keyvec = 0, line = 0, optimizer_level = 0, nargs = 0, n_comp_units = 0, nkeys = 0, compiler_state = 0, verbose = 0, seen_main = 0, npc = 0}
(gdb) 

for comparison, {./parrot_debugger /dev/null} segfaults, whereas {./parrot_debugger --help.pbc} works fine!

Note: See TracTickets for help on using tickets.