Hi, with the attached in progress grammar for a MGCP I end up with a crash when marking OOPs (the code has a bug but probably should not crash the GC).
It probably crashes in the testReply, most likely because responseCode, responseStringe and packageName have no proper return. some backtrace.. it crashes because the stack overruns #31 0x00f56c8a in _gst_mark_an_oop_internal (oop=<value optimized out>) at oop.c:2262 #32 0x00f56c8a in _gst_mark_an_oop_internal (oop=<value optimized out>) at oop.c:2262 #33 0x00f56c8a in _gst_mark_an_oop_internal (oop=<value optimized out>) at oop.c:2262 #34 0x00f56c8a in _gst_mark_an_oop_internal (oop=<value optimized out>) at oop.c:2262 #35 0x00f56c8a in _gst_mark_an_oop_internal (oop=<value optimized out>) at oop.c:2262 #36 0x00f56c8a in _gst_mark_an_oop_internal (oop=<value optimized out>) at oop.c:2262
" (C) 2010 by Holger Hans Peter Freyther All Rights Reserved This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. " PackageLoader fileInPackage: 'PetitParser'. PP.PPCompositeParser subclass: MGCPGrammar [ | MGCPMessage EOL One_WSP MGCPMessage MGCPCommandLine MGCPVerb transaction_id endpointName MGCPversion MGCPParameter MGCPCommand ParameterValue SDPRecord SDPLine SDPinformation MGCPResponse MGCPResponseLine responseCode responseString packageName | <category: 'MGCP-Core'> <comment: 'I am a the Grammar of the Media Gateway Control Protocol'> start [ <category: 'accessing'> ^ MGCPMessage end ] EOL [ <category: 'grammar-common'> ^ (Character cr asParser, Character lf asParser) / Character lf asParser ] One_WSP [ <category: 'grammar-common'> ^ #blank asParser plus ] MGCPMessage [ <category: 'grammar-common'> ^ MGCPCommand / MGCPResponse ] MGCPCommandLine [ <category: 'grammar-cmd'> ^ self MGCPVerb, self One_WSP, self transaction_id, self One_WSP, self endpointName, self One_WSP, self MGCPversion, self EOL ] MGCPVerb [ <category: 'grammar-cmd'> ^ 'EPCF' asParser / 'CRCX' asParser / 'MDCX' asParser / 'DLCX' asParser / 'RQNT' asParser / 'NTFY' asParser / 'AUEP' asParser / 'AUCX' asParser / 'RSIP' asParser ] transaction_id [ <category: 'grammar-cmd'> ^ ((#digit asParser) min: 1 max: 9) flatten ] endpointName [ <category: 'grammar-cmd'> "simplified version" ^ #word asParser star flatten, $@ asParser, #word asParser star flatten ] MGCPversion [ <category: 'grammar-cmd'> "skipping the optional profilename for now" ^ 'MGCP' asParser, One_WSP, #digit asParser, $. asParser, #digit asParser ] MGCPCommand [ <category: 'grammar-cmd'> ^ MGCPCommandLine, MGCPParameter star, SDPRecord optional ] MGCPParameter [ <category: 'grammar-cmd'> ^ ParameterValue, EOL ] wordParser [ ^ #word asParser / #punctuation asParser / ' ' asParser ] ParameterValue [ ^ ($K asParser, $: asParser, #blank asParser star, self wordParser star flatten) / ($B asParser, $: asParser, #blank asParser star, self wordParser star flatten) / ($C asParser, $: asParser, #blank asParser star, self wordParser star flatten) / ($I asParser, $: asParser, #blank asParser star, self wordParser star flatten) / ($N asParser, $: asParser, #blank asParser star, self wordParser star flatten) / ($X asParser, $: asParser, #blank asParser star, self wordParser star flatten) / ($L asParser, $: asParser, #blank asParser star, self wordParser star flatten) / ($M asParser, $: asParser, #blank asParser star, self wordParser star flatten) / ($R asParser, $: asParser, #blank asParser star, self wordParser star flatten) / ($S asParser, $: asParser, #blank asParser star, self wordParser star flatten) / ($D asParser, $: asParser, #blank asParser star, self wordParser star flatten) / ($O asParser, $: asParser, #blank asParser star, self wordParser star flatten) / ($P asParser, $: asParser, #blank asParser star, self wordParser star flatten) / ($E asParser, $: asParser, #blank asParser star, self wordParser star flatten) / ($Z asParser, $: asParser, #blank asParser star, self wordParser star flatten) / ($Z asParser, $: asParser, #blank asParser star, self wordParser star flatten) / ('Z2' asParser, $: asParser, #blank asParser star, self wordParser star flatten) / ('I2' asParser, $: asParser, #blank asParser star, self wordParser star flatten) / ($F asParser, $: asParser, #blank asParser star, self wordParser star flatten) / ($Q asParser, $: asParser, #blank asParser star, self wordParser star flatten) / ($T asParser, $: asParser, #blank asParser star, self wordParser star flatten) / ('RM' asParser, $: asParser, #blank asParser star, self wordParser star flatten) / ('RD' asParser, $: asParser, #blank asParser star, self wordParser star flatten) / ($A asParser, $: asParser, #blank asParser star, self wordParser star flatten) / ('ES' asParser, $: asParser, #blank asParser star, self wordParser star flatten) / ('PL' asParser, $: asParser, #blank asParser star, self wordParser star flatten) / ('MD' asParser, $: asParser, #blank asParser star, self wordParser star flatten) ] MGCPResponse [ " MGCPResponse = MGCPResponseLine 0*(MGCPParameter) *2(EOL *SDPinformation) The *2 appears to be weird " ^ MGCPResponseLine, MGCPParameter star, SDPRecord optional ] responseCode [ <category: 'response'> ] packageName [ <category: 'response'> ] responseString [ <category: 'response'> ] MGCPResponseLine [ ^ responseCode, self One_WSP, (self One_WSP, '/' asParser, packageName) optional, (self One_WSP, responseString) optional, EOL ] SDPRecord [ ^ EOL, SDPinformation ] SDPinformation [ ^ (SDPLine, EOL) plus ] SDPLine [ ^ self wordParser star flatten ] ] Eval [ MGCPGrammar initialize. ]
" (C) 2010-2011 by Holger Hans Peter Freyther All Rights Reserved This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. " PackageLoader fileInPackage: 'PetitParserTests'. PP.PPCompositeParserTest subclass: MGCPGrammarTest [ <comment: 'I test some parts of thegrammar'> <category: 'MGCP-Tests'> MGCPGrammarTest class >> packageNamesUnderTest [ <category: 'accessing'> ^#('MGCPGrammar') ] parserClass [ <category: 'accessing'> ^MGCPGrammar ] testCommand [ <category: 'test-command'> | res nl | nl := Character cr asString, Character nl asString. res := self parse: 'AUEP 23444 13@mgw MGCP 1.0', nl, 'K: 3445', nl, 'I: 233434', nl, 'L: p:20, a:GSM-EFR, nt:IN', nl, 'M: recvonly', nl, nl, 'v=0', nl, 'o=- 258696477 0 IN IP4 172.16.1.107', nl, 's=-', nl, 'c=IN IP4 172.16.1.107', nl, 't=0 0', nl, 'm=audio 6666 RTP/AVP 127', nl, 'a=rtpmap:127 GSM-EFR/8000/1', nl, 'a=ptime:20', nl, 'a=recvonly', nl, 'm=image 4402 udptl t38', nl, 'a=T38FaxVersion:0', nl, 'a=T38MaxBitRate:14400', nl. self assert: res size = 10. self assert: (res at: 1) = 'AUEP'. self assert: (res at: 3) = '23444'. self assert: (res at: 5) = #('13' $@ 'mgw'). res inspect. ] testReply [ | res nl | nl := Character cr asString, Character nl asString. res := self parse: '200 123456 OK', nl. ] ]
_______________________________________________ help-smalltalk mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-smalltalk
