Menu

#12 Quoted hexstrings crash compiler

open
nobody
None
5
2010-06-13
2010-06-13
No

Main {
MfgCVCData "0xABCD";
}

crashes the compiler.

Main {
MfgCVCData 0xABCD;
}

works fine. Happens with both 0.9.5 and 0.9.6.

The crash is:

*** glibc detected *** /home/bbaetz/src/docsis/src/docsis: free(): invalid pointer: 0x0000000000615f60 ***

(gdb) bt
#0 0x0000003638e329a5 in raise () from /lib64/libc.so.6
#1 0x0000003638e34185 in abort () from /lib64/libc.so.6
#2 0x0000003638e6fe0b in __libc_message () from /lib64/libc.so.6
#3 0x0000003638e75726 in malloc_printerr () from /lib64/libc.so.6
#4 0x00000000004040bf in encode_hexstr (buf=0x6eec14 "0",
tval=0x7fffffffd9c0, sym_ptr=0x619290) at docsis_encode.c:377
#5 0x0000000000406e90 in create_tlv (sym_ptr=0x619290, value=0x7fffffffd9c0)
at docsis_yy.y:220
#6 0x0000000000407c15 in yyparse () at docsis_yy.y:165
#7 0x0000000000408257 in parse_config_file (
file=0x7fffffffe71f "/tmp/foo.cf", parse_tree_result=0x615e00)
at docsis_yy.y:586
#8 0x0000000000402392 in encode_one_file (
input_file=0x7fffffffe71f "/tmp/foo.cf",
output_file=0x7fffffffe734 "/tmp/foo.cm", key=0x7fffffffe2f0 "foobar\n",
keylen=6, encode_docsis=1) at docsis.c:308
#9 0x0000000000402e27 in main (argc=5, argv=0x7fffffffe458) at docsis.c:286

Discussion

  • Richard Laager

    Richard Laager - 2012-03-17

    I can confirm this crash. I looked at the code for a while, but I can't figure it out. I didn't write this program; I just adopted it when it was abandoned.

     
  • Richard Laager

    Richard Laager - 2012-03-17

    I'm moving this to the Bugs tracker, since there is no patch attached.

     

Log in to post a comment.