Access violation in libfreetype_pludgin.dll

This forum is about all development around libVLC.
Tommy_y
New Cone
New Cone
Posts: 9
Joined: 21 May 2012 02:44

Access violation in libfreetype_pludgin.dll

Postby Tommy_y » 01 Nov 2012 07:43

Hello everyone,
I wrote a small demo with libvlc API, it randomly crashes for the "Unhandled exception in MyDemo.exe(libfreetype_pludgin.dll)0x0000005:Access voilation" error.

***programming environment: Visual Studio 2005 on Windows OS
***programming language: c++
***detailed call stack information:
=>libfreetype_pludgin.dll!04436d41() // last call stack where error occur
ntdll.dll!7c93005d()
msvcrt.dll!77bfc2de()
libfreetype_pludgin.dll!04437758()
libfreetype_pludgin.dll!04428872()
msvcrt.dll!77bfc2de()
ntdll.dll!7c90035d()
msvcrt.dll!77bfc2de()
libvlccore.dll!6a5c0515()
libvlccore.dll!6a5e16eb()
libvlccore.dll!6a59ddec()
...

relevant code:
int CPlayer::InitInstance(void )
{
const char * const vlc_args[] = {
"--ignore-config",
"--no-osd",
};
m_pVlcInstance = libvlc_new (sizeof(vlc_args) / sizeof(vlc_args[0]), vlc_args);
if (NULL == m_pVlcInstance)
return PLAYER_ERROR;
m_pMediaPlayer = libvlc_media_player_new(m_pVlcInstance);
if (NULL == m_pMediaPlayer)
return PLAYER_ERROR;

return 0;
}

size_t CPlayer::PlayFile(char *pstrFilePath)
{
if (NULL == pstrFilePath)
return PLAYER_ERROR
if (_access(pstrFilePath, 0x00) == -1)
return PLAYER_ERROR;
libvlc_media_t *pMedia = libvlc_media_new_path(m_pVlcInstance, pstrFilePath);
libvlc_media_add_option(pMedia, m_strMediaOption.c_str());
libvlc_media_player_set_media(m_pMediaPlayer, pMedia);
libvlc_media_player_play(m_pMediaPlayer);
}

In my project, 2 CPlayer object was created, and display different video on dialogs.
I've been puzzled by this for weeks now, has anybody met the same problem? I've checked the libfreetype_pldgin.dll file for times, it was copied out directly from the VLC SDK, there shouldn't be any problem on the dll file.

by the way, if someone can offer a stable C++ demo that I can learn from, I'll be really appreciate.. :)

Tommy_y
New Cone
New Cone
Posts: 9
Joined: 21 May 2012 02:44

Re: Access violation in libfreetype_pludgin.dll

Postby Tommy_y » 01 Nov 2012 08:02

and I add a line in size_t CPlayer::PlayFile(char *pstrFilePath):
...
ibvlc_media_t *pMedia = libvlc_media_new_path(m_pVlcInstance, pstrFilePath);
libvlc_media_add_option(pMedia, m_strMediaOption.c_str());
libvlc_media_player_set_media(m_pMediaPlayer, pMedia);
libvlc_media_release(pMedia); // The new line
libvlc_media_player_play(m_pMediaPlayer);
...
the application still crashes...

Rémi Denis-Courmont
Developer
Developer
Posts: 15266
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Access violation in libfreetype_pludgin.dll

Postby Rémi Denis-Courmont » 01 Nov 2012 08:53

Something is trying to dereference a NULL pointer. Without a more detailled stack trace, I doubt anyone can help any further than that.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Tommy_y
New Cone
New Cone
Posts: 9
Joined: 21 May 2012 02:44

Re: Access violation in libfreetype_pludgin.dll

Postby Tommy_y » 01 Nov 2012 09:39

Something is trying to dereference a NULL pointer. Without a more detailled stack trace, I doubt anyone can help any further than that.
is there a way to trace into dll files? I tried to find one, but failed.

There's another error window printed more information "Unhandled exception at 0x04356D41 in MyDemo.exe(libfreetype_pludgin.dll): 0xC0000005: Access violation reading location 0xfeeefeee."
means a function whose virtual address is 0x04356D41 is trying to free a freed memory block.
On windows, an application was load into virtual memory address at 0x00400000 by default, VS2005 can produce a map file records all function address when compiling a project, but 0x04356D41 as a function address in dll was not included in the map file... I don't know how to trace the error further.. any prompts?

eli13
Blank Cone
Blank Cone
Posts: 25
Joined: 21 May 2012 15:28

Re: Access violation in libfreetype_pludgin.dll

Postby eli13 » 07 Dec 2012 14:56

Try the following: Use the option '--no-video-title-show'. Then it should not display the video-url, and probably it does not need libfreetype_plugin.dll. Or try to simply delete libfreetype_plugin.dll

I also expericene Access Violations in libfreetype-plugin from time-to-time when I use 'libvlc_video_set_marquee_string(..)' to display a String on top of the video. I think it is related to the deleting, or not deleting the char that is passed to

libvlc_video_set_marquee_string(m_pPlayer, libvlc_marquee_Text, m_overlayText);

I cannot reproduce the Access Violation if I
a) never delete the char* that is passed (but get a memory-leak then, but maybe thats also simply reported wrong from visual studio debugger)
b) never change the char* that is passed

So, my question: Who is responsible for deleting the string passed to libvlc_video_set_marquee_string, and, if I am responsible, when is it save to delete it?

Rémi Denis-Courmont
Developer
Developer
Posts: 15266
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Access violation in libfreetype_pludgin.dll

Postby Rémi Denis-Courmont » 07 Dec 2012 16:02

The caller is responsible for deleting all string parameters. LibVLC makes its own copy if/when it needs to keep one.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 32 guests