View Issue Details

IDProjectCategoryView StatusLast Update
0031541FPCLCLpublic2018-02-21 21:26
ReporterZoran VučenovićAssigned ToFlorian 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product VersionProduct Build54400 
Target VersionFixed in Version3.1.1 
Summary0031541: lazvlc package - Access Violation in control LCLVLCPlayer
DescriptionControl LCLVLCPlayer raises SIGSEGV or Access Violation (depending wether you run it with debugger or not).
Steps To ReproduceFirst, make sure you have VLC installed in OS.

Install lazvlc package in the IDE and rebuild Lazarus.
LCLVLCPlayer will appear on tab Multimedia in component palette.

Create new Lazarus Application and put LCLVLCPlayer component on form.
Now try to run the project
 - if you run in IDE with debugger you get "Project project1 raised exception class 'External: SIGSEGV'".
 - if you run without degugger, you get "Error reading LCLVLCPlayer1.AudioMuted: Access violation."
Additional InformationTested on Linux Mint 18.1 Mate (Gtk2 ws, VLC version 2.2.2) and Windows 8.1 (win32/win64 ws, VLC version 2.2.4). Same behaviour.

Perhaps related to bug 30838, but it is about TVLCMediaListPlayer, which I haven't tried, because I just get Access Violation with main VLC component.
TagsNo tags attached.
Fixed in Revision38308
FPCOldBugId
FPCTarget
Attached Files
  • vlc.pp.patch (498 bytes)
    Index: packages/libvlc/src/vlc.pp
    ===================================================================
    --- packages/libvlc/src/vlc.pp	(revision 37764)
    +++ packages/libvlc/src/vlc.pp	(working copy)
    @@ -679,7 +679,8 @@
     
     procedure TCustomVLCMediaPlayer.SetAudioMuted(AValue: Boolean);
     begin
    -  libvlc_audio_set_mute(instance, ord(AValue));
    +  if Assigned(FInstance) then
    +    libvlc_audio_set_mute(instance, ord(AValue));
     end;
     
     procedure TCustomVLCMediaPlayer.SetFitWindow(AValue: Boolean);
    
    vlc.pp.patch (498 bytes)

Relationships

related to 0030838 resolvedMichael Van Canneyt FPC vlc components crashes IDE during design time 
related to 0032030 resolvedMichl Lazarus Click on ActiveX Control (VLC, and others) on a form leads to Access Violation 

Activities

Zoran Vučenović

2017-03-15 10:00

reporter   ~0098915

The test application found in components/vlc/test works, but it creates the control in code, not in design time.

It seems that the bug is hidden if you create TLCLVLCPlayer in code. It however appears there also if you try to set AudioMuted property.

This property is published in the component, so when it is put in design time, the program tries to set it and crashes.

Mattias Gaertner

2017-12-19 19:15

manager   ~0104855

Looks like a bug in the fpc component, not in Lazarus.

Michl

2017-12-19 20:40

reporter   ~0104857

Last edited: 2017-12-19 21:18

View 3 revisions

Here it is running fine 64bit Windows 7, Lazarus 1.8.0 r56594 FPC 3.0.4 x86_64-win64-win32/win64, also 64bit Linux Mint KDE 17.3 Lazarus 1.9.0 r56234 FPC 3.0.2 x86_64-linux-gtk2 (tested with example app shipped with Lazarus).

Mattias Gaertner

2017-12-19 20:46

manager   ~0104858

It crashes under Linux, when dropping a TLCLVLCPlayer (so all values default, e.g. AudioMouted=-1) and running it:

[FORMS.PP] ExceptionOccurred
  Sender=EReadError
  Exception=Error reading LCLVLCPlayer1.AudioMuted: Access violation
  Stack trace:
  $00000000004C45C6
  $00000000004C37F9
  $00000000004C38BC
  $00000000004C52B5
  $00000000006D0A65 line 3183 of lresources.pp
  $00000000006C5DD0 line 804 of lresources.pp
  $000000000045212C line 2053 of include/customform.inc
  $0000000000451F81 line 2041 of include/customform.inc
  $0000000000455F81 line 3150 of include/customform.inc
  $0000000000462F18 line 2215 of include/application.inc

wp

2017-12-19 20:55

reporter   ~0104859

> Here it is running fine 64bit Windows 7, Lazarus 1.8.0 r56594 FPC 3.0.4 x86_64-win64-win32/win64 (tested with example app shipped with Lazarus).

But when I follow the authors instructions I see the crash at runtime with Laz 1.8 and Laz trunk (both fpc 2.0.4, all 32 bit on Win10 64 bit).

Mattias Gaertner

2017-12-19 21:15

manager   ~0104860

I can repoduce the problem under linux/x86_64 with this code:

  LCLVLCPlayer1:=TLCLVLCPlayer.Create(Self);
  LCLVLCPlayer1.AudioMuted := False; // crash

Stacktrace:
#0 0x0000000000000000 in ?? ()
0000001 0x000000000088c3be in VLC$_$TVLCLIBRARY_$__$$_GETINSTANCE$$PLIBVLC_INSTANCE_T ()
0000002 0x000000000088a079 in VLC$_$TCUSTOMVLCMEDIAPLAYER_$__$$_GETINSTANCE$$PLIBVLC_MEDIA_PLAYER_T ()
0000003 0x0000000000ca4000 in INIT_$TIMEPOPUP_$$_TTIMEPOPUPFORM ()
0000004 0x00000000008899d3 in VLC$_$TCUSTOMVLCMEDIAPLAYER_$__$$_SETAUDIOMUTED$BOOLEAN ()

