Wireshark-bugs: [Wireshark-bugs] [Bug 13175] Runtime Error when try to merge .pcap files (Wiresh

Date: Sat, 26 Nov 2016 16:32:29 +0000

Comment # 9 on bug 13175 from
OK, Windbg seems to be a liar: in the callstack of merge_files function,
out_filename would be NULL and out_fd would be not null:
out_fd    0n1000800256    int
out_filename    0x00000000`00000000 ""    char *
file_type    0n4096    int
in_filenames    0x00000074`d02f9e98    char **
in_file_count    2    unsigned int
do_append    0n0    int
mode    IDB_MERGE_MODE_ALL_SAME (0n1)    idb_merge_mode
snaplen    0    unsigned int
app_name    0x00007ff7`a57b5458 "Wireshark"    char *
cb    0x00000074`d02f9e18 struct merge_progress_callback_t *    struct
merge_progress_callback_t *
err    0x00000074`d02f9e60    int *
err_info    0x00000074`d02f9e08    char **
err_fileno    0x00000074`d02f9e00    unsigned int *
close_err    <Value unavailable>    int
count    0n0    int
display_basename    <Value unavailable>    char *
err_message    <Value unavailable>    struct _GString *
frame_type    <Value unavailable>    int
idb_inf    0x00000000`00000000 struct wtapng_iface_descriptions_s *    struct
wtapng_iface_descriptions_s *
in_file    <Value unavailable>    struct merge_in_file_s *
in_files    0x00000000`00000000 struct merge_in_file_s *    struct
merge_in_file_s *
pdh    <Value unavailable>    struct wtap_dumper *
phdr    <Value unavailable>    struct wtap_pkthdr *
shb_hdrs    0x00000000`00000000 struct _GArray *    struct _GArray *
snap_phdr    struct wtap_pkthdr    struct wtap_pkthdr
status    <Value unavailable>    merge_result
stop_flag    <Value unavailable>    int

But if I go in the context of the caller function (cf_merge_files), I get:
out_filenamep    0x00000074`d02f9f90    char **
 *    0x0000024b`39a84a40
"C:\Users\sindelka\AppData\Local\Temp\wireshark_20161125222525_a06920"    char
*
in_file_count    0n2    int
in_filenames    0x00000074`d02f9e98    char **
file_type    0n2    int
do_append    0n0    int
cb    struct merge_progress_callback_t    struct merge_progress_callback_t
err    0n0    int
err_fileno    0    unsigned int
err_info    0x00000000`00000000 ""    char *
out_fd    0n0    int
out_filename    0x0000024b`39a84a40
"C:\Users\sindelka\AppData\Local\Temp\wireshark_20161125222525_a06920"    char
*
status    <Value unavailable>    merge_result
tmpname    0x0000024b`398aaca0
"C:\Users\sindelka\AppData\Local\Temp\wireshark_20161125222525_a06920"    char
*

And here out_filename is meaningful and out_fd is NULL (which would explain the
assert seen).
It's like if the attempt to open
C:\Users\sindelka\AppData\Local\Temp\wireshark_20161125222525_a06920 file had
failed:
out_fd = ws_open(out_filename, O_CREAT|O_TRUNC|O_BINARY, 0600);

On Windows, ws_open is internally using _wopen. From MSDN documentation, return
value -1 is an error. Is 0 a valid value? Nothing seems to forbid it in the
documentation, and in that case we should remove the assert.

Pavel, is the issue systematic for you, or random? I could compile a test
version with the assert removed, but what are the chances to get 0 again?


You are receiving this mail because:
  • You are watching all bug changes.