Post Reply 
[SOLVED] 50g library appearing twice in LIB menu
06-20-2014, 03:39 PM (This post was last modified: 06-21-2014 07:22 PM by HP67.)
Post: #1
[SOLVED] 50g library appearing twice in LIB menu
This is a weird one. I was able to crash the calculator a few times today by entering an equation and trying to plot it. Eventually I figured out what was wrong about the equation (not that it should be able to crash the calc) and it plots ok.

Unrelated or not, after ON A-F to make sure things were back to normal and restoring from a backup, now the LIB menu is showing one library twice- but only when I am in a certain directory! If I am in HOME or most/all other directories the LIB menu shows the library once. If I go into SETTINGS (a directory where I save, you guessed it- settings) then the LIB menu shows one of my libraries twice! I do not believe it used to work that way before I crashed the calculator. I'm nigh certain it didn't, because this library needs variables from the SETTINGS directory to work properly, and I always used it that way.

In the course of testing this, I also purged the libraries, restarted, did new CRLIB on my few libraries and saved them again in port 0, then rebooted. Problem does not go away.

Does anybody have a good explanation for this? Thank you!

It ain't OVER 'till it's 2 PICK
Find all posts by this user
Quote this message in a reply
06-21-2014, 02:02 AM
Post: #2
RE: 50g library appearing twice in LIB menu
(06-20-2014 03:39 PM)HP67 Wrote:  Does anybody have a good explanation for this? Thank you!

No explanation, but I'm wondering if you see two entries if you execute PVARS for the port that it's installed in when your SETTINGS dir is active.

Is it possible that the lib in question is installed in 2 different ports, and one of them is attached to the SETTINGS directory instead of HOME? I'm not sure that is even possible, and I can't try it at the moment. Just a thought.
Find all posts by this user
Quote this message in a reply
06-21-2014, 03:06 AM
Post: #3
RE: 50g library appearing twice in LIB menu
(06-20-2014 03:39 PM)HP67 Wrote:  This is a weird one. I was able to crash the calculator a few times today by entering an equation and trying to plot it. Eventually I figured out what was wrong about the equation (not that it should be able to crash the calc) and it plots ok.

Unrelated or not, after ON A-F to make sure things were back to normal and restoring from a backup, now the LIB menu is showing one library twice- but only when I am in a certain directory! If I am in HOME or most/all other directories the LIB menu shows the library once. If I go into SETTINGS (a directory where I save, you guessed it- settings) then the LIB menu shows one of my libraries twice! I do not believe it used to work that way before I crashed the calculator. I'm nigh certain it didn't, because this library needs variables from the SETTINGS directory to work properly, and I always used it that way.

In the course of testing this, I also purged the libraries, restarted, did new CRLIB on my few libraries and saved them again in port 0, then rebooted. Problem does not go away.

Does anybody have a good explanation for this? Thank you!

Very strange, I would be happy to test whether I can reproduce those symptoms with your backups and libraries, if you don't mind sharing the files.

Jacob
Visit this user's website Find all posts by this user
Quote this message in a reply
06-21-2014, 04:30 AM
Post: #4
RE: 50g library appearing twice in LIB menu
(06-20-2014 03:39 PM)HP67 Wrote:  ... Unrelated or not, after ON A-F to make sure things were back to normal and restoring from a backup, now the LIB menu is showing one library twice- but only when I am in a certain directory! If I am in HOME or most/all other directories the LIB menu shows the library once. If I go into SETTINGS (a directory where I save, you guessed it- settings) then the LIB menu shows one of my libraries twice! I do not believe it used to work that way before I crashed the calculator. I'm nigh certain it didn't, because this library needs variables from the SETTINGS directory to work properly, and I always used it that way.

The library might be attached to both HOME *and* your SETTINGS directory. To test this hypothesis, go into your SETTINGS directory, then DETACH the library. If my hypothesis is correct, then the library will now only appear once no matter what your path is, and it will still work when in the SETTINGS directory.

You may prefer to ATTACH the library ONLY to the SETTINGS directory, and DETACH it from HOME. That way it will only appear when you're in the SETTINGS directory.

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
06-21-2014, 06:48 PM (This post was last modified: 06-21-2014 06:50 PM by HP67.)
Post: #5
RE: 50g library appearing twice in LIB menu
(06-21-2014 02:02 AM)DavidM Wrote:  No explanation, but I'm wondering if you see two entries if you execute PVARS for the port that it's installed in when your SETTINGS dir is active.

No, I get exactly what I expect. The library appears only once.

