Welcome, Guest. Please login or register.

Author Topic: We need an iBrowse replacement for 68k!!!  (Read 75440 times)

Description:

0 Members and 2 Guests are viewing this topic.

Offline wawrzon

Re: We need an iBrowse replacement for 68k!!!
« Reply #284 on: January 27, 2015, 03:08:22 PM »
Quote

(32.699992) amiga/gui.c ami_gui_splash_open 5192: BitMapObject = 0x000000


if im not mistaken, according to the debug log only this one (splash image?) looks like problem? everything else seems to be going right so far?
 

Offline chris

Re: We need an iBrowse replacement for 68k!!!
« Reply #285 on: January 27, 2015, 07:01:35 PM »
Quote from: matthey;782405
splash.png displays fine with my datatypes using Multiview. I don't see anything wrong with the path. Chris has it nice and simply set up so everything is PROGDIR: relative.

Edit: There are no MuForce/MuGuardianAngel problems with the splash screen but there are some after which should be fixed. NetSurf runs and exits without crashing when I am using MuForce. The links below are the complete MuForce/MuGuardianAngel output and the Netsuf debug output.

http://www.heywheel.com/matthey/Amiga/NetSurf_MuHits.txt
http://www.heywheel.com/matthey/Amiga/NetSurf_debug.txt

It looks like GCCFindHit should locate most of the problems in the source :).

Looks like some NULL pointer accesses and some odd memory alignment problem. (edit: see below)
« Last Edit: January 27, 2015, 07:27:57 PM by chris »
"Miracles we do at once, the impossible takes a little longer" - AJS on Hyperion
Avatar picture is Tabitha by Eric W Schwartz
 

Offline chris

Re: We need an iBrowse replacement for 68k!!!
« Reply #286 on: January 27, 2015, 07:11:18 PM »
Quote from: chris;782446
I've just tried building with -O0 in case it was optimisation screwing it up but it seems to have made no difference whatsoever.

Scratch that, it helps if I don't immediately overwrite the flags I've just saved.  I'm amazed nobody suggested this.



Getting somewhere :)
"Miracles we do at once, the impossible takes a little longer" - AJS on Hyperion
Avatar picture is Tabitha by Eric W Schwartz
 

Offline chris

Re: We need an iBrowse replacement for 68k!!!
« Reply #287 on: January 27, 2015, 07:27:14 PM »
Quote from: matthey;782405
It looks like GCCFindHit should locate most of the problems in the source :).

I can't get gccfindhit to work here :(

(I tried both versions on Aminet and I built my own out of a piece of string and some slightly newer source code I found)
"Miracles we do at once, the impossible takes a little longer" - AJS on Hyperion
Avatar picture is Tabitha by Eric W Schwartz
 

Offline NovaCoder

Re: We need an iBrowse replacement for 68k!!!
« Reply #288 on: January 27, 2015, 08:14:00 PM »
Quote from: chris;782447
Scratch that, it helps if I don't immediately overwrite the flags I've just saved.  I'm amazed nobody suggested this.



Getting somewhere :)


Cool :)

Now you need to change that banner so it says 'Amiga OS'

;)
Life begins at 100 MIPS!


Nice Ports on AmiNet!
 

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show only replies by matthey
Re: We need an iBrowse replacement for 68k!!!
« Reply #289 on: January 27, 2015, 09:08:53 PM »
Quote from: chris;782447
Scratch that, it helps if I don't immediately overwrite the flags I've just saved.  I'm amazed nobody suggested this.
Getting somewhere :)

I've debugged it and it does look like a compiler problem.

ami_gui_splash_open() from amiga/gui.c

