This discussion is archived
0 Replies Latest reply: Mar 13, 2013 8:04 AM by 995299 RSS

Solaris 11.1 closes device driver when the open failed with a EBUSY error.

995299 Newbie
Currently Being Moderated
This is x-posted from Driver Development. That forum does not seem to get much traffic.

I have written a driver that will accept only 1 open. A application can successfully call an open to access the driver. If a 2nd application tries another open, the driver will return EBUSY. This 2nd application receives the EBUSY error correctly.
However on Solaris 11 the OS seems to call a close() on our driver in response to the failed open attempt. This close causes the first application's file descripter to become invalid.
Solaris 10 does not call close on a failed open attempt.

Why is Solaris 11 making this close() call on the driver when:
a) the open call was not successful.
b) the first application should still have the open count at 1. The OS should only call close when the last reference is closed.

Is there anything required by a driver to prevent this from happening.

I have also written the application that will access the driver and when the application is closed, the system panics.

Mar 8 10:50:03 t2000 unix: [ID 340138 kern.notice] BAD TRAP: type=31 rp=2a107bfb6a0 addr=8 mmu_fsr=0 occurred in module "genunix" d
ue to a NULL pointer dereference
Mar 8 10:50:03 t2000 unix: [ID 100000 kern.notice]
Mar 8 10:50:03 t2000 unix: [ID 839527 kern.notice] tpd:
Mar 8 10:50:03 t2000 unix: [ID 520581 kern.notice] trap type = 0x31
Mar 8 10:50:03 t2000 unix: [ID 381800 kern.notice] addr=0x8
Mar 8 10:50:03 t2000 unix: [ID 101969 kern.notice] pid=1845, pc=0x11a887c, sp=0x2a107bfaf41, tstate=0x4480001605, context=0x3df
Mar 8 10:50:03 t2000 unix: [ID 743441 kern.notice] g1-g7: 10820000, ffffffffffffffff, 0, 0, 0, 1c, 40198934380
Mar 8 10:50:03 t2000 unix: [ID 100000 kern.notice]
Mar 8 10:50:03 t2000 genunix: [ID 723222 kern.notice] 000002a107bfb3f0 unix:die+7c (31, 2a107bfb6a0, 8, 0, 0, 10bf800)
Mar 8 10:50:03 t2000 genunix: [ID 702911 kern.notice] %l0-3: 0000000000000031 0000000001000000 0000000000002000 00000000010bf860
Mar 8 10:50:03 t2000 %l4-7: 00000000010bf800 0000000000000005 0000000000000000 000002a107bfb4b0
Mar 8 10:50:03 t2000 genunix: [ID 723222 kern.notice] 000002a107bfb4d0 unix:trap+a3c (2a107bfb6a0, f45e2008, 1fff, 0, 1c00, 0)
Mar 8 10:50:03 t2000 genunix: [ID 702911 kern.notice] %l0-3: 0000000000000000 0000000000000031 00000000c1680000 0000000000000001
Mar 8 10:50:03 t2000 %l4-7: 0000040198934380 0000000000000005 0000000000000000 0000000000000001
Mar 8 10:50:03 t2000 genunix: [ID 723222 kern.notice] 000002a107bfb5f0 unix:ktl0+64 (10820398, 0, 4019a0fc790, 10820000, 0, 40192e14cc0)
Mar 8 10:50:03 t2000 genunix: [ID 702911 kern.notice] %l0-3: 000003000000a000 0000000000000030 0000004480001605 000000000101e360
Mar 8 10:50:03 t2000 %l4-7: 0000040198934380 0000000000000005 0000000000000000 0000000000000001
Mar 8 10:50:03 t2000 genunix: [ID 723222 kern.notice] 000002a107bfb5f0 unix:ktl0+64 (10820398, 0, 4019a0fc790, 10820000, 0, 40192e14cc0)
Mar 8 10:50:03 t2000 genunix: [ID 702911 kern.notice] %l0-3: 000003000000a000 0000000000000030 0000004480001605 000000000101e360
Mar 8 10:50:03 t2000 %l4-7: 0000040198934380 000004019c6ea840 0000000000000000 000002a107bfb6a0
Mar 8 10:50:03 t2000 genunix: [ID 723222 kern.notice] 000002a107bfb740 genunix:pgsignal+c (0, 1, 18, 2a107bfb968, 10820398, 10820000)
Mar 8 10:50:03 t2000 genunix: [ID 702911 kern.notice] %l0-3: 0000000000000001 0000000000000000 0000000000000001 0000000000000001
Mar 8 10:50:03 t2000 %l4-7: 0000040198934380 000004019c6ea840 0000000000000000 000004019a6f2048
Mar 8 10:50:03 t2000 genunix: [ID 723222 kern.notice] 000002a107bfb7f0 genunix:freectty_signal+70 (4019a6f2048, 40192e14cc0, 4019a0fc790, 10820000, 0, 40192e14cc0)
Mar 8 10:50:03 t2000 genunix: [ID 702911 kern.notice] %l0-3: 0000000000000001 0000000000000000 0000000000000001 0000000000000001
Mar 8 10:50:03 t2000 %l4-7: 0000040198934380 000004019c6ea840 0000000000000000 000004019a6f2048
Mar 8 10:50:03 t2000 genunix: [ID 723222 kern.notice] 000002a107bfb8a0 genunix:freectty+4c (1, 4019a6f2048, 18, 2a107bfb968, 10820398, 4019a6f2650)
Mar 8 10:50:03 t2000 genunix: [ID 702911 kern.notice] %l0-3: 0000000000000001 0000000000000000 000004019dbc1548 000004019a776240
Mar 8 10:50:03 t2000 %l4-7: 0000040198934380 000004019c6ea840 0000000000000000 000004019a6f2048
Mar 8 10:50:03 t2000 genunix: [ID 723222 kern.notice] 000002a107bfb970 genunix:proc_exit+460 (0, 12e4000, 4019e7da040, 12e413c, 0, 1)
Mar 8 10:50:03 t2000 genunix: [ID 702911 kern.notice] %l0-3: 0000000000000000 0000000000000000 000004019dbc1548 000004019a776240
Mar 8 10:50:03 t2000 %l4-7: 0000040198934380 000004019c6ea840 0000000000000000 000004019a6f2048
Mar 8 10:50:03 t2000 genunix: [ID 723222 kern.notice] 000002a107bfba20 genunix:exit+8 (1, 0, ffbff410, efe63080, ff1d2a40, 24c00)
Mar 8 10:50:03 t2000 genunix: [ID 702911 kern.notice] %l0-3: 000000000100944c 000002a107bfbb80 000004019dbc1548 0000000001056208
Mar 8 10:50:03 t2000 %l4-7: 00000000107ca710 0000000000000000 0000040198934380 000002a107bfbb80
Mar 8 10:50:03 t2000 unix: [ID 100000 kern.notice]
Mar 8 10:50:03 t2000 genunix: [ID 672855 kern.notice] syncing file systems...

Regard,
Terry

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points