[vlc-devel] memory breakage at vlc_stat
Naohiro KORIYAMA
nkoriyama at gmail.com
Sat Jan 28 13:26:13 CET 2012
2012/1/28 Rémi Denis-Courmont <remi at remlab.net>:
> Le samedi 28 janvier 2012 12:01:41 Naohiro KORIYAMA, vous avez écrit :
>> VLC win32 nightly builds (vlc-2.1.0-git-20120128-0411-win32-debug) does not
>> run.
>>
>> int vlc_stat (const char *filename, struct stat *buf)
>> int ret = _wstati64 (wpath, buf);
>>
>> compiler warning appears here because of incompatible pointer type:
>> ../../extras/package/win32/../../../src/win32/filesystem.c: In
>> function 'vlc_stat':
>> ../../extras/package/win32/../../../src/win32/filesystem.c:246:
>> warning: passing argument 2 of '_wstati64' from incompatible pointer
>> type
>> /usr/lib/gcc/i586-mingw32msvc/4.4.4/../../../../i586-mingw32msvc/include/sy
>> s/stat.h:182: note: expected 'struct _stati64 *' but argument is of type
>> 'struct stat *'
>>
>> This cause memory breakage.
>> After passing _wstati64(), filename is broken. I confirmed it with gdb.
>
> It works fine here in fact.
I'm sorry, at that time, filename was broken on my build, but filename
is not broken on NB.
But another part (relpath, absdir) is broken on NB.
Breakpoint 1, AllocatePluginDir (bank=<optimized out>,
maxdepth=<optimized out>, absdir=<optimized out>, reldir=0x0)
at ../../extras/package/win32/../../../src/modules/bank.c:416
416 ../../extras/package/win32/../../../src/modules/bank.c: No
such file or directory.
in ../../extras/package/win32/../../../src/modules/bank.c
(gdb) p filename
No symbol "filename" in current context.
(gdb) p abspath
$9 = 0x1f8ae70 "d:\\utils\\vlc-nightly\\plugins\\3dnow"
(gdb) p relpath
$10 = 0x1eca058 "3dnow"
(gdb) p reldir
$11 = 0x0
(gdb) n
419 in ../../extras/package/win32/../../../src/modules/bank.c
(gdb) p abspath
$12 = 0x1f8ae70 "d:\\utils\\vlc-nightly\\plugins\\3dnow"
(gdb) p relpath
$13 = 0x4f23c633 <Address 0x4f23c633 out of bounds>
(gdb) p reldir
$14 = 0x0
(gdb)
relpath is broken after vlc_stat().
(gdb) n
419 in ../../extras/package/win32/../../../src/modules/bank.c
(gdb) n
438 in ../../extras/package/win32/../../../src/modules/bank.c
(gdb) n
440 in ../../extras/package/win32/../../../src/modules/bank.c
(gdb) p bank
$16 = <optimized out>
(gdb) p maxdepth
$17 = <optimized out>
(gdb) p abspath
$18 = 0x1dfae70 "d:\\utils\\vlc-nightly\\plugins\\3dnow"
(gdb) p relpath
$19 = 0x4f23c633 <Address 0x4f23c633 out of bounds>
(gdb) s
AllocatePluginDir (bank=0x28fc20, maxdepth=4, absdir=0x4f23c633
<Address 0x4f23c633 out of bounds>,
reldir=0x4f23c633 <Address 0x4f23c633 out of bounds>) at
../../extras/package/win32/../../../src/modules/bank.c:378
378 in ../../extras/package/win32/../../../src/modules/bank.c
(gdb) p bank
$20 = (module_bank_t *) 0x28fc20
(gdb) p maxdepth
$21 = 4
(gdb) p absdir
$22 = 0x4f23c633 <Address 0x4f23c633 out of bounds>
(gdb) p reldir
$23 = 0x4f23c633 <Address 0x4f23c633 out of bounds>
(gdb)
absdir is also broken.
(gdb) n
377 in ../../extras/package/win32/../../../src/modules/bank.c
(gdb) n
378 in ../../extras/package/win32/../../../src/modules/bank.c
(gdb) n
380 in ../../extras/package/win32/../../../src/modules/bank.c
(gdb) n
382 in ../../extras/package/win32/../../../src/modules/bank.c
(gdb) n
Program received signal SIGSEGV, Segmentation fault.
0x7493e0db in LCMapStringEx () from C:\Windows\syswow64\KernelBase.dll
(gdb) bt
#0 0x7493e0db in LCMapStringEx () from C:\Windows\syswow64\KernelBase.dll
#1 0x74944f43 in OpenRegKey () from C:\Windows\syswow64\KernelBase.dll
#2 0x7493fa03 in MultiByteToWideChar () from C:\Windows\syswow64\KernelBase.dll
#3 0x50155687 in ToWide (utf8=<optimized out>) at
../../extras/package/win32/../../../include/vlc_charset.h:72
#4 widen_path (path=0x28fa14 "") at
../../extras/package/win32/../../../src/win32/filesystem.c:56
#5 0x501559e7 in vlc_opendir (dirname=0x4f23c633 <Address 0x4f23c633
out of bounds>)
at ../../extras/package/win32/../../../src/win32/filesystem.c:158
#6 0x5013933c in AllocatePluginDir (bank=0x0, maxdepth=<optimized
out>, absdir=0x7fffffff <Address 0x7fffffff out of bounds>,
reldir=0x4f23c633 <Address 0x4f23c633 out of bounds>) at
../../extras/package/win32/../../../src/modules/bank.c:382
#7 0x50139719 in AllocatePluginDir (bank=<optimized out>,
maxdepth=<optimized out>, absdir=<optimized out>, reldir=0x0)
at ../../extras/package/win32/../../../src/modules/bank.c:440
#8 0x5013983f in AllocatePluginPath (p_this=0x23048, path=0x1d3a000
"d:\\utils\\vlc-nightly\\plugins", mode=<optimized out>)
at ../../extras/package/win32/../../../src/modules/bank.c:349
#9 0x50139ca7 in AllocateAllPlugins (p_this=<optimized out>) at
../../extras/package/win32/../../../src/modules/bank.c:277
#10 module_LoadPlugins (obj=0x23048) at
../../extras/package/win32/../../../src/modules/bank.c:187
#11 0x500c17da in libvlc_InternalInit (p_libvlc=0x23048, i_argc=3,
ppsz_argv=0x28fdd0) at
../../extras/package/win32/../../../src/libvlc.c:246
#12 0x712b1825 in libvlc_new (argc=2, argv=0x28fe40) at
../../extras/package/win32/../../../lib/core.c:59
#13 0x00401dc9 in WinMain at 16 (hInstance=0x400000, hPrevInstance=0x0,
lpCmdLine=0x833c05 "", nCmdShow=10)
at ../../extras/package/win32/../../../bin/winvlc.c:205
#14 0x004024f9 in main ()
(gdb)
--
KORIYAMA, Naohiro
nkoriyama at gmail.com
More information about the vlc-devel
mailing list