All of lore.kernel.org
 help / color / mirror / Atom feed
* dosemu, powerbasic program, centos 5 and Fedora 10
@ 2009-03-12  0:27 Frank Cox
  2009-03-12  4:47 ` Frank Cox
  2009-10-11  5:44 ` Frank Cox
  0 siblings, 2 replies; 5+ messages in thread
From: Frank Cox @ 2009-03-12  0:27 UTC (permalink / raw)
  To: linux-msdos

I seem to have uncovered some sort of a bug, but I'm not sure in what.

I have a computer set up with Fedora 10/x86_64, and another with Centos 5/i386.
Both have dosemu 1.4.0 installed.

I have a program that's written in powerbasic that runs fine on the Centos box
but crashes dosemu on the Fedora box.  The dosemu window closes without
any error reported -- the window just disappears.

I have narrowed the problem down to some interaction between a "DEFINT A-Z"
compiler directive and a word wrap subroutine that's part of the program.  If I
either remove the DEFINT directive, comment-out the word wrap subroutine or
remove the parts of the program that actually call that subroutine, the program
doesn't crash on Fedora 10.

I'm sure this program worked fine up until at least fairly recently.  I see
that the last time I modified it was in October of 2008, so it apparently worked
fine on Fedora 9/x86_64, which is what I was running on this machine at that
time.

I have included the word wrap routine here so you can see what it does.  It
runs fine as-is on Centos 5/i386 but crashes on Fedora 10/x86_64.  Removing the
DEFINT line makes it work fine on both machines.  It's just this routine alone
that's causing the problem because the crash occurs when attempting to run the
compiled version of exactly what you see here.  If anyone else would like to
try this, I have put the powerbasic-compiled version of the following program
on my website at http://www.melvilletheatre.com/dosemu-crash.tar.bz2

Again, it runs fine on Centos 5/i386 but crashes on Fedora 10/x86_64.

$cpu 80386
$float npx
$lib all off
DEFINT A-Z     ' -- If this line commented out it works.

WordWrap text$,1,76,5

' ********************************
' text$, column, wrap length, row
SUB WordWrap (text$, x1, x2, y1)
        shared wrapped.text$()
        x=0
    savetext$ = text$
    s = x2 - x1
    y = y1
    ' LOCATE y, x1
    IF LEN(text$) > s THEN
       DO
         IF LEN(text$) = 0 THEN EXIT DO
         text$ = LTRIM$(text$)
         IF LEN(text$) >= s THEN
            tmp$ = LEFT$(text$, s)
         ELSE
            tmp$ = text$
         END IF
         stmp$ = tmp$
         GOSUB ReverseTmp
         IF MID$(text$, s + 1, 1) = " " THEN
            wrapped.text$(x)= stmp$
            incr x
            text$ = MID$(text$, s + 1)
         ELSE
         a = INSTR(tmp$, " ")
         IF a = 0 THEN
            wrapped.text$(x)= stmp$
            incr x
            text$ = MID$(text$, s + 1)
         ELSE
            wrapped.text$(x)= LEFT$(text$, s - a)
            incr x
            text$ = MID$(text$, s - a + 1)
         END IF
         END IF
         incr y
         ' LOCATE y, x1
       LOOP
    ELSE
       wrapped.text$(x)=text$
    END IF
    text$ = savetext$
    EXIT SUB

ReverseTmp:
    t$ = ""
    FOR I = LEN(tmp$) TO 1 STEP -1
        t$ = t$ + MID$(tmp$, I, 1)
    NEXT I
    tmp$ = t$
    RETURN
END SUB


-- 
MELVILLE THEATRE ~ Melville Sask ~ http://www.melvilletheatre.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: dosemu, powerbasic program, centos 5 and Fedora 10
  2009-03-12  0:27 dosemu, powerbasic program, centos 5 and Fedora 10 Frank Cox
