Recent

Author Topic: Exception hang debugger on OSX.  (Read 5934 times)

mamcx

  • New Member
  • *
  • Posts: 12
Exception hang debugger on OSX.
« on: March 25, 2010, 05:39:24 pm »
I have the last lazarus trunk, gdb 6.3.50-20050815 (Apple version gdb-1461), fpc 2.4.0

When I execute my app and it have a exception, lazarus hang forever. I need to kill it. But launch it with no debugger the exception show normally.

I'm using RemObjects & trying to make work my app server(http://www.elmalabarista.com/es/blog/2010/03/15/servidor-de-sincronizacion-bestseller-en-osxbestseller-sync-server-osx/). My experience triying to port this app (minimal UI, mostly server-side code) has be more-or-less a pain. Is very hard to use lazarus and crash or hang almost in each step.

The wird thing, if running directly with gdb work as expected.

This is the backtrace:

#0  0x00020ccf in fpc_raiseexception ()
#1  0x0026b7d0 in RAISEERROR (AMESSAGE=0x7b01b4 "Stream read error: Invalid string length \"%d\"", PARAMETERS=@0xb1b80590, highPARAMETERS=0) at ../../../../../Developer/RemObjects Software/RemObjects SDK for Delphi/Source/uROClasses.pas:857
#2  0x002c68bc in READANSISTRING (this=0x190f9060, ANAME=0x66be60 "Pwd", REF=@0xb1b806d4, ARRAYELEMENTID=-1, IMAXLENGTH=-1) at ../../../../../Developer/RemObjects Software/RemObjects SDK for Delphi/Source/uROStreamSerializer.pas:1263
#3  0x002b097b in READ (this=0x190f9060, ANAME=0x66be60 "Pwd", ATYPEINFO=0x65d1f4, PTR=@0xb1b806d4, ARRAYELEMENTID=-1) at ../../../../../Developer/RemObjects Software/RemObjects SDK for Delphi/Source/uROSerializer.pas:412
#4  0x0027438c in READ (this=0x19181020, ANAME=0x66be60 "Pwd", ATYPEINFO=0x65d1f4, PTR=@0xb1b806d4, ATTRIBUTES=0) at ../../../../../Developer/RemObjects Software/RemObjects SDK for Delphi/Source/uROClient.pas:1120
#5  0x00051dd1 in INVOKE_LOGINSIMPLE (this=0x0, __INSTANCE=0x191890d0, __MESSAGE=0x1918110c, __TRANSPORT=0x191091f8, __ORESPONSEOPTIONS=@0xb1b80b38) at BestSellerSyncApi_Invk.pas:296
#6  0x002b4270 in CUSTOMHANDLEMESSAGE (this=0x1975d300, AFACTORY=0x2a9a940, AMESSAGE=0x1918110c, ATRANSPORT=0x191091f8, ORESPONSEOPTIONS=@0xb1b80b38) at ../../../../../Developer/RemObjects Software/RemObjects SDK for Delphi/Source/uROServer.pas:731
#7  0x002b4556 in HANDLEMESSAGE (this=0x1975d300, AFACTORY=0x2a9a940, AMESSAGE=0x1918110c, ATRANSPORT=0x191091f8, ORESPONSEOPTIONS=@0xb1b80b38) at ../../../../../Developer/RemObjects Software/RemObjects SDK for Delphi/Source/uROServer.pas:758
#8  0x002b311f in MAINPROCESSMESSAGE (AMESSAGE=0x1918110c, ATRANSPORT=0x191091f8, AREQUESTSTREAM=0x191091c0, ARESPONSESTREAM=0x19109220, ORESPONSEOPTIONS=@0xb1b80b38) at ../../../../../Developer/RemObjects Software/RemObjects SDK for Delphi/Source/uROServer.pas:512
#9  0x002b51e3 in PROCESSMESSAGE (this=0x2a9abc0, ATRANSPORT=0x191091f8, AREQUESTSTREAM=0x191091c0, ARESPONSESTREAM=0x19109220, ORESPONSEOPTIONS=@0xb1b80b38) at ../../../../../Developer/RemObjects Software/RemObjects SDK for Delphi/Source/uROServer.pas:929
#10 0x002b61eb in INTDISPATCHMESSAGE (this=0x5194100, DISPATCHER=0x2a9abc0, ATRANSPORT=0x191091f8, AREQUESTSTREAM=0x191091c0, ARESPONSESTREAM=0x19109220, ORESPONSEOPTIONS=@0xb1b80b38) at ../../../../../Developer/RemObjects Software/RemObjects SDK for Delphi/Source/uROServer.pas:1328
#11 0x003cd3e9 in INTERNALSERVERCOMMANDGET (this=0x5194100, ATHREAD=0x18db9460, REQUESTINFO=0x19111020, RESPONSEINFO=0x19129020) at ../../../../../Developer/RemObjects Software/RemObjects SDK for Delphi/Source/uROIndyHTTPServer.pas:261
#12 0x0042fc31 in TIDCUSTOMHTTPSERVER__DOCOMMANDGET (ACONTEXT=0x18db9460, AREQUESTINFO=0x19111020, ARESPONSEINFO=0x19129020, this=0x51a4020) at IdCustomHTTPServer.pas:600
#13 0x0043118b in TIDCUSTOMHTTPSERVER__DOEXECUTE (ACONTEXT=0x18db9460, this=0x51a4020) at IdCustomHTTPServer.pas:912
#14 0x003ff683 in TIDCONTEXT__RUN (this=0x18db9460) at /Users/mamcx/Programacion/Indy/Core/IdContext.pas:167
#15 0x00402514 in TIDTASK__DORUN (this=0x18db9460) at /Users/mamcx/Programacion/Indy/Core/IdTask.pas:111
#16 0x00402319 in TIDTHREADWITHTASK__RUN (this=0x18db1090) at /Users/mamcx/Programacion/Indy/Core/IdThread.pas:587
#17 0x00401868 in TIDTHREAD__EXECUTE (this=0x18db1090) at /Users/mamcx/Programacion/Indy/Core/IdThread.pas:350
#18 0x0006af36 in CLASSES_THREADFUNC$POINTER$$LONGINT ()
#19 0x00031bf2 in CTHREADS_THREADMAIN$POINTER$$POINTER ()
#20 0x97e98fbd in _pthread_start ()
#21 0x97e98e42 in thread_start ()

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2496
Re: Exception hang debugger on OSX.
« Reply #1 on: March 25, 2010, 05:53:03 pm »
what is the output of the lazarus debugger output window: view->debug windows->debug output
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

