vpdf

watto · 11406

watto

  • Newbie
  • *
    • Posts: 16
    • Karma: +0/-0
Reply #45 on: June 04, 2019, 11:34:59 AM
@wawa Very sorry, I've become rather busy again and I appear to have lost my VM somewhere...  I am just now trying to pick things up again as it has been a couple months since I've had a bit of free time to look at this.

Did you grab my code from github? https://github.com/wattoc/AROS-vpdf

There were a couple issues remaining and I think last time I looked I was trying to get a 64-bit environment up and going.  The main thing missing now as far as I remember is a set of buttons to toggle view mode.  Otherwise I think I have got most of the things in that list fixed other than the MUI size issue which is probably better dealt with at the source.

The plan was to grab a copy of the latest tree and then merge my changes in to that carefully - I had spent some time trying to ditch some of the debugging code, etc and get things as close to the original as possible.  I think the biggest code issue would be the hacks I made to deal with namespace problems, most of the other code is really MUI specific and should hopefully port over fairly cleanly but could do with some more IFDEFS, and so on, so we are not too far from the original.

Please drop me a message on here or an email if you think I can help.  I probably won't have time to spare to hang about on slack for quite a while unfortunately, but I'll see what I can do.



wawa

  • Senior Member
  • ****
    • Posts: 265
    • Karma: +55/-0
Reply #46 on: June 06, 2019, 01:41:37 AM
@watto
you have pm, in case you havent noticed. ill apply (a choice of) your changes soon into my aros fork and test. i can hopefully distinguis between mui chanes, intermediate debug and fontconfig related stuff.

 



watto

  • Newbie
  • *
    • Posts: 16
    • Karma: +0/-0
Reply #47 on: June 06, 2019, 12:27:33 PM
@wawa - I did reply to your message, or at least I thought I did.  Summary of it is below:

I have 64-bit up and running on my VM that I had lost, and it will need merged with your code as there are quite a few pointer cast issues in mine as expected.

I think the best process would be to get things merged in and running, then we can look at adding in any remaining missing features.

I'm happy to work with you on this, it sounds like we are probably doing similar things right now.  If you manage to get something up and going in the meantime please let me know and I'll try to progress things further from there.  I'd still like to finish it, it's just a question of how much time and energy my day job takes from me :)

The main thing will be how compatible with the existing source we want to be, ideally most of my changes can be ifdef'd in to the existing code.  Since it was WIP there are probably quite a few hacky bits where I have just inserted or deleted bits of code which I would prefer are fixed properly, but I'm not sure where the team stands on this sort of thing.



wawa

  • Senior Member
  • ****
    • Posts: 265
    • Karma: +55/-0
Reply #48 on: June 08, 2019, 04:56:23 AM
hm. i dont see any pm from you in my box. so the forum remains. ill be trying to merg your changes one by one, but need to take care of pretty unrewarding daily tasks.



wawa

  • Senior Member
  • ****
    • Posts: 265
    • Karma: +55/-0
Reply #49 on: June 08, 2019, 05:06:41 AM
one of the questions, shouldnt we keep the code also morphos compliant since i see you have removed
#include "GlobalParamsMorphOS.cc" from GlobalParams.cc
maybe every platform could include their solution at this point?



wawa

  • Senior Member
  • ****
    • Posts: 265
    • Karma: +55/-0
Reply #50 on: June 08, 2019, 05:18:58 AM
Code: [Select]
/home/wawa/AROS-git/AROS/contrib/vpdf/poppler/poppler/GlobalParams.cc:127:6: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
  127 |     {"Courier",               "n022003l.pfb", "cour.ttf"},
      |      ^~~~~~~~~
/home/wawa/AROS-git/AROS/contrib/vpdf/poppler/poppler/GlobalParams.cc:127:31: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
  127 |     {"Courier",               "n022003l.pfb", "cour.ttf"},
      |                               ^~~~~~~~~~~~~~
....




wawa

  • Senior Member
  • ****
    • Posts: 265
    • Karma: +55/-0
Reply #51 on: June 08, 2019, 06:33:32 AM
i have silenced the above complaints for convenience.

@watto
so far i have merged in your fontconfig changes, save some debug and a bit of formatting, beacuse i didnt wanted to mess with poppler inrternals too much as it aint our code, right? so i thought it would be ideal to outsource it to a separate source file as morphos team did just to keep our diffs maintainable in case we wanted to upgrade to never code.

so far the fontconfig problems on i386 went away and it displays the test files. the mui interface is of course still borked, as im going to merge it in later after i reviewed the changes and perhaps keep it in separate commits.