Code: [Select]
$0993927a: _ami_gui_splas LINK       A5,#-$0028 ; Allocate temp storage on stack
$0993927e:                MOVEM.L    D2-D5/A2-A4/A6,-(A7) ; Save registers
$09939282:                MOVE.L     _IntuitionBase,A6 ; A6 = ->IntuitionBase
$09939288:                LEA        $09932413(PC),A0 ; A0 = ->"Workbench"
$0993928c:                JSR        LockPubScreen(A6) ; D0 = LockPubScreen()
$09939290:                MOVE.L     D0,D5
$09939292:                CLR.L      -$0020(A5) ; top? = 0
$09939296:                CLR.L      -$001c(A5) ; left? = 0
$0993929a:                MOVE.L     _WindowClass,D3 ; D3 = ->WindowClass
$099392a0:                MOVE.L     #$80000066,-$0018(A5) ; WA_Width tag
$099392a8:                MOVE.L     _LayoutClass,D2 ; D2 = ->LayoutClass
$099392ae:                MOVE.L     #$85007001,-$0014(A5) ; LAYOUT_Orientation tag ???
$099392b6:                MOVE.L     #$85019001,-$0010(A5) ; BITMAP_SourceFile tag
$099392be:                MOVE.L     _IntuitionBase,A6 ; A6 = ->IntuitionBase (unnecessary)
$099392c4:                MOVE.L     _BitMapClass,A0 ; A0 = ->BitMapClass
$099392ca:                SUBA.L     A1,A1 ; A1 = 0
$099392cc:                LEA        -$0010(A5),A2 ; A2 = ->tag list
$099392d0:                JSR        NewObjectA(A6) ; NewObject()

* My particular tag list for NewObjectA() ends up being:
*
* A2-> 0x85019001,0x09f9bebc or BITMAP_SourceFile,""
*      0x09939c2a,0x00000000 or unitialized data on stack,TAG_END
*
* However, all the tags after the first are unitialized data on the stack :(.

The pointer to "PROGDIR:Resources/splash.png" is never written nor is any part of the taglist after that. GCC appears to be very confused here and I don't think it has anything to do with the include files (although LAYOUT_Orientation instead of LAYOUT_AddImage is strange but the includes look correct and that tag is not used for the bitmap.image tag list).

Quote from: chris;782449
I can't get gccfindhit to work here :(

(I tried both versions on Aminet and I built my own out of a piece of string and some slightly newer source code I found)

I'll see if I can find you the source functions. Symbols loaded for NetSurf with BDebug but line debug for sources didn't seem to work. It's usually the line debug type info that gives the source location but I don't know about STABS.
« Last Edit: January 27, 2015, 09:22:14 PM by matthey »
 

Offline chris

Re: We need an iBrowse replacement for 68k!!!
« Reply #290 on: January 28, 2015, 12:08:23 AM »
Quote from: matthey;782459
I've debugged it and it does look like a compiler problem.

* My particular tag list for NewObjectA() ends up being:
*
* A2-> 0x85019001,0x09f9bebc or BITMAP_SourceFile,""
*      0x09939c2a,0x00000000 or unitialized data on stack,TAG_END
*
* However, all the tags after the first are unitialized data on the stack :(.

Well, that explains why it doesn't work.  Something must be screwed up with GCC's optimisation in the version I'm using.  I'll have to try to get 4.5.4 working, but since I have a no optimisation workaround, and that's probably better for debugging, it can wait.

Quote
I'll see if I can find you the source functions. Symbols loaded for NetSurf with BDebug but line debug for sources didn't seem to work. It's usually the line debug type info that gives the source location but I don't know about STABS.

That would be very useful, I guess it needs a different -g option.

I've managed to get it as far as opening up the main browser window, but it's crashy crashy crashy and never loads the page.  I've uploaded a new build in the same place if you want to try it under real OS3 (still testing under OS4 here as it's easier).  I have noticed that you probably need to create a directory called "Users" in the NetSurf directory, as NetSurf itself never creates it (I was using CreateDirTree under OS4 but simply translated that to CreateDir for OS3 - so it misses this directory.  Something to fix later.)

Some line numbers for Enforcer hits would be incredibly useful now, as I don't have a clue where to start looking to get this working further, beyond fixing the font code which I'm pretty sure is making it assert.
"Miracles we do at once, the impossible takes a little longer" - AJS on Hyperion
Avatar picture is Tabitha by Eric W Schwartz
 

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show only replies by matthey
Re: We need an iBrowse replacement for 68k!!!
« Reply #291 on: January 28, 2015, 01:45:52 AM »
Quote from: chris;782469
Well, that explains why it doesn't work.  Something must be screwed up with GCC's optimisation in the version I'm using.  I'll have to try to get 4.5.4 working, but since I have a no optimisation workaround, and that's probably better for debugging, it can wait.

Sometimes less optimization is better up to a point. GCC generates aweful 68k code below -O1 or without optimizations making it tedious to read (in comparison, vbcc is nice, simple and readable with -O1) . Using registers is easier for me to read than using a stack frame also.

Quote from: chris;782469
That would be very useful, I guess it needs a different -g option.

GCCFindHit did not work for me either so I assume that it doesn't have the debug info it needs. It should say in the docs for GCCFindHit how it needs to be compiled. I have used GCCFindHit before with success.

Quote from: chris;782469
I've managed to get it as far as opening up the main browser window, but it's crashy crashy crashy and never loads the page.  I've uploaded a new build in the same place if you want to try it under real OS3 (still testing under OS4 here as it's easier).  I have noticed that you probably need to create a directory called "Users" in the NetSurf directory, as NetSurf itself never creates it (I was using CreateDirTree under OS4 but simply translated that to CreateDir for OS3 - so it misses this directory.  Something to fix later.)