Michl

2017-12-19 21:55

reporter   ~0104861

Last edited: 2017-12-19 21:57

View 2 revisions

> I can repoduce the problem under linux/x86_64 with this code:
>
> LCLVLCPlayer1:=TLCLVLCPlayer.Create(Self);
> LCLVLCPlayer1.AudioMuted := False; // crash

Maybe you have to initialize a instance. This work here:

procedure TForm1.FormCreate(Sender: TObject);
begin
  VLCLibrary.Initialize; // <-- !!
  FPlayer:=TLCLVLCPlayer.Create(Self);
  FPlayer.AudioMuted := False;

Mattias Gaertner

2017-12-19 22:22

manager   ~0104862

The test project does not do that.
Can the component create an exception with Message 'Missing instance. Maybe you forgot VLCLibrary.Initialize?' instead of AV?

wp

2017-12-19 22:26

reporter   ~0104863

Last edited: 2017-12-19 22:29

View 2 revisions

DLL hell again, seems to be similar to my old report 0030762. Somehow LoadLibVLC is not called.

Michl

2017-12-19 22:35

reporter  

vlc.pp.patch (498 bytes)
Index: packages/libvlc/src/vlc.pp
===================================================================
--- packages/libvlc/src/vlc.pp	(revision 37764)
+++ packages/libvlc/src/vlc.pp	(working copy)
@@ -679,7 +679,8 @@
 
 procedure TCustomVLCMediaPlayer.SetAudioMuted(AValue: Boolean);
 begin
-  libvlc_audio_set_mute(instance, ord(AValue));
+  if Assigned(FInstance) then
+    libvlc_audio_set_mute(instance, ord(AValue));
 end;
 
 procedure TCustomVLCMediaPlayer.SetFitWindow(AValue: Boolean);
vlc.pp.patch (498 bytes)

Michl

2017-12-19 22:40

reporter   ~0104864

Last edited: 2017-12-19 22:44

View 2 revisions

This issue has to be moved to FPC. Patch added.


> The test project does not do that.

Yes, I read that to late - sorry! After WPs hint, I can see the issue and could fix it (not such a big one, I do the same, as is done for the other properties). Tested with 64bit Windows 7 Lazarus 1.9.0 r56789 FPC 3.1.1 i386-win32-win32/win64, 64bit Linux Mint KDE 17.3 GTK2 Lazarus 1.9.0 r56234 FPC 3.0.2 x86_64-linux-gtk2.

wp

2017-12-19 23:18

reporter   ~0104866

Yes, the OP's steps to reproduce don't lead to a crash any more (Win 10).

But now that there's a VLCPlayer on the form I cannot set the AudioMuted in Object Inspector. Same with FullScreenMode, AudioDelay, AudioVolume, Channel, Chapter.

Michl

2017-12-19 23:31

reporter   ~0104867

Yes this can only be done at runtime or the library has to be loaded into the IDE.

IMHO the designtime not reachable properties has to be moved to public section.

At least, this limit isn't a big showstopper but it need to be documented, if not already be done.

wp

2017-12-20 00:01

reporter   ~0104868

> IMHO the designtime not reachable properties has to be moved to public section.

I'd agree, but maybe the author initially planned to load the DLL when the component is clicked onto the form and did not implement this feature?

Issue History

Date Modified Username Field Change
2017-03-15 09:40 Zoran Vučenović New Issue
2017-03-15 09:44 Zoran Vučenović Relationship added related to 0030838
2017-03-15 10:00 Zoran Vučenović Note Added: 0098915
2017-06-17 22:19 Juha Manninen Relationship added related to 0032030
2017-12-19 19:15 Mattias Gaertner Note Added: 0104855
2017-12-19 20:40 Michl Note Added: 0104857
2017-12-19 20:40 Michl Note Edited: 0104857 View Revisions
2017-12-19 20:46 Mattias Gaertner Note Added: 0104858
2017-12-19 20:55 wp Note Added: 0104859
2017-12-19 21:15 Mattias Gaertner Note Added: 0104860
2017-12-19 21:18 Michl Note Edited: 0104857 View Revisions
2017-12-19 21:55 Michl Note Added: 0104861
2017-12-19 21:57 Michl Note Edited: 0104861 View Revisions
2017-12-19 22:16 Michl Assigned To => Michl
2017-12-19 22:16 Michl Status new => assigned
2017-12-19 22:22 Mattias Gaertner Note Added: 0104862
2017-12-19 22:26 wp Note Added: 0104863
2017-12-19 22:29 wp Note Edited: 0104863 View Revisions
2017-12-19 22:30 Michl Assigned To Michl =>
2017-12-19 22:35 Michl File Added: vlc.pp.patch
2017-12-19 22:36 Michl Assigned To => Michl
2017-12-19 22:36 Michl Status assigned => new
2017-12-19 22:36 Michl Assigned To Michl =>
2017-12-19 22:40 Michl Note Added: 0104864
2017-12-19 22:44 Michl Note Edited: 0104864 View Revisions
2017-12-19 23:18 wp Note Added: 0104866
2017-12-19 23:31 Michl Note Added: 0104867
2017-12-19 23:46 Maxim Ganetsky Project Lazarus => FPC
2017-12-20 00:01 wp Note Added: 0104868
2018-02-21 21:26 Florian Fixed in Revision => 38308
2018-02-21 21:26 Florian Status new => resolved
2018-02-21 21:26 Florian Fixed in Version => 3.1.1
2018-02-21 21:26 Florian Resolution open => fixed
2018-02-21 21:26 Florian Assigned To => Florian