(06-21-2014 02:02 AM)DavidM Wrote:  Is it possible that the lib in question is installed in 2 different ports, and one of them is attached to the SETTINGS directory instead of HOME? I'm not sure that is even possible, and I can't try it at the moment. Just a thought.

No, I checked 0: 1: and 2: and the library only appears in port 0.

(06-21-2014 03:06 AM)Jacob Wall Wrote:  Very strange, I would be happy to test whether I can reproduce those symptoms with your backups and libraries, if you don't mind sharing the files.

Thanks, I have more than one 50g but I was hoping it won't come to that! The rest are all in their packaging.

(06-21-2014 04:30 AM)Joe Horn Wrote:  The library might be attached to both HOME *and* your SETTINGS directory. To test this hypothesis, go into your SETTINGS directory, then DETACH the library. If my hypothesis is correct, then the library will now only appear once no matter what your path is, and it will still work when in the SETTINGS directory.The library might be attached to both HOME *and* your SETTINGS directory. To test this hypothesis, go into your SETTINGS directory, then DETACH the library. If my hypothesis is correct, then the library will now only appear once no matter what your path is, and it will still work when in the SETTINGS directory.

This seems to be it. I have no idea why. I made a point of doing the warmstart from HOME several times to check this (the libraries should all attach to HOME) but detaching from the SETTINGS directory does work. Now I am wondering if SETTINGS is a reserved name.

I just did the following:

Using the filer, I purged all libraries from port 0
Warmstart
All libraries cleared
I restored a backup from SD card
I checked the LIB menu, no libraries
I copied the libraries from SD card to port 0
Warmstart
LIB menu shows the libraries
Change to SETTINGS
LIB menu shows one library duplicated

I'm back to the original question. Why is the library attaching twice? (and should this even be possible?)

I did not want to attach the lib only to SETTINGS, because although several commands do need vars from SETTINGS, most don't.

I'm going to rename SETTINGS and try this again. And I will eventually change the global vars to port variables, because I never had the intention to have to change to SETTINGS to use the commands.

Thanks David, Jacob, Joe.

It ain't OVER 'till it's 2 PICK
Find all posts by this user
Quote this message in a reply
06-21-2014, 06:58 PM (This post was last modified: 06-21-2014 08:15 PM by HP67.)
Post: #6
RE: 50g library appearing twice in LIB menu
Copying SETTINGS to a new name was disappointing. The same problem happens in both directories. So, I suspect something hidden in the directory is corrupted.

I created a third new settings directory and saved the values manually. The library now shows up only once. Apparently when I crashed the calculator in the PLOT app the directory structure was corrupted.

Thanks guys. This is bad news and I have no confidence that my latest backup is ok, so I'll have to see what I'll lose by reverting to an earlier one.

This is a good argument for versioned backups. I didn't make enough of those and I've been writing a lot of code every day. Darnit, darnit, darnit. Sad

It ain't OVER 'till it's 2 PICK
Find all posts by this user
Quote this message in a reply
06-22-2014, 01:09 AM
Post: #7
RE: [SOLVED] 50g library appearing twice in LIB menu
(06-21-2014 06:48 PM)HP67 Wrote:  *clipped*
Now I am wondering if SETTINGS is a reserved name.
*clipped*

I don't see 'SETTINGS' listed in the 50G AUG as a reserved variable.

If you want a copy of my new 'XARCHIVE' program someone just gave me let me know, i'll send it over.
it does great at "1 button push" backup of the entire calculator to SD Smile

Thanks
~~~~8< Art >8~~~~

PS: Please post more 50G stuff :)
Find all posts by this user
Quote this message in a reply
06-22-2014, 01:54 AM
Post: #8
RE: [SOLVED] 50g library appearing twice in LIB menu
(06-21-2014 06:58 PM)HP67 Wrote:  Copying SETTINGS to a new name was disappointing. The same problem happens in both directories. So, I suspect something hidden in the directory is corrupted.

I created a third new settings directory and saved the values manually. The library now shows up only once. Apparently when I crashed the calculator in the PLOT app the directory structure was corrupted.

Thanks guys. This is bad news and I have no confidence that my latest backup is ok, so I'll have to see what I'll lose by reverting to an earlier one.

This is a good argument for versioned backups. I didn't make enough of those and I've been writing a lot of code every day. Darnit, darnit, darnit. Sad