@ 2009-03-12  4:47 ` Frank Cox
  2009-03-27  3:14   ` Frank Cox
  2009-10-11  5:44 ` Frank Cox
  1 sibling, 1 reply; 5+ messages in thread
From: Frank Cox @ 2009-03-12  4:47 UTC (permalink / raw)
  To: linux-msdos

On Wed, 11 Mar 2009 18:27:23 -0600
Frank Cox wrote:

> Again, it runs fine on Centos 5/i386 but crashes on Fedora 10/x86_64.

It's not an x86_64 issue because the program crashes on my Fedora 10/i386
laptop as well.

-- 
MELVILLE THEATRE ~ Melville Sask ~ http://www.melvilletheatre.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: dosemu, powerbasic program, centos 5 and Fedora 10
  2009-03-12  4:47 ` Frank Cox
@ 2009-03-27  3:14   ` Frank Cox
  0 siblings, 0 replies; 5+ messages in thread
From: Frank Cox @ 2009-03-27  3:14 UTC (permalink / raw)
  To: linux-msdos

On Wed, 11 Mar 2009 22:47:15 -0600
Frank Cox wrote:

> On Wed, 11 Mar 2009 18:27:23 -0600
> Frank Cox wrote:
> 
> > Again, it runs fine on Centos 5/i386 but crashes on Fedora 10/x86_64.
> 
> It's not an x86_64 issue because the program crashes on my Fedora 10/i386
> laptop as well.

This entry from boot.log looks interesting.  This is what happens when I run
the tester.exe program that I posted on my website earlier:

leavedos(47810|0xbac2) called - shutting down
======================= LEAVE CPU-EMU ===============
Total cpuemu time           765361 us (incl.trace)
Total codgen time            77690 us
Total linker time            61078 us
Total exec   time           288623 us (incl.faults)
Total insert time            60485 us
Total search time            21702 us
Total clean  time            21876 us
Max tree nodes                2274
Max node size                  354
Max tree depth                  13
Nodes parsed                106881
Find misses                  73658
Nodes executed              483065
Find hits                   148561 (30%)
Find last hits              334504 (69%)
Page faults                  36805
Signals received               238
Tree cleanups                   14


-- 
MELVILLE THEATRE ~ Melville Sask ~ http://www.melvilletheatre.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: dosemu, powerbasic program, centos 5 and Fedora 10
  2009-03-12  0:27 dosemu, powerbasic program, centos 5 and Fedora 10 Frank Cox
  2009-03-12  4:47 ` Frank Cox
@ 2009-10-11  5:44 ` Frank Cox
  2009-10-12  5:06   ` Frank Cox
  1 sibling, 1 reply; 5+ messages in thread
From: Frank Cox @ 2009-10-11  5:44 UTC (permalink / raw)
  To: linux-msdos

On Wed, 11 Mar 2009 18:27:23 -0600
Frank Cox wrote:

