[Lazarus] SVN - SIGSEGV in external C lib when Lazarus in Debug mode (Qt)

Krzysztof dibo20 at wp.pl
Tue Mar 22 21:58:11 CET 2016


Hi,

I have music player based on Bass library. It can play online radio and
signal (metadata) if song in radio has changed. Code is quite old and Bass
binary is not changed. Recently I updated SVN source (I need to use it
because it has important bug fixes), rebuild Lazarus and receive metadata
stopped worked but only in Debug mode, Release is working fine.

This is output in debug mode:

TApplication.HandleException Unknown Run-Time error : 202
  Stack trace:
  $0000000000437E5F
  $00007F38A2AF6634
QObject: Cannot create children for a parent that is in a different thread.
(Parent is Oxygen::WidgetStateEngine(0x2812a90), parent's thread is
QThread(0x272ddb0), current thread is QThread(0x7f3870000d20)
QObject: Cannot create children for a parent that is in a different thread.
(Parent is Oxygen::WidgetStateEngine(0x28161e0), parent's thread is
QThread(0x272ddb0), current thread is QThread(0x7f3870000d20)
QObject: Cannot create children for a parent that is in a different thread.
(Parent is Oxygen::WidgetStateEngine(0x28161e0), parent's thread is
QThread(0x272ddb0), current thread is QThread(0x7f3870000d20)
QObject: Cannot create children for a parent that is in a different thread.
(Parent is Oxygen::WidgetStateEngine(0x2812a90), parent's thread is
QThread(0x272ddb0), current thread is QThread(0x7f3870000d20)
QObject: Cannot create children for a parent that is in a different thread.
(Parent is Oxygen::WidgetStateEngine(0x28161e0), parent's thread is
QThread(0x272ddb0), current thread is QThread(0x7f3870000d20)
QObject: Cannot create children for a parent that is in a different thread.
(Parent is Oxygen::WidgetStateEngine(0x28161e0), parent's thread is
QThread(0x272ddb0), current thread is QThread(0x7f3870000d20)
QPixmap: It is not safe to use pixmaps outside the GUI thread
QPixmap: It is not safe to use pixmaps outside the GUI thread
QPixmap: It is not safe to use pixmaps outside the GUI thread
QPixmap: It is not safe to use pixmaps outside the GUI thread
QPixmap: It is not safe to use pixmaps outside the GUI thread
QPainter::begin: Paint device returned engine == 0, type: 2
QPixmap: It is not safe to use pixmaps outside the GUI thread

Once I saw error refere to TLoggerLazBase(or something like that). And this
is the code:

procedure SyncMetaProc(handle: HSYNC; channel, data: DWORD; user: Pointer);
{$IFDEF MSWINDOWS}stdcall{$ELSE}cdecl{$ENDIF};
begin
  // Synchronize with main thread
  Application.QueueAsyncCall(@MusicPlayer.AsyncMetaChanged, 0);
end;

procedure TPlayer.AsyncMetaChanged(Data: PtrInt);
var
  m: PAnsiChar;
  sDef: String;
begin
  m := BASS_ChannelGetTags(FMusic, BASS_TAG_META);
  if (m<>nil) and Assigned(FOnMeta) then
    FOnMeta(Self, )
  if (MusicPlayer.FPlaylist<>nil) and
(MusicPlayer.FPlaylist.Indicator<>nil) then
    sDef := MusicPlayer.FPlaylist.Indicator^.Title
  else
    sDef := 'Unknown';
  FTitle := MusicPlayer.ExtractStreamTitle(BASS_ChannelGetTags(FMusic,
BASS_TAG_META), sdef);

  DoStatus;
end;

begin
    if FSyncMeta=0 then
      FSyncMeta := BASS_ChannelSetSync(FMusic, BASS_SYNC_META, 0,
@SyncMetaProc, nil);
end;

Note that even if I comment Application.QueueAsyncCall.... then I get same
error and output. Should I report this with Qt widgetset category?

Tested on Kubuntu 14.04 64bit, FPC 2.6.4
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20160322/fc877417/attachment-0002.html>


More information about the Lazarus mailing list