Some line numbers for Enforcer hits would be incredibly useful now, as I don't have a clue where to start looking to get this working further, beyond fixing the font code which I'm pretty sure is making it assert.

The first hit (byte read from 0) comes from the locale.library patch of Stricmp() in the utility.library. This is called from the asl.library which is called from NetSurf in ami_file_req_init() of amiga/file.c. The problem occurs in the second AllocAslRequest(). It looks like D0=ASL_FileRequest=0 which is correct and A0 points at the tag list which is:

Code: [Select]
A0-> 0x8008002c,0x00000001 or ASLFR_DoSaveMode,TRUE
        0x8008003c,0x00000001 or ASLFR_RejectIcons,TRUE
        0x80080009,0x00000000 or ASLFR_InitialDrawer,NULL
        0x00000000 or TAG_DONE

The code does move your nsopt_charp to the tag list:

Code: [Select]
  move.l _nsoptions,a0
   move.l ($73c,a0),(-8,a5)

I believe GCC is creating the tags correctly here but a NULL pointer is moved to the data for the ASLFR_InitialDrawer tag item.

This is from the first archive. Note that hits after the first hit may be caused by earlier hits.

The second hit is a byte read from 0x85030001 which occurs in Libs:arexx.class as called from Intuition. The call originates from ami_arexx_init() in amiga/arexx.c. The second and last NewObjectA() or ARexxObject in your source is the problem. The tag list looks like:

Code: [Select]
A2-> 0x85030001,0x85030001 or AREXX_HostName,AREXX_HostName?
        0x093ada24,0x095352c8 or garbage,garbage
        0x000f4240,0x00000001 or garbage,garbage
        0x00000014,0x234be05 or garbage,garbage
        0x0230f2b7,0x0952488c or garbage,garbage
        0x099ad2f0,0x091b64b8 or garbage,garbage
        0x00000000 or TAG_DONE

NewObjectA() returns 0 (object creation failure?). This appears to be GCC having problems with tag lists again. ARexxClass is moved into A0 and A1 is cleared like this is a NewObjectA but then GCC seems to optimize away part of the tag list creation.

I'm going to try the new archive now as we can see that your version of GCC has a bug with tag lists.