> I seem to have uncovered some sort of a bug, but I'm not sure in what.
> 
> I have a computer set up with Fedora 10/x86_64, and another with Centos 5/i386.
> Both have dosemu 1.4.0 installed.
> 
> I have a program that's written in powerbasic that runs fine on the Centos box
> but crashes dosemu on the Fedora box.  The dosemu window closes without
> any error reported -- the window just disappears.
> 
> I have narrowed the problem down to some interaction between a "DEFINT A-Z"
> compiler directive and a word wrap subroutine that's part of the program.  If I
> either remove the DEFINT directive, comment-out the word wrap subroutine or
> remove the parts of the program that actually call that subroutine, the program
> doesn't crash on Fedora 10.
> 
> I'm sure this program worked fine up until at least fairly recently.  I see
> that the last time I modified it was in October of 2008, so it apparently worked
> fine on Fedora 9/x86_64, which is what I was running on this machine at that
> time.
> 
> I have included the word wrap routine here so you can see what it does.  It
> runs fine as-is on Centos 5/i386 but crashes on Fedora 10/x86_64.  Removing the
> DEFINT line makes it work fine on both machines.  It's just this routine alone
> that's causing the problem because the crash occurs when attempting to run the
> compiled version of exactly what you see here.  If anyone else would like to
> try this, I have put the powerbasic-compiled version of the following program
> on my website at http://www.melvilletheatre.com/dosemu-crash.tar.bz2
> 
> Again, it runs fine on Centos 5/i386 but crashes on Fedora 10/x86_64.
> 
> $cpu 80386
> $float npx
> $lib all off
> DEFINT A-Z     ' -- If this line commented out it works.
> 
> WordWrap text$,1,76,5
> 
> ' ********************************
> ' text$, column, wrap length, row
> SUB WordWrap (text$, x1, x2, y1)
>         shared wrapped.text$()
>         x=0
>     savetext$ = text$
>     s = x2 - x1
>     y = y1
>     ' LOCATE y, x1
>     IF LEN(text$) > s THEN
>        DO
>          IF LEN(text$) = 0 THEN EXIT DO
>          text$ = LTRIM$(text$)
>          IF LEN(text$) >= s THEN
>             tmp$ = LEFT$(text$, s)
>          ELSE
>             tmp$ = text$
>          END IF
>          stmp$ = tmp$
>          GOSUB ReverseTmp
>          IF MID$(text$, s + 1, 1) = " " THEN
>             wrapped.text$(x)= stmp$
>             incr x
>             text$ = MID$(text$, s + 1)
>          ELSE
>          a = INSTR(tmp$, " ")
>          IF a = 0 THEN
>             wrapped.text$(x)= stmp$
>             incr x
>             text$ = MID$(text$, s + 1)
>          ELSE
>             wrapped.text$(x)= LEFT$(text$, s - a)
>             incr x
>             text$ = MID$(text$, s - a + 1)
>          END IF
>          END IF
>          incr y
>          ' LOCATE y, x1
>        LOOP
>     ELSE
>        wrapped.text$(x)=text$
>     END IF
>     text$ = savetext$
>     EXIT SUB
> 
> ReverseTmp:
>     t$ = ""
>     FOR I = LEN(tmp$) TO 1 STEP -1
>         t$ = t$ + MID$(tmp$, I, 1)
>     NEXT I
>     tmp$ = t$
>     RETURN
> END SUB

I periodically try running the tester.exe program that I describe here on my
computers to see if by any chance one of the frequent updates to Fedora 11
might suddenly solve this problem.  tester.exe has never worked on Fedora 11 at
all; it just closes the dosemu window as described.

To my surprise, I have today discovered that tester.exe once again works on my
Acer Aspire One (Fedora 11/i386).  It also now works on my desktop computer
(Fedora 11/x86_64) when I change the following line in ~/.dosemurc:

 $_cpu_emu = "vm86sim"

It doesn't work with the default setting of:

# $_cpu_emu = "off"

So there's still something strange going on, somewhere.



-- 
MELVILLE THEATRE ~ Melville Sask ~ http://www.melvilletheatre.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: dosemu, powerbasic program, centos 5 and Fedora 10
  2009-10-11  5:44 ` Frank Cox
@ 2009-10-12  5:06   ` Frank Cox
  0 siblings, 0 replies; 5+ messages in thread
From: Frank Cox @ 2009-10-12  5:06 UTC (permalink / raw)
  To: linux-msdos

On Sat, 10 Oct 2009 23:44:45 -0600
Frank Cox wrote:

> To my surprise, I have today discovered that tester.exe once again works on my
> Acer Aspire One (Fedora 11/i386).  It also now works on my desktop computer
> (Fedora 11/x86_64) when I change the following line in ~/.dosemurc:
> 
>  $_cpu_emu = "vm86sim"
> 
> It doesn't work with the default setting of:
> 
> # $_cpu_emu = "off"
> 
> So there's still something strange going on, somewhere.

Looks like I spoke a bit too soon.  While my program seems to run fine on my
Fedora 11/i386 machine, it crashes on F11/x86_64 with the following error:

ERROR: EMU86: error 96

The "tester.exe" program that I wrote runs fine, but a longer program generates
the above error.

Is there anything that I can do to help troubleshoot this issue?

-- 
MELVILLE THEATRE ~ Melville Sask ~ http://www.melvilletheatre.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-10-12  5:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-12  0:27 dosemu, powerbasic program, centos 5 and Fedora 10 Frank Cox
2009-03-12  4:47 ` Frank Cox
2009-03-27  3:14   ` Frank Cox
2009-10-11  5:44 ` Frank Cox
2009-10-12  5:06   ` Frank Cox

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.