Thread shuts down process when try to start it

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Thread shuts down process when try to start it

  • Creator
    Topic
  • #50028
    Jerry Magrann
    Participant

    I’m a brand new developer and received in house training. During this training, I developed a new ADT file thread to be used in our test environment. I developed the thread in a separate environment and moved it over along with 2 TCL procs, but now it gives the following error when trying to start which didn’t happen in the environment I built it in:

    PANIC: assertion ‘msg != ((Message *) 0) ‘ failed at tps.cpp/848.

    I’m thinking I have a reference to the orginal area, but I’ve looked everywhere and can’t find anything and can’t find anything on the forum here that relates to the error message 848. My assumption is that has something to do with the TCL scripts?

    Thanks in advance for any assistance.

Viewing 4 reply threads
  • Author
    Replies
    • #64599
      Kevin Kinnell
      Participant

      That error looks like a C++ runtime error.

      It seems to be saying that an assertion that variable ‘msg’ is not a null pointer

      is failing at (Cloverleaf source) file tps.cpp at line 848.

      I guess that might happen if you were trying to operate on a message pointer that

      wasn’t initialized with a valid message, or had been there and got freed.

      Was this in the Testing tool?

      –kk

    • #64600
      Jerry Magrann
      Participant

      Not in the the testing tool – this error happens when I watch the output as the process is starting.

      I have two TCL procs on this thread and have determined the one is causing the error. The proc is supposed to filter transactions. Being new to TCL as well, I’m not sure what exactly it could be. Here is my code and I put the section in bold I think I don’t need, but I could be wrong:

      proc hbr_filter { args } {

         keylget args MODE mode                  ;# Fetch mode

         global HciConnName

         set module “[lindex [info level 0] 0]/$HciConnName: “

         set debug 1                                        ;# Set debug flag to turn on echo statements

         

         set dispList {}                ;# Nothing to return

         switch -exact — $mode {

             start {

                 # Perform special init functions

             # N.B.: there may or may not be a MSGID key in args

             }

             run {

             # ‘run’ mode always has a MSGID; fetch and process it

                 keylget args MSGID mh

                 set msgData [msgget $mh]

                 set time [fmtclock [getclock] “%Y%m%d%H%M”]

                 

                 set fieldsep [cindex $msgData 3]

                 #set fieldsep [string index $msgData 3]

                 #set msgData [split $msgData $fieldsep]

                 set segs [split $msgData r]

                 #set msgData [lreplace $msgData 6 7 $time TEST]

                 #set msgData [join $msgData $fieldsep]

                 set i -1

                 foreach segment $segs {

                  incr i

                  set fields [split $segment $fieldsep]

                  switch -exact [lindex $fields 0] {

                  MSH {

       

                 

                  }

                 

                  EVN {

                  set evn1 [lindex $fields 1]

                  }

                 

                  PV1 {

                  set pv1_2 [lindex $fields 2]

                  set pv1_14 [lindex $fields 14]

                 

                  }

                 

                 

                  }

                 

                 }

                 

                 if {[cequal $evn1 A06] && ![cequal $pv1_14 E]

                 || [cequal $evn1 P01] && ![cequal $pv1_2 E]} {

                  lappend dispList “KILL $mh”

                 } else {

                  lappend dispList “CONTINUE $mh”

                  if {$debug} {echo In $module > ER Patient}

                 

                 }

                 

                     

                if {$debug} {echo In $module> $msgData}

                 lappend dispList “CONTINUE $mh”        }

             time {

                 # Timer-based processing

             # N.B.: there may or may not be a MSGID key in args

             }

             

             shutdown {

             # Doing some clean-up work

             }

         }

         return $dispList

      }

    • #64601
      Kevin Kinnell
      Participant

      It looks like you are trying to CONTINUE the same message twice, all right.

      I’d try it without the lappend displist “Continue… and see.

    • #64602
      Charlie Bursell
      Participant

      You have an extra lappend dispList.  Remove the last one

      Also, there is no need to loop over every segment jsut to get the data from two.  Try something like this:

      proc hbr_filter  { args } {

         keylget args MODE mode                  ;# Fetch mode

         global HciConnName

         set module “[lindex [info level 0] 0]/$HciConnName: “

         set debug 1  ;# Set debug flag to turn on echo statements

         set dispList {}                ;# Nothing to return

         switch -exact — $mode {

      start {

         return “” ;# Nothing specific

      }

      run {

         # ‘run’ mode always has a MSGID; fetch and process it

         keylget args MSGID mh

         set msgData [msgget $mh]

         set fieldsep [string index $msgData 3]

         set segs [split $msgData r]

         # Assumes Tcl 8.4

         set PV1flds [split [lsearch -inline -regexp $segs {^PV1}] $fieldsep]

         # If Tcl 8.3

         #set PV1flds [split [lindex [lregexp $segs {^PV1}] 0] $fieldsep]

         set pv1_2 [lindex $PV1flds 2]

         set pv1_14 [lindex $PV1flds 14]

         # Assumes Tcl 8.4

         set EVNflds [split [lsearch -inline -regexp $segs {^EVN}] $fieldsep]

         # If Tcl 8.3

         #set EVNflds [split [lindex [lregexp $segs {^EVN}] 0] $fieldsep]

         set evn1 [lindex $EVNflds 1]

         if {([string equal $evn1 A06] && ![string equal $pv1_14 E]) ||

         ([string equal $evn1 P01] && ![string equal $pv1_2 E])} {

         lappend dispList “KILL $mh”

         } else {

      lappend dispList “CONTINUE $mh”

      if {$debug} {echo In $module > ER Patient}

         }

         if {$debug} {echo In $module> $msgData}

      }

         }

         

         return $dispList

      }

    • #64603
      Jerry Magrann
      Participant

      I have moved the filter to the inbound side (previously had on the outbound) and everything is working or seems to be.  I will also remove the 2nd continue to see how it reacts when the users begin testing. Thanks all for your assistance.

Viewing 4 reply threads
  • The forum ‘Cloverleaf’ is closed to new topics and replies.

Forum Statistics

Registered Users
5,127
Forums
28
Topics
9,300
Replies
34,445
Topic Tags
288
Empty Topic Tags
10