Part Number: DRA72XEVM
Hi,
We've recently encountered a problem in which we have to add a delay before starting the user space application in order to properly create a message queue. Below you'll find LAD logs for when the process fails and for when the process succeeds.
Log in which app starts OK:
[0.027673]
Initializing LAD... [0.028638] NameServer_setup: entered, refCount=0
[0.028796] NameServer_setup: creating listener thread
[0.029271] NameServer_setup: exiting, refCount=1
[0.029682] NameServer_create(): 'GateMP'
[0.029845]
opening FIFO: /tmp/LAD/LADCMDS
[0.030129] listener_cb: Entered Listener thread.
[0.030217] NameServer: waiting for unblockFd: 0, and socks: maxfd: 0
[2.484640] Retrieving command...
[2.484702]
LAD_CONNECT:
[2.484713] client FIFO name = /tmp/LAD/278
[2.484721] client PID = 278
[2.484729] assigned client handle = 0
[2.484760] FIFO /tmp/LAD/278 created
[2.484867] FIFO /tmp/LAD/278 opened for writing
[2.484906] sent response
[2.484914] DONE
[2.484921] Retrieving command...
[2.484999] Sending response...
[2.485015] Retrieving command...
[2.485053] LAD_MULTIPROC_GETCONFIG: calling MultiProc_getConfig()...
[2.485067] MultiProc_getConfig() - 5 procs
[2.485075] # processors in cluster: 5
[2.485082] cluster baseId: 0
[2.485089] ProcId 0 - "HOST"
[2.485096] ProcId 1 - "IPU2"
[2.485104] ProcId 2 - "IPU1"
[2.485111] ProcId 3 - "DSP2"
[2.485118] ProcId 4 - "DSP1"
[2.485125] status = 0
[2.485132] DONE
[2.485139] Sending response...
[2.485151] Retrieving command...
[2.485202] LAD_NAMESERVER_SETUP: calling NameServer_setup()...
[2.485211] NameServer_setup: entered, refCount=1
[2.485219] NameServer_setup: already setup
[2.485225] NameServer_setup: exiting, refCount=2
[2.485233] status = 1
[2.485240] DONE
[2.485246] Sending response...
[2.485258] Retrieving command...
[2.485295] LAD_MESSAGEQ_GETCONFIG: calling MessageQ_getConfig()...
[2.485305] status = 0
[2.485312] DONE
[2.485319] Sending response...
[2.485331] Retrieving command...
[2.485367] LAD_MESSAGEQ_SETUP: calling MessageQ_setup()...
[2.485377] MessageQ_setup: entered, refCount=0
[2.485385] NameServer_create(): 'MessageQ'
[2.485398] MessageQ_setup: exiting, refCount=1
[2.485406] status = 0
[2.485413] DONE
[2.485419] Sending response...
[2.485431] Retrieving command...
[2.485634] NameServer_attach: --> procId=1, refCount=0
[2.485662] NameServer_attach: created send socket: 6, procId 1
[2.485692] NameServer_attach: connect failed: procId=1, errno=22 (Invalid argument)
[2.485715] closing send socket: 6
[2.485739] NameServer_attach: <-- refcount="0," status="-1" 2="" 485748="" sending="" response="" 485792="" retrieving="" command="" 485809="" nameserver_attach:="" --=""> procId=2, refCount=0
[2.485824] NameServer_attach: created send socket: 6, procId 2
[2.485835] NameServer_attach: connect failed: procId=2, errno=22 (Invalid argument)
[2.485846] closing send socket: 6
[2.485862] NameServer_attach: <-- refcount="0," status="-1" 2="" 485871="" sending="" response="" 485909="" retrieving="" command="" 485924="" nameserver_attach:="" --=""> procId=3, refCount=0
[2.485938] NameServer_attach: created send socket: 6, procId 3
[2.485949] NameServer_attach: connect failed: procId=3, errno=22 (Invalid argument)
[2.485960] closing send socket: 6
[2.485976] NameServer_attach: <-- refcount="0," status="-1" 2="" 485985="" sending="" response="" 486023="" retrieving="" command="" 486038="" nameserver_attach:="" --=""> procId=4, refCount=0
[2.486051] NameServer_attach: created send socket: 6, procId 4
[2.486077] NameServer_attach: created receive socket: 7, procId 4
[2.487310] NameServer: back from select()
[2.487339] NameServer: listener thread, event: REFRESH
[2.487350] NameServer: waiting for unblockFd: 0, and socks: maxfd: 7
[2.487370] NameServer_attach: <-- refcount="1," status="0" 2="" 487381="" sending="" response="" 487503="" retrieving="" command="" 487522="" lad_gatemp_issetup:="" calling="" gatemp_issetup="" 487530="" 487537="" done="" 487544="" 487578="" 487593="" lad_gatemp_attach:="" gatemp_attach="" 4="" 487615="" nameserver_getremote:="" request="" via="" sock:="" 6="" 487625="" requesting="" from="" procid="" gatemp:="" _gatemp_ti_dgate="" 487656="" pending="" on="" waitfd:="" 1="" 487759="" nameserver:="" back="" select="" 487773="" listener="" got="" nameserver="" message="" 7="" 487805="" listener_cb:="" recvfrom="" socket:="" fd:="" 487815="" received="" ns="" msg:="" nbytes:="" 484="" addr:="" 61="" vproc:="" 487823="" reply:="" instancename:="" gatemp="" name:="" value:="" 0x770bf="" 487837="" waiting="" for="" unblockfd:="" 0="" and="" socks:="" maxfd:="" 487857="" value="0x40080" gatemp:_gatemp_ti_dgate="" not="" found="" 487869="" gatemp_attach:="" failed="" to="" open="" default="" gate="" 487887="" 487893="" 487900="" 487934="" 487949="" 487956="" 487963="" 487969="" 488003="" 488018="" lad_gatehwspinlock_getconfig:="" gatehwspinlock_getconfig="" 488026="" baseaddr="0x4a0f6000" 488033="" size="0x1000" offset="0x800" 488040="" 488047="" 488053="" 488188="" 488207="" lad_gatemp_start:="" gatemp_start="" 488215="" 488222="" 488228="" 488258="" 488272="" lad_gatemp_getnumresources:="" gatemp_getnumresources="" 488280="" 488287="" 488294="" 488336="" 488352="" lad_nameserver_get:="" nameserver_get="" 0x30228="" 488361="" 488373="" nameserver_getlocal:="" entry="" key:="" 488381="" no="" socket="" connection="" processor="" 488389="" 488396="" 3="" 488403="" 488410="" 488433="" 488514="" 488526="" 488538="" 488546="" 488554="" 0x773d3="" 488566="" 488585="" 488596="" 488603="" 488610="" 488616="" 488666="" 488681="" lad_messageq_create:="" messageq_create="" 0x2f89c="" 0x2f8bc="" 488690="" messageq_create:="" creating="" host:msgq:01="" 488700="" returning="" obj="0x30640," qid="0x80" 488708="" 488715="" 488721="" 489843="" 491290="" lad_messageq_announce:="" messageq_announce="" 0x30640="" 491309="" messageq_announce:="" announcing="" 491323="" nameserver_add:="" entered="" data:="" 0x80="" 491333="" 491340="" 491347="" 491415="" 491432="" lad_nameserver_getuint32:="" nameserver_getuint32="" 0x30558="" dsp1:msgq:01="" 491443="" 491453="" 491460="" 491467="" 491474="" 491481="" messageq:="" 491512="" 491598="" 491610="" 491624="" 491633="" 491641="" messageq="" 0x40080="" 491654="" 491674="" reply="" from:="" 491698="" 491706="" 491713="" 491719="" 491929="" pre="">
Log in which the app fails to start:
[0.955071]
Initializing LAD... [0.955315] NameServer_setup: entered, refCount=0
[0.955341] NameServer_setup: creating listener thread
[0.955456] NameServer_setup: exiting, refCount=1
[0.955538] NameServer_create(): 'GateMP'
[0.955565]
opening FIFO: /tmp/LAD/LADCMDS
[0.959035] listener_cb: Entered Listener thread.
[0.959129] NameServer: waiting for unblockFd: 0, and socks: maxfd: 0
[-25613773.706787] Retrieving command...
[-25613773.706853]
LAD_CONNECT:
[-25613773.706863] client FIFO name = /tmp/LAD/302
[-25613773.706872] client PID = 302
[-25613773.706880] assigned client handle = 0
[-25613773.706912] FIFO /tmp/LAD/302 created
[-25613773.707020] FIFO /tmp/LAD/302 opened for writing
[-25613773.707059] sent response
[-25613773.707068] DONE
[-25613773.707075] Retrieving command...
[-25613773.707151] Sending response...
[-25613773.707167] Retrieving command...
[-25613773.707206] LAD_MULTIPROC_GETCONFIG: calling MultiProc_getConfig()...
[-25613773.707220] MultiProc_getConfig() - 5 procs
[-25613773.707227] # processors in cluster: 5
[-25613773.707234] cluster baseId: 0
[-25613773.707241] ProcId 0 - "HOST"
[-25613773.707249] ProcId 1 - "IPU2"
[-25613773.707256] ProcId 2 - "IPU1"
[-25613773.707263] ProcId 3 - "DSP2"
[-25613773.707270] ProcId 4 - "DSP1"
[-25613773.707277] status = 0
[-25613773.707284] DONE
[-25613773.707291] Sending response...
[-25613773.707303] Retrieving command...
[-25613773.707354] LAD_NAMESERVER_SETUP: calling NameServer_setup()...
[-25613773.707364] NameServer_setup: entered, refCount=1
[-25613773.707371] NameServer_setup: already setup
[-25613773.707378] NameServer_setup: exiting, refCount=2
[-25613773.707386] status = 1
[-25613773.707392] DONE
[-25613773.707399] Sending response...
[-25613773.707411] Retrieving command...
[-25613773.707451] LAD_MESSAGEQ_GETCONFIG: calling MessageQ_getConfig()...
[-25613773.707460] status = 0
[-25613773.707467] DONE
[-25613773.707474] Sending response...
[-25613773.707486] Retrieving command...
[-25613773.707524] LAD_MESSAGEQ_SETUP: calling MessageQ_setup()...
[-25613773.707533] MessageQ_setup: entered, refCount=0
[-25613773.707541] NameServer_create(): 'MessageQ'
[-25613773.707554] MessageQ_setup: exiting, refCount=1
[-25613773.707561] status = 0
[-25613773.707568] DONE
[-25613773.707575] Sending response...
[-25613773.707587] Retrieving command...
[-25613773.707793] NameServer_attach: --> procId=1, refCount=0
[-25613773.707822] NameServer_attach: created send socket: 6, procId 1
[-25613773.707852] NameServer_attach: connect failed: procId=1, errno=22 (Invalid argument)
[-25613773.707876] closing send socket: 6
[-25613773.707900] NameServer_attach: <-- refcount="0," status="-1" -25613773="" 707910="" sending="" response="" 707952="" retrieving="" command="" 707968="" nameserver_attach:="" --=""> procId=2, refCount=0
[-25613773.707983] NameServer_attach: created send socket: 6, procId 2
[-25613773.707994] NameServer_attach: connect failed: procId=2, errno=22 (Invalid argument)
[-25613773.708108] closing send socket: 6
[-25613773.708130] NameServer_attach: <-- refcount="0," status="-1" -25613773="" 708139="" sending="" response="" 708181="" retrieving="" command="" 708196="" nameserver_attach:="" --=""> procId=3, refCount=0
[-25613773.708212] NameServer_attach: created send socket: 6, procId 3
[-25613773.708224] NameServer_attach: connect failed: procId=3, errno=22 (Invalid argument)
[-25613773.708235] closing send socket: 6
[-25613773.708250] NameServer_attach: <-- refcount="0," status="-1" -25613773="" 708259="" sending="" response="" 708297="" retrieving="" command="" 708312="" nameserver_attach:="" --=""> procId=4, refCount=0
[-25613773.708326] NameServer_attach: created send socket: 6, procId 4
[-25613773.708337] NameServer_attach: connect failed: procId=4, errno=22 (Invalid argument)
[-25613773.708348] closing send socket: 6
[-25613773.708363] NameServer_attach: <-- refcount="" status="0" -25613773="" 708372="" sending="" response="" 708413="" retrieving="" command="" 708428="" lad_gatemp_issetup:="" calling="" gatemp_issetup="" 708451="" 708459="" done="" 708466="" 708501="" 708516="" lad_gatehwspinlock_getconfig:="" gatehwspinlock_getconfig="" 708524="" baseaddr="0x4a0f6000" 708532="" size="0x1000" offset="0x800" 708539="" 708546="" 708553="" 708676="" 708693="" lad_gatemp_start:="" gatemp_start="" 708701="" 708708="" 708715="" 708744="" 708759="" lad_gatemp_getnumresources:="" gatemp_getnumresources="" 708767="" 708774="" 708780="" 708822="" 708837="" lad_nameserver_get:="" nameserver_get="" 0x30228="" _gatemp_ti_dgate="" 708846="" 708858="" nameserver_getlocal:="" entry="" key:="" not="" found="" 708867="" nameserver_getremote:="" no="" socket="" connection="" to="" processor="" 1="" 708875="" 2="" 708881="" 3="" 708889="" 4="" 708896="" value="0x80" 708903="" 708909="" 708915="" 708965="" 708979="" lad_messageq_create:="" messageq_create="" 0x2f89c="" 0x2f8bc="" 708988="" messageq_create:="" creating="" host:msgq:01="" 708998="" returning="" obj="0x30640," qid="0x80" 709007="" 709013="" 709020="" 709056="" 709071="" lad_messageq_announce:="" messageq_announce="" 0x30640="" 709079="" messageq_announce:="" announcing="" 709090="" nameserver_add:="" entered="" data:="" 0x80="" 709099="" 709106="" 709113="" 709173="" 709188="" lad_nameserver_getuint32:="" nameserver_getuint32="" 0x30558="" dsp1:msgq:01="" 709198="" 709207="" 709214="" 709221="" 709228="" 709235="" 709241="" 709248="" 709255="" 709294="" -25613772="" 709403="" 709436="" 709448="" 709456="" 709464="" 709471="" 709478="" 709486="" 709493="" 709500="" 709517="" -25613771="" 709645="" 709670="" 709681="" 709689="" 709697="" 709704="" 709728="" 709737="" 709744="" 709750="" 709765="" -25613770="" 709893="" 709918="" 709929="" 709938="" 709945="" 709952="" 709959="" 709967="" 709974="" 709980="" 709995="" -25613769="" 710120="" 710144="" 710155="" 710163="" 710171="" 710178="" 710185="" 710193="" 710200="" 710207="" 710221="" -25613768="" 710342="" 710365="" 710376="" 710384="" 710392="" 710399="" 710407="" 710414="" 710421="" 710427="" 710442="" -25613767="" 710564="" 710587="" 710597="" 710606="" 710613="" 710620="" 710627="" 710634="" 710641="" 710648="" 710662="" -25613766="" 710782="" 710805="" 710815="" 710823="" 710831="" 710838="" 710845="" 710853="" 710859="" 710865="" 710880="" -25613765="" 711005="" 711027="" 711037="" 711046="" 711053="" 711061="" 711068="" 711076="" 711083="" 711105="" 711121="" -25613764="" 711242="" 711265="" 711276="" 711284="" 711292="" 711299="" 711306="" 711314="" 711320="" 711327="" 711341="" 711638="" lad_messageq_destroy:="" messageq_destroy="" 711652="" messageq_destroy:="" 711660="" messageq_delete:="" deleting="" 711678="" 0="" 711693="" exiting="" 711701="" 711708="" 711715="" 711728="" 711769="" lad_nameserver_destroy:="" nameserver_destroy="" 711779="" nameserver_destroy:="" 711786="" :=""> 0, exiting
[-25613764.711794] NameServer_destroy: exiting, refCount=1
[-25613764.711801] status = 0
[-25613764.711808] DONE
[-25613764.711815] Sending response...
[-25613764.711827] Retrieving command...
[-25613764.711961]
LAD_DISCONNECT: [-25613764.711973]
client handle = 0[-25613764.711980]
closing FIFO /tmp/LAD/302 (filePtr=0x303f0)
[-25613764.712020] done, unlinking /tmp/LAD/302
[-25613764.712052] DONE
[-25613764.712061] Retrieving command...
[-25613763.101535] EOF detected on FIFO, closing FIFO: /tmp/LAD/LADCMDS
[-25613763.101603]
opening FIFO: /tmp/LAD/LADCMDS
It seems that NameServer_attach fails when trying to connect to the socket. Adding 300ms sleep before running this procedure makes it work correctly. Any ideas what could cause that? Both working and not working example hit (Invalid argument) problem but the working one succeeds on the fourth try while the other still fails.