Wtih the second archive, I'm still getting the ami_file_req_init() byte read from address 0 as described above. I then get to the screen mode requestor. I've tried a 32 bit little endian and big endian screen mode which both opened and some of the visuals were displayed before the system froze. MuForce recorded a long read from 0x12 buried (probably several functions) deep in intutition.library. This is going to be tricky to debug.
« Last Edit: January 28, 2015, 04:21:11 AM by matthey »
 

Offline chris

Re: We need an iBrowse replacement for 68k!!!
« Reply #292 on: January 28, 2015, 09:53:58 AM »
Quote from: matthey;782473
GCCFindHit did not work for me either so I assume that it doesn't have the debug info it needs. It should say in the docs for GCCFindHit how it needs to be compiled. I have used GCCFindHit before with success.


Quote from: gccfindhit.readme
GccFindHit understands the stabs from the aout format encapsulated in
the debug hunk of the AmigaOS executable, so it will work as long as
ld outputs its debug information this way.


Utter gibberish.  However I have found another mention that compiling with simply -g is all it needs, so I'll try that.

Quote

The first hit (byte read from 0) comes from the locale.library patch of Stricmp() in the utility.library. This is called from the asl.library which is called from NetSurf in ami_file_req_init() of amiga/file.c. The problem occurs in the second AllocAslRequest(). It looks like D0=ASL_FileRequest=0 which is correct and A0 points at the tag list which is:

Code: [Select]

A0-> 0x8008002c,0x00000001 or ASLFR_DoSaveMode,TRUE
        0x8008003c,0x00000001 or ASLFR_RejectIcons,TRUE
        0x80080009,0x00000000 or ASLFR_InitialDrawer,NULL
        0x00000000 or TAG_DONE


The code does move your nsopt_charp to the tag list:

Code: [Select]

   move.l _nsoptions,a0
   move.l ($73c,a0),(-8,a5)


I believe GCC is creating the tags correctly here but a NULL pointer is moved to the data for the ASLFR_InitialDrawer tag item.


Yes, that option will be NULL by default.  This should be easy to fix.

Quote

Wtih the second archive, I'm still getting the ami_file_req_init() byte read from address 0 as described above. I then get to the screen mode requestor. I've tried a 32 bit little endian and big endian screen mode which both opened and some of the visuals were displayed before the system froze. MuForce recorded a long read from 0x12 buried (probably several functions) deep in intutition.library. This is going to be tricky to debug.


If you can track it down that will be really helpful.  Make sure it isn't just an assertion though - they usually result in everything freezing.  NetSurf will show "assertion failed" in the debug output if it is.
"Miracles we do at once, the impossible takes a little longer" - AJS on Hyperion
Avatar picture is Tabitha by Eric W Schwartz
 

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show only replies by matthey
Re: We need an iBrowse replacement for 68k!!!
« Reply #293 on: January 28, 2015, 02:25:53 PM »
Quote from: chris;782486

If you can track it down that will be really helpful.  Make sure it isn't just an assertion though - they usually result in everything freezing.  NetSurf will show "assertion failed" in the debug output if it is.


I was able to debug past opening the screen and the window which are stable despite the minor text corruption. There was a call to hlcache_handle_retrieve() the function before the freeze which I did not step into. Maybe the freeze is from an assert but I still get the long read from 0x12 deep in intuition. I have BDebug set to stop on MuForce hits which it does on the first but hit on this one. I'll try once more paying better attention to the debug output and try stepping into that minor looking function.
 

Offline wawrzon

Re: We need an iBrowse replacement for 68k!!!
« Reply #294 on: January 28, 2015, 05:01:35 PM »
are the changes so far commited to the source available from netsurf site? i would like to try to setup build environment for 68k target once again.
 

Offline matthey

  • Hero Member
  • *****
  • Join Date: Aug 2007
  • Posts: 1294
    • Show only replies by matthey
Re: We need an iBrowse replacement for 68k!!!
« Reply #295 on: January 28, 2015, 09:57:58 PM »
It looks like the freeze is from intuition.library OffMenu() where A0=Window=0x09f20374 and D0=MenuNumber=0x00000100 (AMI_MENU_CLOSE_TAB?). There must have been several inlined functions without symbols so I can't tell the exact location. I was stepping along in browser_window_navigate() of /desptop/browser.c. Toward the end of browser_window_navigate, hlcache_handle_retrieve() is called returning error=0 (NSERROR_OK?). It looks like browser_window_start_throbber() is called without a problem and then we call browser_window_refresh_url_bar_internal(). Somewhere along in hear there was a call to RefreshSetGadgetAttrs() and RefreshSetGadgetAttrsA() and then the OffMenu(). It makes sense with the deep intuition hit that there is a bad pointer (probably a NULL pointer accessing offset 0x12 of some structure). The last debug entry I received was:

Code: [Select]
desktop/browser.c browser_window_navigate 1994: Loading 'about:welcome'

The freeze was a long time after the last message though. If you can't figure out which OffMenu() then I can get back fairly close easily. Too bad that GCCFindHit is not working or I could probably tell you the exact source line. Let me know if you need more info.

Edit: If I am correct that OffMenu() is using AMI_MENU_CLOSETAB, then the function calling OffMenu() which freezes would be ami_update_buttons() in /amiga/gui.c. This makes sense as I don't get a symbol (no function name to see) for "static" functions. Do I win a new build of NetSurf?
« Last Edit: January 29, 2015, 12:02:46 AM by matthey »
 

Offline chris

Re: We need an iBrowse replacement for 68k!!!
« Reply #296 on: January 28, 2015, 11:46:34 PM »
Quote from: matthey;782524
It looks like the freeze is from intuition.library OffMenu()

Ah!  That would make sense as the window doesn't have any menus attached at the moment.

Should be fixed now along with the ASLFR_InitialDrawer hit, thanks.
"Miracles we do at once, the impossible takes a little longer" - AJS on Hyperion
Avatar picture is Tabitha by Eric W Schwartz
 

Offline chris

Re: We need an iBrowse replacement for 68k!!!
« Reply #297 on: January 28, 2015, 11:47:22 PM »
Quote from: wawrzon;782505
are the changes so far commited to the source available from netsurf site? i would like to try to setup build environment for 68k target once again.

Yes, I'm commiting everything direct to trunk as I see no reason not to.
"Miracles we do at once, the impossible takes a little longer" - AJS on Hyperion
Avatar picture is Tabitha by Eric W Schwartz
 

Offline wawrzon

Re: We need an iBrowse replacement for 68k!!!
« Reply #298 on: January 28, 2015, 11:49:35 PM »
Quote from: chris;782531
Ah!  That would make sense as the window doesn't have any menus attached at the moment.

Should be fixed now along with the ASLFR_InitialDrawer hit, thanks.


sounds like multi platforms support is helping to fix bugs while getting along;)
 

Offline wawrzon

Re: We need an iBrowse replacement for 68k!!!
« Reply #299 from previous page: January 28, 2015, 11:50:08 PM »
Quote from: chris;782532
Yes, I'm commiting everything direct to trunk as I see no reason not to.


thats a good attitude.

i have checked out the current netsurf source out of git repository, but i lack makefile.config for amiga-m68k target. also there is actually only amiga fronend source, is this supposed to work for both targets together? so, like in when i compile the source for ppc i get os4 binaries and when i compile for m68k i get amiga binaries? if so, i have an aros68k gcc4.6.4 installed in my opt dir. this backend produces elf files, but i can elf2hunk them, otherwise the aros binaries should run on amiga if they are not linked against static or dynamic aros libs.

so.. crosscompiling it on debian im currently caught with libutf8proc dependency. ive compiled it and put in usr/lib without success...