From noreply at github.com Fri Dec 8 20:39:48 2017 From: noreply at github.com (GitHub) Date: Fri, 08 Dec 2017 11:39:48 -0800 Subject: [M3commit] [modula3/cm3] 4810c9: Naming and comments. Message-ID: <5a2aea842e5c7_6f182aab8ca1dc10773de@hookshot-fe-31feec6.cp1-iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/modula3/cm3 Commit: 4810c9795ba26f93eb2e1d42ffa255ea1f6be0a0 https://github.com/modula3/cm3/commit/4810c9795ba26f93eb2e1d42ffa255ea1f6be0a0 Author: Rodney Bates Date: 2017-12-08 (Fri, 08 Dec 2017) Changed paths: M m3-sys/m3front/src/exprs/ArrayExpr.m3 M m3-sys/m3front/src/exprs/CastExpr.m3 M m3-sys/m3front/src/exprs/EqualExpr.m3 M m3-sys/m3front/src/types/OpenArrayType.i3 M m3-sys/m3front/src/types/OpenArrayType.m3 M m3-sys/m3front/src/types/SubrangeType.m3 M m3-sys/m3front/src/types/TypeRep.i3 M m3-sys/m3front/src/values/Formal.m3 Log Message: ----------- Naming and comments. Clarify some things that were a hard fight to dig out. From rodney_bates at lcwb.coop Tue Dec 12 18:27:11 2017 From: rodney_bates at lcwb.coop (Rodney M. Bates) Date: Tue, 12 Dec 2017 11:27:11 -0600 Subject: [M3commit] [M3devel] Fwd: Strange code in Rd.CharsReady In-Reply-To: References: Message-ID: <1853d13f-2e6c-0863-2ff6-5f66be44fa51@lcwb.coop> Looking at this briefly, This change is mine, and yes, it is a bug. But I am doubtful that just reverting it will fix without introducing other problems. If you are not reading any Unicode or doing multi-character ungets, it will probably be fine. This change appears in several other places, where it is necessary (and correct, I think) to support multi-character unget, which in turn is needed for Unicode, since a single code point can be encoded in up to 4 bytes, and another reason I don't recall off hand. CharsReady needs to be different to avoid blocking. I'll be looking at it more as I get time. On 12/10/2017 03:19 PM, Mika Nystrom wrote: > not sure the list allows my other email address to email to it... > > ---------- Forwarded message ---------- > From: *Mika Nystrom* > > Date: Sun, Dec 10, 2017 at 1:07 PM > Subject: Strange code in Rd.CharsReady > To: m3devel at elegosoft.com > > > Hello m3devel, > > Long time no see! > > I am trying to resurrect some old code I have, and I have run into a strange issue. > > According to > > https://github.com/modula3/cm3/blame/master/m3-libs/libm3/src/rw/Rd.m3 > > the current source code for the routine Rd.CharsReady is as follows below. > > I am truly suspicious of line 389, which says it comes from some Unicode merge. > > IF NextBuff (rd) THEN RETURN 1 END (*line 389*) > > I have a program that misbehaves. > > This program appears to be BLOCKING in CharsReady. This behavior obviously defeats the purpose of CharsReady. I can't seem to cut and paste the traceback for some reason but it's calling Rd__NextBuff at line 151 and further then to ConnRW__RdSeek with dontBlock FALSE (so "OK to block") and then SchedulerPosix__AlertWait. > > The old version of line 389 I believe was > > IF rd.seek(rd.cur, TRUE) = SeekResult.Eof THEN RETURN 1 END > > where TRUE means "don't block". > > Can someone tell me the rationale for the change and whether I am correct if I say that the new version is wrong? > > I am wonder how this change could even have gotten into the code in the first place if it's causing CharsReady to block, seems like a pretty obvious bug and I don't see a reason for tthe change in the first place. > > Mika > > > > PROCEDURE CharsReady(rd: T): CARDINAL > 383 > RAISES {Failure} = > @hosking > Hide warning. > 3 years ago > > 384 > <*FATAL Thread.Alerted*> > @jaykrell > initial diff from ../config/PPC_LINUX > 10 years ago > 385 > BEGIN > @RodneyBates > Merge Unicode branch into head. For a summary of the changes, see > 4 years ago > > 386 > LOCK rd DO > @jaykrell > initial diff from ../config/PPC_LINUX > 10 years ago > 387 > IF rd.cur = rd.hi THEN > 388 > IF rd.closed THEN Die() END; > @RodneyBates > Merge Unicode branch into head. For a summary of the changes, see > 4 years ago > > 389 > IF NextBuff (rd) THEN RETURN 1 END > @jaykrell > initial diff from ../config/PPC_LINUX > 10 years ago > 390 > END; > 391 > RETURN rd.hi - rd.cur; > @RodneyBates > Merge Unicode branch into head. For a summary of the changes, see > 4 years ago > > 392 > END; > @jaykrell > initial diff from ../config/PPC_LINUX > 10 years ago > 393 > END CharsReady; > > > > > > > > _______________________________________________ > M3devel mailing list > M3devel at elegosoft.com > https://m3lists.elegosoft.com/mailman/listinfo/m3devel > -- Rodney Bates rodney.m.bates at acm.org From noreply at github.com Tue Dec 12 18:51:39 2017 From: noreply at github.com (GitHub) Date: Tue, 12 Dec 2017 09:51:39 -0800 Subject: [M3commit] [modula3/cm3] 0c15ea: Temporarily revert buggy change in Rd.CharsReady t... Message-ID: <5a30172beef85_56db2aea254f1c149647b@hookshot-fe-6b2eebc.cp1-iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/modula3/cm3 Commit: 0c15ea231199b07d03c652297552f6d82a4be2aa https://github.com/modula3/cm3/commit/0c15ea231199b07d03c652297552f6d82a4be2aa Author: Rodney Bates Date: 2017-12-12 (Tue, 12 Dec 2017) Changed paths: M m3-libs/libm3/src/rw/Rd.m3 Log Message: ----------- Temporarily revert buggy change in Rd.CharsReady that blocks. This may not be correct for some cases of multiple-character ungets and reading Unicode characters. It will probably work without trouble if you do neither of these things. From noreply at github.com Fri Dec 15 00:31:19 2017 From: noreply at github.com (GitHub) Date: Thu, 14 Dec 2017 15:31:19 -0800 Subject: [M3commit] [modula3/cm3] c15e8b: Fix Rd bug reported by Mika. Message-ID: <5a3309c71a9c3_14bf2af805fbdc04493d4@hookshot-fe-8867ff3.cp1-iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/modula3/cm3 Commit: c15e8bf9a4958fe1f22e50f95ead1fef61a007bc https://github.com/modula3/cm3/commit/c15e8bf9a4958fe1f22e50f95ead1fef61a007bc Author: Rodney Bates Date: 2017-12-14 (Thu, 14 Dec 2017) Changed paths: M m3-libs/libm3/src/rw/Rd.m3 Log Message: ----------- Fix Rd bug reported by Mika. In which CharsReady incorrectly was blocking. Also fix a bug in GetSub, in cases where a lot of ungetting and regetting happens. Also fix some places where closed check was not happening as aggressively as in the specifications in the comments in Rd.i3. From noreply at github.com Sun Dec 17 23:04:05 2017 From: noreply at github.com (GitHub) Date: Sun, 17 Dec 2017 14:04:05 -0800 Subject: [M3commit] [modula3/cm3] 1c4f22: CharsReady still wasn't right--missed one place. Message-ID: <5a36e9d58147e_33332b25a8a29c04226aa@hookshot-fe-8867ff3.cp1-iad.github.net.mail> Branch: refs/heads/master Home: https://github.com/modula3/cm3 Commit: 1c4f22348947edbcdc4853dad2c58d2c7e36af5f https://github.com/modula3/cm3/commit/1c4f22348947edbcdc4853dad2c58d2c7e36af5f Author: Rodney Bates Date: 2017-12-17 (Sun, 17 Dec 2017) Changed paths: M m3-libs/libm3/src/rw/Rd.m3 Log Message: ----------- CharsReady still wasn't right--missed one place.