Reply To: svn 1586 crashed when scan

#12162
yllu
Participant

I ran another test with only 2 m4v files that I mentioned above.
It successfaully lasted a weekend (about 3 days).
I tried to make the 2 m4v file name longer.

    720p_VideoOnlyabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz.m4v

    news_sif_1mabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz.m4v

The test fails after a few hours.
These are some log that I collected from gdb:


0x40152f94 in nanosleep () from /lib/libc.so.6
(gdb) br rend-posix.c:460
Breakpoint 1 at 0x22f4c: file rend-posix.c, line 460.
(gdb) c
Continuing.
Program received signal SIGSEGV, Segmentation fault.
0x4014eb30 in readdir_r () from /lib/libc.so.6
(gdb) bt
#0 0x4014eb30 in readdir_r () from /lib/libc.so.6
#1 0x00012220 in scan_path (path=0xbeff1bb0 "/i-data/bbb56a93/public/LongFile")
at mp3-scanner.c:365
#2 0x0001258c in scan_init (patharray=0x9b288) at mp3-scanner.c:284
#3 0x0000bb00 in main (argc=2, argv=0x0) at main.c:615
(gdb) fr 1
#1 0x00012220 in scan_path (path=0xbeff1bb0 "/i-data/bbb56a93/public/LongFile")
at mp3-scanner.c:365
365 err=readdir_r(current_dir,(struct dirent *)de,&pde);
(gdb) l
360 return 0;
361 }
362
363 pde=(struct dirent *)&de;
364
365 err=readdir_r(current_dir,(struct dirent *)de,&pde);
366 if(err == -1) {
367 DPRINTF(E_DBG,L_SCAN,"Error on readdir_r: %sn",strerror(errno));
368 err=errno;
369 closedir(current_dir);
(gdb) p pde
$1 = (struct dirent *) 0x0
(gdb) p de
$2 = "30b000001225S)À0000720p_VideoOnlyabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz.m4v", '' , "200^a", '' ...
(gdb) p current_dir
$4 = (DIR *) 0x40a36008
(gdb) print *current_dir
$5 =
(gdb) print readdir_r
$6 = {} 0x4014ea1c

Maybe the buffer size of file name or something is not enough and make pde become 0x0.