• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: open ("/dev/tty.xxxx"...) for my driver crashes the system
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: open ("/dev/tty.xxxx"...) for my driver crashes the system


  • Subject: Re: open ("/dev/tty.xxxx"...) for my driver crashes the system
  • From: Garth Cummings <email@hidden>
  • Date: Wed, 28 Jun 2006 09:50:19 -0700

Hi Pavan,

On Jun 28, 2006, at 12:10 AM, Pavan Chebbi wrote:

Hi Garth,

Thanks for the reply.

I decoded the panic log and studied the backtrace. I found that the crash was in IOSerialBSDClient and in the function getData(...) to be specific.

This is what the backtrace information showed which lead me to conclude the above.

(gdb) x/i 0x004BA6B4
0x4ba6b4 <_ZN17IOSerialBSDClient7getDataEPNS_7SessionE+364>:    
lbzx    r3,r2,r31

(gdb) x/i 0x004BA6D8
0x4ba6d8 <_ZN17IOSerialBSDClient7getDataEPNS_7SessionE+400>:    
lwz     r0,1088(r1)

(gdb) x/i 0x004BA9A4
0x4ba9a4 <_ZN17IOSerialBSDClient6rxFuncEv+228>: b       0x4ba9b4 
<_ZN17IOSerialBSDClient6rxFuncEv+244>

(gdb) x/i 0x000A9894
0xa9894 <Call_continuation+20>: mfsprg  r3,1

Remember that the backtrace is a list of return addresses, so you need to disassemble the instruction _before_ the address in the backtrace. (On Intel processors, some processor exceptions such as page faults cause the instruction to be restarted after the fault, so this rule doesn't apply in those cases.)

On PowerPC-based Macs, do x/i 0x004BA6B4-4, for example. On Intel-based systems, the instructions are all different lengths, so the safest thing to do is to disassemble the entire function, then find the instruction just prior to the address in the backtrace.


Can you suggest the reason why this is happening in IOSerialBSDClient ?
Is there anything that I am missing out in my driver code used by IOSerialBSDClient ? My driver subclasses the IOSerialStreamSync class.

Thanks a lot.

There's not enough info here to go on, sorry. 

When we get this kind of question in DTS, we usually ask the developer for everything we'd need to reproduce the problem locally. Sometimes an obvious cause can be found in the full panic log, but typically the developer is able to find the easy crashes and DTS gets involved in the harder ones.

--gc


Garth Cummings <email@hidden> wrote:
Hi Pavan,

On Jun 27, 2006, at 2:08 AM, Pavan Chebbi wrote:

I want to know what happens when I call open() on my virtual ports from a program? I want to know how do I register the open routine for my driver. I know the routines acquirePort, releasePort, etc but the machine crashes the moment I call open from an application. ( open("/dev/tty.xxxx", O_RDWR | O_NOCTTY | O_NONBLOCK ))

The panic log says unresolved kernel trap 0x300 data access.

The IOSerialBSDClient handles the transition from BSD syscalls to your I/O Kit driver.

I highly recommend you decode the panic backtrace to see precisely where the system panicked. All you know at this point is that a bad memory reference occurred, such as dereferencing a NULL or uninitialized pointer. This could be just a simple bug in your code.

Good luck,
--gc
__________________________________________________________________
Garth Cummings �email@hidden
Sr. Software Engineer
Apple Developer Technical Support

<http://developer.apple.com/technicalsupport>








How low will we go? Check out Yahoo! Messenger’s low PC-to-Phone call rates.

______________________________________________________________________
Garth Cummings 1 Infinite Loop, MS 303-2T

Sr. Software Engineer Cupertino, CA 95014

Apple Developer Technical Support      

                               

"The last good thing written in C was 408-974-7711 phone

Franz Schubert's Symphony No. 9." 408-974-8101 fax

—Erwin Dieterich                                   email@hidden



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: open ("/dev/tty.xxxx"...) for my driver crashes the system (From: Pavan Chebbi <email@hidden>)

  • Prev by Date: Re: kextunload problem
  • Next by Date: Kernel Panic : Mac OS X 10.4.7 Intel, KPI IP Filter & VPN
  • Previous by thread: Re: open ("/dev/tty.xxxx"...) for my driver crashes the system
  • Next by thread: Again sending my question
  • Index(es):
    • Date
    • Thread