VTwin

  • Hero Member
  • *****
  • Posts: 771
  • Former Turbo Pascal 3 user
Re: Exception hang debugger on OSX.
« Reply #2 on: May 17, 2010, 10:39:49 pm »
I seem to have a similar issue. Running OS X 10.6.3 with Lazarus 0.9.29, FPC 2.4.0, i386-darwin-qt (beta).

In trying to validate an entry I used:

x := StrToFloat(NewValue);

to check for an exception. The exception works as expected when built, but hangs when run from Lazarus. To kill it I have to reset the debugger. I then get a a 'quit unexpectedly' message from OS X and an 'Access violation' from Lazarus.

Debug output:
<-data-evaluate-expression ^^shortstring(^pointer($rdi)^+24)^^>
^error,msg="Invalid cast."
(gdb)
<x/s ^Exception($rdi)^.FMessage>
&"x/s ^Exception($rdi)^.FMessage\n"
« Last Edit: May 17, 2010, 10:49:30 pm by Frederick »
“Talk is cheap. Show me the code.” -Linus Torvalds

macOS 10.11.6: Lazarus 2.0 fixes svn 61930 (64 bit Cocoa)
Ubuntu 18.04.3: Lazarus 2.0.4 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.0.4 (64 bit on VBox)
fpc 3.0.4

VTwin

  • Hero Member
  • *****
  • Posts: 771
  • Former Turbo Pascal 3 user
Re: Exception hang debugger on OSX.
« Reply #3 on: May 18, 2010, 12:23:32 am »
Same thing happens when I run:

if OpenPictureDialog1.execute then

Works as expected in built application (no exception), but hangs exactly the same as above in Lazarus: spinning beachball of doom, and same error messages as above.
« Last Edit: May 18, 2010, 12:25:46 am by Frederick »
“Talk is cheap. Show me the code.” -Linus Torvalds

macOS 10.11.6: Lazarus 2.0 fixes svn 61930 (64 bit Cocoa)
Ubuntu 18.04.3: Lazarus 2.0.4 (64 bit on VBox)
Windows 7 Pro SP1: Lazarus 2.0.4 (64 bit on VBox)
fpc 3.0.4