LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > rainbowsally
User Name
Password

Notices


Rate this Entry

Misadventures In Computer Mad Science

Posted 05-11-2012 at 06:25 AM by rainbowsally
Updated 05-11-2012 at 06:29 AM by rainbowsally

Misadventures In Computer Mad Science

A friend of mine once told me that I'm the worst programmer he knew. And that's probably right. What do you expect from someone who's first programming love was Forth (ZX-81 and Co-Co).

So I always encourage folks to see what is going on and perhaps rework or clean up my messes if they can see a better way to do things.

Features:
  • Half a paragraph from the GPL v.3

See highlights near the bottom if you're not interested in my disconnected mood swings today. :-)

This is going to be about 'configure' being (shock!) 'dangerous' and also about open source and GPL violations by major linux distros.

No code toys to play with this time.

---------------

Misadventure 1 was trying to download gcc sources from opensuse. Looks like now that the d/load page is back up, it's still as messed up as ever.

But this next misadventure... Well.... it was at least kinda exciting for me, if not for you. ;-)

I made a debug version of libstdc++ and libsupc++ to try to find a better way to catch segfaults in try-catch blocks. (Currently using a jmp_buf to reset the registers ... it's a long story.)

But though I could trace the stdc++ calls (req's patience due to the numerous 'throws()' in stuff like malloc() and many other subfunctions that trigger a trap signal that I also handled with a simple 'return') the problem was that the good stuff was not in libstdc++ itself, but was still invisible to me.

Here's where the real misadventure starts.

Got the sources for gcc from somewhere I fergit now but though it was missing stdc++ the versions were compatible and...

So I also created a debug version of gcc.

Unbeknownst to myself at the time, I set up the prefix wrong in the configuration. I intended to go into /opt/gcc-dbg but the configurator script I created hadn't correctly defined DBGPREFIX so in the configuration...

confurator script excerpt:
Code:
./configure \
  --prefix=$DBGPREFIX \
  <other config stuff> \
  ##########
The config thought I wanted it all to to into / due to DBGPREFIX not having been defined in the script.

Woopsie. :-)

[I use scripts to run 'configure' because these things take so long to compile, I need to leave a trail of beans to see what doesn't work -- because sometimes they choke at the last step, sometimes hours later if it's a large build.]

Fortunately, gcc takes a LONG time to compile. The way I discovered this problem was by using 'find -cmin <time-offset>'.

So I was able to find the dirs and files that were misplaced so that I could 'uninstall' them (at least) using a new.make makefile. And since opensuse is rpm-based, I I attempted to launched yast before the libs disappeared.

Worked. whew! Much easier than typing in unknown rpm filenames. And here's one of the main reasons I use opensuse despite it's TERRIBLE maintenance of its source repositories -- a tradition that continues into their 12.x development, unfortunately. (SEE GPL V. 3 PARAG AT THE BOTTOM.)

In Yast, before uninstalling the misplaced files (see below), I set yast to update unconditionally from sources on my DVD (one reason I like open suse) and do this to 'all in this list' (another reason I like it), where the list was the list of RPMS that contined the name 'gcc'.

And I left yast open one desktop as I went to collect the lists of files to uninstall using 'find'.

But not being a high functioning day for me already, after manually moving the obvious errors like /include and /share (and /info ???) directories into the /opt/gcc-dbg folder in preparation for 'importing' the files using new-make, I copied my 'find -cmin' output into a files.dat file. (Should have been links.dat for an virgin import so that all file attributes are preserved and symlinks in the list don't get copied as the binaries).

Once all the newer files were in a dat file, however, I could 'make uninstall' though the TREE ended up being useless.

And then I hit the "accept" button in yast on the other desktop to reinstall anything I might clobbered in this process.

Then to see if I needed to restore my entire system from backups, since this is very low level stuff that would require 4 gigs of backups to get running again, I held my breath and rebooted.

Lucky me. Booted fine.

Now here's what I want to say.

The problem was the 'configure' not the new-make. In fact new-make (and possibly yast) saved me from another "lesson" in exercising caution.

Yes 'new-make' is dangerous when used on root system files. But so is 'configure'. And as it turns out gcc doesn't even have an 'uninstall' target in the makefile, though it's preset to a default installation into /usr/local. (?)

Let me say this again, though, because if I had had to restore from backups, it would have taken 12 minutes to get back to a basic running kde system and and I'd only have lost a few files I could easily restore from new-make packages an rpms listed in a package list exported in yast, which are ALL from the installation DVD (and this is yet another reason I like opensuse 11.4).

So... KEEP BACKUPS YOU CAN LIVE WITH. This includes lists of packages you may have installed. And DON'T LOSE YOUR HOME FOLDER, which is not a problem if you just rename it and move it back after restoring from a tarball (which is how I do it, so I don't have to rely on anyone else's sometimes cray-zee assumptions).

And don't freak out right away when you have problems. This is linux, not Windows. Most problems are solvable, even nasty problems like installing a test versions of system files into the wrong folders, including /lib and /bin, which I did in this misadventure. Twice actually!

It does help if you have the tools though. And although the file list was really all that was necessary for uninstalling the bogus installation (just rm -f $(<files.dat) you can avoid sudden heart attacks if you make sure you know how to use your distro's rescue system (not as easy as you might think) or get a good rescue CD or (if you can still boot into anything at all) keep an older linux in a partition you can get into quickly to make corrections easily by simply selecting an alternate linux at the boot menu.

And on that last point...

That is IF your distro supports the older linux. Kubuntu doesn't. OpenSUSE does. So this is yet another reason I use opensuse 11.4 but I don't dare try 12.x, however, because they seem to be following the Gnome/KDE herd over a cliff -- treating our systems like their own personal remote-controlled property and creating a breed of "most normal users" that will NEVER find their own way around.

Let's cap off this tirade with a word from the free software foundation.

This is from the GPL v. 3, starting at line 50 and my heart sang when I saw it:


Code:
  Some devices are designed to deny users access to install or run
  modified versions of the software inside them, although the manufacturer
  can do so.  This is fundamentally incompatible with the aim of
  protecting users' freedom to change the software.  The systematic
  pattern of such abuse occurs in the area of products for individuals to
  use, which is precisely where it is most unacceptable.


"Precisely where it is most unacceptable?" Did I read that right?

But "Systematic"?

And "Devices"?

Doesn't that sound a bit... um... paranoid?

Download gcc at opensuse. 10K. That's some pretty tight compression, eh? About 40 thousand to one. But how do they get 400 megs into a 10K archive? And gcc is also GPL v. 3. Some time ago, when I tried to download libffi from opensuse which was touted as 'standard' sources for opensuse 11.4 it was 60 Megs and was (of all things)GCC. Not libffi. Other files I've attempted to download from them were missing content, had bad headers, or unexpected end of files, and of those that did contain data, many or even most of them appeared to install in the wrong folders. I'd estimate (from my experience) that approximately 2/3rds of the ALLEGED sources are NOT even what's in our systems.

So then what is?

Do you know the developers' names? Their social security numbers, their bank account numbers?

Do they know yours?

Got kde? Hit ctrl-esc and set ksysguard to sort by pids. What is PackageKit doing? Playing dodgball with hackers? Is that now the high standard of safety they have adopted? Or is it worse. What is package kit doing behind your back. See /etc/PackageKit. (You can just rename the config in that folder to shut that infernal pid-sucker off.)

Thanks for the blog, LQ. :-) And thanks to QT for putting their code under version 3, so even kde, kubuntu, and opensuse are legally obligated to get their acts together. But so far, it appears that opensuse is systematically repeating errors of the 11.x development and aappear to be deliberately indifferent to my requests I sent in their "contact us" link at their forums, which I am forced to use since I have been banned for posts like these at their forums.

[Truce would have been easy and still could be. All opensuse needs to do is honor their legal obligations. And a big thank you to the free software foundation for GPL version 3.]
Posted in Uncategorized
Views 669 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 07:23 PM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration