realbasic-nug
[Top] [All Lists]

Re: Troubles with debugging

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: Troubles with debugging
From: Tim Jones <tjmac@tolisgroup.com>
Date: Mon, 29 Dec 2008 08:49:26 -0700
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <9E902F19-8551-4D14-9B71-8E7D9BC35C5F@mac.com>
References: <9E902F19-8551-4D14-9B71-8E7D9BC35C5F@mac.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
What happens if you simply execute the external app directly and backgrounding it instead of using "open"?

i.e.:

        sh.Execute "nohup " + a.ShellPath + " &"

Tim

On Dec 29, 2008, at 8:23 AM, Arnaud Nicolet wrote:

Hi,

I am trying to debug an app (ServiceApplication) which is crashing. I have found where is the problem, but it's rather confusing: in a blank service application, the same code does not produce any crash and all works fine.

Here's what I have in the app for testing:

  dim a As FolderItem

a=app.ExecutableFile.Parent.Child("Gam2") 'A random application to be launched, for my tests

  dim sh As Shell
  System.DebugLog "Debug2a"
  sh=new Shell
  sh.Execute "open "+a.ShellPath

This code should launch an application (the launch method of a folderitem is not recognized for a service application, for whatever odd reason). I have tried alternate methods, such as the LaunchWithParametersMBS function. Either way, the real app is crashing, while the code in a new project works just fine. I'm sure the crash happens there, using system.debuglog. Now, debugging the real app is a pain. It's a startup item launched with launchd. If I want to make modifications to my code and test them, I have to restart the computer.

Here's the crash report, which does not seem useful to me:

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000
Crashed Thread:  0

Thread 0 Crashed:
0   ???                                 0000000000 0 + 0
1 msgs40 Agent 0x0004c720 CTCPDirectMessage.ShowMessage%%o<CTCPDirectMessage>i4 + 7821 2 msgs40 Agent 0x00058c6c CTCPDirectMessage.ShowCurrentMessage%%o<CTCPDirectMessage> + 183 3 msgs40 Agent 0x000485a2 CTCPDirectMessage.Event_DataAvailable%%o<CTCPDirectMessage> + 9072 4 rbframework.dylib 0x001ee2e0 socketFireDataReceivedEvent(SocketCoreControl*) + 56 5 rbframework.dylib 0x00201614 TCPSocket::FireEvents () + 198 6 rbframework.dylib 0x001d807a TCPSocketPosix::Poll () + 1284 7 rbframework.dylib 0x001ed38b DoNetIdle(unsigned char) + 163
8   rbframework.dylib                   0x00281fb2 NetIdle + 46
9 rbframework.dylib 0x002698cf SetApplicationState (int) + 165
10  rbframework.dylib                   0x00269767 IsAppShuttingDown() + 59
11 rbframework.dylib 0x00269818 CallFunctionWithExceptionHandling(void (*)()) + 20 12 rbframework.dylib 0x00269987 ModalEvents(unsigned char) + 71
13  rbframework.dylib                   0x0028ef68 RuntimeDoEvents + 28
14 msgs40 Agent 0x000121ad ConsoleApplication.DoEvents%%o<ConsoleApplication>i4 + 44 15 msgs40 Agent 0x00040b2c App.Event_Run%i4% o<App>A1s + 1991 16 rbframework.dylib 0x001cb2e0 CallConsoleApplicationRunEvent() + 406
17  rbframework.dylib                   0x00269767 IsAppShuttingDown() + 59
18 rbframework.dylib 0x00269818 CallFunctionWithExceptionHandling(void (*)()) + 20
19  rbframework.dylib                   0x0021dbe0 RuntimeRun + 60
20 msgs40 Agent 0x00002e49 REALbasic._RuntimeRun + 34
21  msgs40 Agent                        0x00001804 _Main + 73
22  msgs40 Agent                        0x000014cc % main + 36
23  msgs40 Agent                        0x0005a384 _start + 116
24  msgs40 Agent                        0x0005a2da start + 43

Thread 0 crashed with X86 Thread State (32-bit):
  eax: 0x004a0184  ebx: 0x00000000  ecx: 0x00418e70  edx: 0x00000000
  edi: 0x0080d65c  esi: 0x00205d3c  ebp: 0xbfffeec8  esp: 0xbfffee6c
   ss: 0x0000001f  efl: 0x00010206  eip: 0x00000000   cs: 0x00000017
   ds: 0x0000001f   es: 0x0000001f   fs: 0x00000000   gs: 0x00000037
  cr2: 0x00000000

Now, I'm puzzled... I don't know what I should do to avoid that crash.
Any idea?

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>