for now i need to compile few other targets.



wawa

  • Senior Member
  • ****
    • Posts: 265
    • Karma: +55/-0
Reply #52 on: June 09, 2019, 06:03:15 AM
@watto:
what causes crashes on x86_64 is, first of all

line 124 in printer.c:
Code: [Select]
Child, (IPTR) RawimageObject, MUIA_Rawimage_Data, (IPTR) Printer, End,
and then subsequently:

line 544 in application.c:
Code: [Select]
ASLFR_InitialFile, msg->initialfile ? msg->initialfile : msg->initialpath ? (char*)FilePart(msg->initialpath) : (char*)"",

with these commented out vpdf opens on x86_64 but then still fails to load test file:

Code: [Select]
...
[Process.mui] my_process called
[Process.mui::my_process] data 00000000443a6990 sourceclass 0000000044361080 sourceobject 00000000443612b8
[Process.mui] my_process called
[Process.mui::my_process] data 00000000443a6a70 sourceclass 00000000435f13a0 sourceobject 00000000442527e8
[Listtree] OM_NEW: unhandled 80004001
[MUIM_Process_Signal] sigs 8192
[convertUTF32ToANSI] not implemented
[Pageview::Hide] not implemented
cleanup:1
[Pageview::Hide] not implemented
cleanup:1
[KRN] Trap signal 11, SysBase 0000000042f3d820, KernelBase 0000000042f3ea08
    RSP=00000000439a5fa8  RBP=00000000439a6010  RIP=0000000043ae4980
    RAX=0000000043ae4980  RBX=000000004422d0d0  RCX=0000000000000000  RDX=0000000000000000
    RDI=0000000000000000  RSI=0000000000000000  RFLAGS=0000000000010246
    R8 =00000000446d1850  R9 =0000000000000000  R10=0000000000000002  R11=0000000000000000
    R12=0000000000000000  R13=0000000000000000  R14=0000000043a5bfb0  R15=fffffffffffffff8
*** Logged alert:
Program failed
Task : 0x00000000435F14E0 - System:Extras/Utilities/Text/VPDF/VPDF
Error: 0x80000002 - Hardware bus fault/address error
PC   : 0x0000000043AE4980
Module VPDF Segment 1385 .text (0x0000000043A3EAE0) Offset 0x00000000000A5EA0
Function _ZN4Page9getAnnotsEP4XRef (0x0000000043AE4980) Offset 0x0000000000000000
CPU context:
RAX=0000000043AE4980  RBX=000000004422D0D0  RCX=0000000000000000  RDX=0000000000000000
RSI=0000000000000000  RDI=0000000000000000  RSP=00000000439A5FA8  RBP=00000000439A6010
R8 =00000000446D1850  R9 =0000000000000000  R10=0000000000000002  R11=0000000000000000
R12=0000000000000000  R13=0000000000000000  R14=0000000043A5BFB0  R15=FFFFFFFFFFFFFFF8
RIP=0000000043AE4980  RSP=00000000439A5FA8  RFLAGS=0000000000010246
Stack trace:
0x0000000043A634B3 VPDF Segment 1385 .text + 0x00000000000249D3
0x0000000043A63ADD VPDF Segment 1385 .text + 0x0000000000024FFD
0x000000004366180E muimaster.library Segment 1 .text + 0x0000000000013D4E
0x0000000043663136 muimaster.library Segment 1 .text + 0x0000000000015676
0x0000000043664964 muimaster.library Function Application_Dispatcher + 0x0000000000000F64
0x0000000043A48757 VPDF Segment 1385 .text + 0x0000000000009C77
0x0000000043A4035B VPDF Function main + 0x0000000000000B7B
0x0000000043A3EC3D VPDF Segment 1385 .text + 0x000000000000015D
0x0000000043D7BCB5 VPDF Segment 1385 .text + 0x000000000033D1D5
0x0000000043D7C6AA VPDF Segment 1385 .text + 0x000000000033DBCA




wawa

  • Senior Member
  • ****
    • Posts: 265
    • Karma: +55/-0
Reply #53 on: June 09, 2019, 06:05:18 AM
im still  not sure if the above is vpdf or aros infrastructure itself at fault. have been debugging this (asl requester) but im too inexperienced to come to a conclusion.



watto

  • Newbie
  • *
    • Posts: 16
    • Karma: +0/-0
Reply #54 on: June 09, 2019, 08:47:01 AM
Is this work committed or just in your own workspace?



