[SOLVED] Snap2 under different versions of gtkdialog

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#16 Post by thunor »

peebee wrote:...
Made the changes you suggested - did not change behaviour on Upup Precise 54x4......still warning and not possible to select tab#1
...
I've been studying the snap2 code and this is how I think it works:

There's a big while loop at line 249 which looks as though it envelopes the entire application and this is used to restart it. When the main dialog exits, its output is evaluated and if you haven't supplied some necessary information then you'll get a warning in a message box, a variable called maintab will be set to something and then it goes back to the top of the while loop and runs again which will present the tab associated with the widget that you must enter data into.

You should see the main dialog first (line 659), then the message box (line 1288) and then the main dialog restarts showing the BACKUP STORAGE tab. Well, that's under normal operation if the conditions are met at line 1286 -- $dst = "none" or $dst = "". So, you're seeing the message box first, then the main dialog showing the BACKUP STORAGE tab (#2), then you click the DIRECTORIES TO BACK UP tab (#1) which causes the same message box to reappear (is the main dialog still open now or not?).

I'm going to guess that the execution of the main dialog at line 659 initially falied, but you can't tell because all of the output is being captured in a variable, evaluated and then discarded and because it didn't run, there's no valid output to evaluate so $dst = "none" or $dst = "" causes the messsage box to appear. Then we go back to the top of the while loop and do it again but this time the main dialog does appear and then I don't know after that. There's a possibility that something on the DIRECTORIES TO BACK UP tab (#1) is causing it to crash but this isn't activated when the application restarts showing the BACKUP STORAGE tab (#2) which is why you can see it. Sherlock Holmes: eat my deerstalker :P

I recommend that above the code that invokes the main dialog (line 659) you should simply try $GTKDIALOG --program=MAIN_DIALOG; exit and then dump the output here. You'll want to put this underneath the debugging message #echo "$MAIN_DIALOG" which is at line 655.

Regards,
Thunor
Last edited by thunor on Wed 12 Dec 2012, 15:22, edited 2 times in total.

User avatar
peebee
Posts: 4370
Joined: Sun 21 Sep 2008, 12:31
Location: Worcestershire, UK
Contact:

#17 Post by peebee »

Hi Thunor & Pemasu

I'll try the above shortly and report the results...

In the meantime I've tried a regression of gtkdialog in Upup Precise 54x4 to an earlier version.

In doing so I have noticed that Upup Precise has a different code structure to BK's Precise 5.4.2...

Precise 5.4.2 has "real" gtkdialog3 and gtkdialog4 with gtkdialog being a symlink to gtkdialog4

Upup Precise 54x4 has a "real" gtkdialog with gtkdialog3 and gtkdialg4 being symlinked to it.

My test consisted of replacing all of gtkdialog, -3 and -4 with the Precise 5..4.2 components.

With this change - Snap2 works as expected.

Back soon.
Cheers
peebee
ImageLxPup = Puppy + LXDE
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64

User avatar
peebee
Posts: 4370
Joined: Sun 21 Sep 2008, 12:31
Location: Worcestershire, UK
Contact:

#18 Post by peebee »

Back with testing results.....on Upup Precise 54x4

Inserting the line suggested by Thunor into snap2 and then running in a terminal gives:

Code: Select all

# snap2
/usr/bin/snap2: line 1511: 17541 Segmentation fault      $GTKDIALOG --program=MAIN_DIALOG
# 
This is with the edited version of snap2 with Thunor's previously advised changes.

Line 1511 is the final line in the file - "done"

Cheers
peebee
ImageLxPup = Puppy + LXDE
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#19 Post by thunor »

Great, well, good and bad at the same time :)

Same again please, but use this line instead:

Code: Select all

$GTKDIALOG -v; echo "$MAIN_DIALOG" > /tmp/snap2_MAIN_DIALOG; $GTKDIALOG --program=MAIN_DIALOG; exit
Show the output of that line, gzip /tmp/snap2_MAIN_DIALOG and attach it.

Thank you.

User avatar
peebee
Posts: 4370
Joined: Sun 21 Sep 2008, 12:31
Location: Worcestershire, UK
Contact:

#20 Post by peebee »

thunor wrote:Show the output of that line, gzip /tmp/snap2_MAIN_DIALOG and attach it.

Code: Select all

# snap2
gtkdialog version 0.8.3 r473M (C) 2003-2007 Laszlo Pere, 2011-2012 Thunor
Built with additional support for: Glade.
/usr/bin/snap2: line 1511: 17738 Segmentation fault      $GTKDIALOG --program=MAIN_DIALOG
# 
Attachments
snap2_MAIN_DIALOG.gz
(3.35 KiB) Downloaded 454 times
ImageLxPup = Puppy + LXDE
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#21 Post by thunor »

Thanks peebee.

I tried gtkdialog -f ./snap2_MAIN_DIALOG in Upup Precise 54x4 with gtkdialog version 0.8.3 r493 and it loaded ok for me.

Leave it with me for a while. It would be useful if you could checkout, compile and install the latest gtkdialog from SVN (I explained how to do it earlier). Locate the current gtkdialog binary (/usr/sbin/gtkdialog?) and copy the newly compiled one onto it, then run snap2 again and see if it works. I don't need any more output now.

If it's ok, I'll make you a special version of gtkdialog which you can try later on.

We're getting there :)

Regards,
Thunor

User avatar
peebee
Posts: 4370
Joined: Sun 21 Sep 2008, 12:31
Location: Worcestershire, UK
Contact:

#22 Post by peebee »

thunor wrote:It would be useful if you could checkout, compile and install the latest gtkdialog from SVN (I explained how to do it earlier). Locate the current gtkdialog binary (/usr/sbin/gtkdialog?) and copy the newly compiled one onto it, then run snap2 again and see if it works.
Hi Thunor

Bullet bitten.....
devx downloaded....
Runes completed to checkout and compile latest gtkdialog....
Replaced / upgraded gtkdialog in Upup Precise 54x4

Installed and ran Snap2 - and IT WORKS as expected!!

Thanks for all your help....
I'll report in the Snap2 thread the results....and point lstandish to the improvements you have suggested along the way.

Cheers
peebee
ImageLxPup = Puppy + LXDE
Main version used daily: LxPupSc; Assembler of UPups, ScPup & ScPup64, LxPup, LxPupSc & LxPupSc64

User avatar
thunor
Posts: 350
Joined: Thu 14 Oct 2010, 15:24
Location: Minas Tirith, in the Pelennor Fields fighting the Easterlings
Contact:

#23 Post by thunor »

peebee wrote:...
Installed and ran Snap2 - and IT WORKS as expected!!

Thanks for all your help....
I'll report in the Snap2 thread the results....and point lstandish to the improvements you have suggested along the way.
...
Cheers for your help and it's good that it works.

Via the magic of SVN revision logs I've got a good idea what that was:

November 16th r472 I connected-up the realize signal since it was half way there anyway but I experienced an instability later on because something was NULL that I wasn't expecting so I fixed it on November 30th r483, therefore I would recommend that if somebody has a version of gtkdialog that is r472 to r482 inclusive then they might want to consider upgrading to the latest version.

I'm all done with adding features to gtkdialog for the moment and am only hanging around making sure any potential problems are resolved, so what's in SVN now (r493) is pretty much what the next source package release is going to be.

You might want to explain to lstandish that I recommend adding the " | grep =" to the end of the seven lines of code where gtkdialog is executed so that he is only evaluating the printed variables. He could also either fix the warnings or discard them by following gtkdialog with " 2> /dev/null" or not worry about it since " | grep =" will filter them out anyway.

Good stuff :)

Kindest regards,
Thunor

Post Reply