You shouldn't assume the directory is corrupted so quickly. Libraries can be attached to subdirectories, so I don't see why you should automatically assume something bad happened to your variables. Just get into the subdirectory, DETACH and make a new backup. If you calc is not crashing when you read the values, then your data is likely not corrupted. Invalid objects normally crash the calculator (there's very few safeguards), so if you copied all your variables and everything is OK, then you're probably OK.
During the crash, the sysRPL ATTACH word might've been executed by accident right before the warmstart, so your subdirectory ended up with the library attached there in addition to HOME. But that's not so terrible, just detach and continue.
Since the attached library number is stored in the directory structure, when you copy the whole directory to another name the library goes with it, there's no black magic there.
When you copy individual variables to a new (different) directory, you are not copying the attached lib, hence you don't see the double LIB.
So far, it makes perfect sense to me. Weird things can happen during a crash, since "random code" got executed, but in this case I think you dodged the bullet.

Claudio
Find all posts by this user
Quote this message in a reply
06-22-2014, 05:05 AM
Post: #9
RE: [SOLVED] 50g library appearing twice in LIB menu
(06-21-2014 06:48 PM)HP67 Wrote:  
(06-21-2014 04:30 AM)Joe Horn Wrote:  The library might be attached to both HOME *and* your SETTINGS directory.

This seems to be it. I have no idea why. I made a point of doing the warmstart from HOME several times to check this (the libraries should all attach to HOME) but detaching from the SETTINGS directory does work. ...

Every directory (other than Home) has a dedicated space in it for storing ONE library ID which is ATTACHed to that directory. When you backup the directory, that information gets stored with the directory, and when you restore that directory, its attached library ID is still in there. Directory attachments are NOT removed by a warmstart; only Home attachments are. So just DETACH the library from that directory, then backup the directory. It will behave correctly henceforth, and the library will not appear twice in your lib menu.

<0|ɸ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
06-22-2014, 05:19 AM (This post was last modified: 06-22-2014 11:20 AM by HP67.)
Post: #10
RE: [SOLVED] 50g library appearing twice in LIB menu
Thanks Cosmic, Claudio and Joe. I understood from the doc you can attach a lib to one directory or to HOME, where it is accessible in all directories.

I'll test whether a library can be attached to more than one non-home dir as a result of copying with the filer. Update: yep, indeed it does. Claudio strikes again! Smile

I solved the problem for now by recreating the global vars manually in a new directory created manually, not by copying SETTINGS in the filer as I had been doing. This problem has gone away. But I am still not sure something else isn't still corrupted elsewhere. I would like to backup/restore from ASCII source code (created another thread on the forums because I cannot copy an ASCII directory from the computer to the calc). I believe that is more likely to result in a clean system than using my old binary backups.

Claudio, Joe, lots of good info in your posts. I am reading them over carefully again. Earlier I was still in shock! And probably missed some "minor" details in your explanations. Thanks for the help.

It ain't OVER 'till it's 2 PICK
Find all posts by this user
Quote this message in a reply
06-22-2014, 03:15 PM
Post: #11
RE: [SOLVED] 50g library appearing twice in LIB menu
Hello,

although that might be new for you, the answer is in this over 20 years old thread.
Library Trouble. What is the ATTACH/DETACH stuff?
(The 49g architecture has some minor differences and a severe bug – which I guess will never be fixed – but basically it is the same.)

Additionally "Introduction to Saturn Assembly Language (PDF) Third Edition" covers in chapter 57.8 the directory object and also explains the difference between the HOME directory and subdirectories and where the slot(s) for the attached libs are stored.


These will answer your question.

HTH,
Andreas

http://www.software49g.gmxhome.de
Visit this user's website Find all posts by this user
Quote this message in a reply
06-22-2014, 04:35 PM
Post: #12
RE: [SOLVED] 50g library appearing twice in LIB menu
Hi Andreas,

Can you please post the message ID for the usenet article? I don't use google.

Thanks for the reference to the book. I'm not sure I agree with the behavior but at least it's easy to understand why it works that way.

It ain't OVER 'till it's 2 PICK
Find all posts by this user
Quote this message in a reply
06-22-2014, 05:42 PM
Post: #13
RE: [SOLVED] 50g library appearing twice in LIB menu
(06-22-2014 04:35 PM)HP67 Wrote:  Hi Andreas,

Can you please post the message ID for the usenet article? I don't use google.

This is from hpcalc.org.

Greetings,
    Massimo

-+×÷ ↔ left is right and right is wrong
Visit this user's website Find all posts by this user
Quote this message in a reply
06-22-2014, 05:45 PM
Post: #14
RE: [SOLVED] 50g library appearing twice in LIB menu
Thanks, I had read that earlier. Good stuff.

It ain't OVER 'till it's 2 PICK
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 4 Guest(s)