Year 1993. A 21 year-old student at MIT named David LaMacchia set up a bulletin board system called "Cynosure." It generated a lot of traffic worldwide. People used this service to download software they wanted or upload what they had. It was online for about six weeks before being taken down by the authorities. Software companies claimed that they lost one million dollars from Cynosure. Federal grand jury charged LaMacchia with 'one count of conspiring with unknown persons to violate the wire-fraud statute'. What LaMacchia did wasn't criminal conduct under the Copyright Act. The infringement was not for the purpose of commercial advantage. So, the charge was dismissed . The lawmakers had not thought that someone might engage in these types of activities with a non-financial motive. In 1997, Congress closed this loophole with NET (No Electronic Theft) Act.
Wednesday, May 30, 2007
Sunday, May 27, 2007
No archives (*.a ) in Solaris anymore
While discussing static libraries in one of my previous posts, I commented that libm is provided as both dynamic library ( libm.so ) as well as static archive ( libm.a ).
Well, that is not true for Solaris anymore. Solaris 10 doesn't ship with a single static library.
Doing
ls -la |grep *.a
in /usr/lib where libraries are usually present returned no results. Tried in some more directories with same result.
I don't know when static libraries were dropped from Solaris. My guess is that it was Solaris 10, but any pointers to information would be welcome.
Well, that is not true for Solaris anymore. Solaris 10 doesn't ship with a single static library.
Doing
ls -la |grep *.a
in /usr/lib where libraries are usually present returned no results. Tried in some more directories with same result.
I don't know when static libraries were dropped from Solaris. My guess is that it was Solaris 10, but any pointers to information would be welcome.
FLV to MPEG converter
Many times we come across videos on net we want to download but can't as they are in FLV format/flash video. There is an online opensource tool to download such online videos from sites such as YouTube. The tool converts the FLV files into MPEG format online, which can then be saved to a computer. The online FLV converter is a very useful tool. I downloaded this hilarious video clip from YouTube using this online tool.
The quality of download was very good and it was fast. Try it out!
The quality of download was very good and it was fast. Try it out!
Saturday, May 19, 2007
Static linking : library options in command line
In my last post I asked why it's advised that library options be the last in the command line in case of static linking.
Here is the explanation:
The symbols on the command line are resolved from left to right.
Stating linking looks through the static library for "undefined" symbols when it is processed.
Now in case of
cc -lfoo hello.c
there are no undefined symbols when libfoo.a gets processed and so nothing gets extracted from it. When the object file is processed, it doesn't find any symbol and it gives an error "Undefined symbol"
If hello.c is put before -lfoo as in
cc hello.c -lfoo
there are undefined symbols when libfoo gets processed and so they get extracted. This works fine.
Dynamic linking doesn't have this issue as all symbols are available through the virtual address space of the output file.
Static libraries have other issues like bigger executable size, and lack of ABI ( application needs to be relinked with each new version of the library).
One advantage of having static libraries is that the executables linked to them are somewhat faster at runtime because all the linking occurs before loadtime. This helps in benchmarking. Math library libm is provided as a shared object (libm.so) as well as static library (archive libm.a) since benchmarking makes a heavy use of this library.
The symbols on the command line are resolved from left to right.
Stating linking looks through the static library for "undefined" symbols when it is processed.
Now in case of
cc -lfoo hello.c
there are no undefined symbols when libfoo.a gets processed and so nothing gets extracted from it. When the object file is processed, it doesn't find any symbol and it gives an error "Undefined symbol"
If hello.c is put before -lfoo as in
cc hello.c -lfoo
there are undefined symbols when libfoo gets processed and so they get extracted. This works fine.
Dynamic linking doesn't have this issue as all symbols are available through the virtual address space of the output file.
Static libraries have other issues like bigger executable size, and lack of ABI ( application needs to be relinked with each new version of the library).
One advantage of having static libraries is that the executables linked to them are somewhat faster at runtime because all the linking occurs before loadtime. This helps in benchmarking. Math library libm is provided as a shared object (libm.so) as well as static library (archive libm.a) since benchmarking makes a heavy use of this library.
Friday, May 18, 2007
quirk of static linking
A question related to linking today.
Why is it advised to put the library options at the end of command line for compilation? Hint: If we have a static library, say libfoo.a which we want to link to our program hello.c
cc hello.c -lfoo
rather than
-l option tells the compiler to link to library [lib]foo. Note that "lib" from libfoo is dropped and only "foo" part is given with -l.
How Nerdy are you?
Thursday, May 17, 2007
RAID Primer
Found a brief and good online paper on different types of RAID ( Redundant Array of Independent Discs ). It explains RAID concepts with a brief explanation of each type along with their pros and cons.
The paper can be read here.
The paper can be read here.
Tuesday, May 15, 2007
Top 10 funniest gadgets
While surfing the net today, I stumbled upon this list of top 10 funniest gadgets.
My favorite are DVD rewinder and USB powered butt cooler. What are yours?
My favorite are DVD rewinder and USB powered butt cooler. What are yours?
Microsoft threatens Linux with patents
According to a news article, Microsoft has alleged that Linux and other Open Source software violate its patents. This includes 42 by Linux kernel alone and many by OpenOffice, totalling 235 patents in all.
Looks like an open source arm-twisting effort by MS directly related to their deal with Novell last year.
More at :
CNN
CRN
Looks like an open source arm-twisting effort by MS directly related to their deal with Novell last year.
More at :
CNN
CRN
Wednesday, January 3, 2007
Memory Overcommit and the OOM Killer
Linux has a feature called memory overcommit. Put simply, it means kernel allocates memory even if it doesn't have enough. This happens when a new process is created using fork(). This effectively copies the parent's address space, and so requires twice the parent process' memory once the new process (child) is created. The memory overcommit feature means that fork() always returns a success. Even if there is not enough memory to create a new child process!
The idea behind a memory overcommit feature of Linux is that the child process rarely uses all the memory allocated to it. fork() is followed by exec() which overlays the child address space with some exectutable. Once the exec() is done, the child process exits and the parent process (which goes into wait() after creation of child) resumes.
Failing to allocate enough memory when it is needed by the child results in another process being invoked. This process is called Out Of Memory (OOM) killer. The job of this process is to select a process to kill so that the memory requirements after fork() can be satisfied. Not a very desirable feature, but it is necessary to keep memory overcommit feature of Linux. This made OOM killer infamous. How to select a process to kill is tricky. It might happen that some important processes (e.g. a database) gets killed by OOM killer. Analogies like this show how serious the situation is when killer is invoked.
It seems that during 2.4, OOM killer's favourite process to kill was the Netscape browser. The browser would crash all of a sudden and you'd have no idea why.
The memory overcommit along with OOM is not an example of a good design feature, but has even made its way into AIX. With 2.6 the memory overcommit feature can be suppressed using some variables, but by default the feature is present.
Fortunately, it doesn't exist in Solaris. Solaris never used memory overcommit. First it was vfork() instead of fork() to prevent the failure of process creation. In Solaris 10, posix_spawn() is used instead of vfork() since vfork() is not MT-safe.
The idea behind a memory overcommit feature of Linux is that the child process rarely uses all the memory allocated to it. fork() is followed by exec() which overlays the child address space with some exectutable. Once the exec() is done, the child process exits and the parent process (which goes into wait() after creation of child) resumes.
Failing to allocate enough memory when it is needed by the child results in another process being invoked. This process is called Out Of Memory (OOM) killer. The job of this process is to select a process to kill so that the memory requirements after fork() can be satisfied. Not a very desirable feature, but it is necessary to keep memory overcommit feature of Linux. This made OOM killer infamous. How to select a process to kill is tricky. It might happen that some important processes (e.g. a database) gets killed by OOM killer. Analogies like this show how serious the situation is when killer is invoked.
It seems that during 2.4, OOM killer's favourite process to kill was the Netscape browser. The browser would crash all of a sudden and you'd have no idea why.
The memory overcommit along with OOM is not an example of a good design feature, but has even made its way into AIX. With 2.6 the memory overcommit feature can be suppressed using some variables, but by default the feature is present.
Fortunately, it doesn't exist in Solaris. Solaris never used memory overcommit. First it was vfork() instead of fork() to prevent the failure of process creation. In Solaris 10, posix_spawn() is used instead of vfork() since vfork() is not MT-safe.
Subscribe to:
Posts (Atom)
Steps to install PyTorch on VMware workstation (Ubuntu guest)
The following is the list of steps to install pytorch 2.0 in VMware workstation (Ubuntu guest): $ mkdir ~/pytorch $ mkdir ~/pytorch/as...
-
Recently one of my computers' Linux partition was deleted by mistake. As the Linux partition held the multi-boot information, it made th...
-
Most wannabe geeks would say Linux, though it is just a kernel and not an OS. Some would answer Ubuntu or Gentoo depending on which is the ...
-
Here is a probabilistic solution to the two General's problem; it gives a high probability of succcess if the number of messages(messeng...