wawa

  • Senior Member
  • ****
    • Posts: 265
    • Karma: +55/-0
Reply #55 on: June 09, 2019, 09:39:33 AM
@watto:
i have a fork of aros contrib in my own repo:
https://github.com/wawatok/contrib/commits/vpdf-update
as you may see i just pushed the font stuff and made a pull request for the main aros github repo.

im just merging the mui stuff. ill see how it works and have eventually a small mostly rather formatting related diff for you, except replacing long with LONG type in few places.

also i have left out most of debug for now where i felt it may not be required afterwards.

however im not ready with mui just yet.



wawa

  • Senior Member
  • ****
    • Posts: 265
    • Karma: +55/-0
Reply #56 on: June 09, 2019, 10:52:48 AM
@watto
okay. merged in i think most of the mui changes. i have left out the codesets ifdef for aros in wincow.c. but it seems vpdf gui works now correctly what concerns tabs. at least at the firts glance.

the problems i reported above for x64 still remain open of course. and there is a lot of warnings when compiling which i have been attempting to fix in my local copy and i will provide you with an appropriate diff when merging in your code is complete.

btw, here is the crash that follows asl issue on x64:

Code: [Select]
[KRN] Trap signal 11, SysBase 0000000041a05820, KernelBase 0000000041a06a08
    RSP=000000004246d328  RBP=000000004246d380  RIP=0000000044b218a0
    RAX=0000000044b218a0  RBX=0000000041a51510  RCX=0000000041a51510  RDX=000000004246d630
    RDI=0000000043088b20  RSI=0000000000000001  RFLAGS=0000000000010202
    R8 =000000004246d2b0  R9 =0000000041a05820  R10=0000000000000000  R11=0000000000000001
    R12=0000000042222f18  R13=0000000041aa5c40  R14=000000004246d400  R15=0000000042222f98
*** Logged alert:
Program failed
Task : 0x00000000420B2420 - System:Extras/Utilities/Text/VPDF/VPDF
Error: 0x80000002 - Hardware bus fault/address error
PC   : 0x0000000044B218A0
Module intuition.library Segment 1 .text (0x0000000044AEB7A0) Offset 0x0000000000036100
Function strcpy (0x0000000044B218A0) Offset 0x0000000000000000
CPU context:
RAX=0000000044B218A0  RBX=0000000041A51510  RCX=0000000041A51510  RDX=000000004246D630
RSI=0000000000000001  RDI=0000000043088B20  RSP=000000004246D328  RBP=000000004246D380
R8 =000000004246D2B0  R9 =0000000041A05820  R10=0000000000000000  R11=0000000000000001
R12=0000000042222F18  R13=0000000041AA5C40  R14=000000004246D400  R15=0000000042222F98
RIP=0000000044B218A0  RSP=000000004246D328  RFLAGS=0000000000010202
Stack trace:
0x00000000421BA11A asl.library Function AslString__OM_NEW + 0x000000000000004A
0x0000000044AF495B intuition.library Function Intuition_106_NewObjectA + 0x000000000000007B
0x00000000421AC2AB asl.library Segment 1 .text + 0x00000000000066EB
0x00000000421AD067 asl.library Function FRGadgetryHook + 0x0000000000000087
0x00000000421A7080 asl.library Function Asl_10_AslRequest + 0x0000000000000130
0x000000004257BD8A VPDF Segment 1385 .text + 0x0000000000004C9A
0x000000004257F1C9 VPDF Segment 1385 .text + 0x00000000000080D9
0x0000000042581782 VPDF Segment 1385 .text + 0x000000000000A692
0x000000004257E1C5 VPDF Segment 1385 .text + 0x00000000000070D5
0x00000000425816A4 VPDF Segment 1385 .text + 0x000000000000A5B4




wawa

  • Senior Member
  • ****
    • Posts: 265
    • Karma: +55/-0
Reply #57 on: June 09, 2019, 10:59:12 AM
@watto

here are my mostly cosmetic proposals for your consideration, however there might be some type corrections and the like.



wawa

  • Senior Member
  • ****
    • Posts: 265
    • Karma: +55/-0
Reply #58 on: June 09, 2019, 11:08:46 AM
because it may not hurt i also attach the 64bit fix proposals diff.
note that im not a coder so this needs a proper review.



wawa

  • Senior Member
  • ****
    • Posts: 265
    • Karma: +55/-0
Reply #59 on: June 09, 2019, 11:09:43 AM
i think ill commit and push the mui updates now to my repo.