Posts Tagged ‘ engineering

JPA Rejects

Since this is an annual thing, I thought that I should just put a few words down to tell the kids who got rejected by JPA – Don’t Give Up!

Dear JPA Reject,

I shall use the words that I had once heard, from a good professor of mine: “Although you may feel dejected, do not feel depressed.” The reason is really simple. The JPA scholarship is not the be-all-end-all of your dreams. Your dreams are yours to keep. So, keep them alive!

I have been fortunate enough to get multiple education scholarship offers in my life and I had turned down a few of them. I have also made many friends who are both government scholars and non-government scholars alike. So, I would like to share some of these experiences.

First and foremost, the JPA scholarship scheme is just one of the many scholarships available, both local and overseas. You should realise that there are many scholarship awarding bodies in Malaysia. For those who will be facing their SPM examinations in the future, please remember to apply for multiple scholarships, if only to increase your chances of actually getting one.

You see, everyone has a different set of criteria. You may not agree with the JPA selection criteria and you may not fit in with it. However, there are also other scholarship bodies who do not agree with the JPA selection criteria and apply their own criteria in scholar selection. So, while you may not fit into the JPA mould, you may actually fit into some other mould.

There are also many overseas scholarship schemes available. In fact, many foreign universities are able to provide some sort of financial aid for their students. You should check to see if you qualify for these. There are also various international foundations and bodies who offer scholarships. This is particularly true if you are able to secure a place in a top university.

This brings me to my second point. This is not the end of the road. You can still try again at the post-STPM (and equivalent) level. There is nothing to stop you from continuing your education to a pre-university level and trying again. There are plenty of Malaysians who have done exactly that – do their pre-university education themselves and re-apply for scholarships again.

If you cannot afford to study your A-Levels/IB at a private institution, you can always do your STPM. You may not realise this but the STPM is actually a very well recognised pre-university level qualification. You will still be able to apply for various foreign universities with the STPM. Do not always believe what the private colleges tell you about the STPM.

However, some of you may be turned-off by the lengthy duration of the STPM exam. For this, I have only one advice – a single year is nothing, in the larger scheme of things. Think about this for a minute. What is a single year difference when compared with an entirely lifetime. In fact, it is a common practice to take a ‘gap-year’ to go explore various avenues in life. This can even help you figure out what it is that you actually want in life instead of blindly going with the flow.

This brings me to my next point. Not everyone is made out to be a doctor. In fact, you are probably not made out to be a doctor. The medicine path is a long and arduous one and if you are not made out to be a doctor, studying medicine is going to be hell. I have seen this happen to many friends. So, you should really ask yourself if you really love medicine or if you’re doing it just for the heck of it.

You can be a success, if you do something that you truly like – be it something as dull as accounting or something as exciting as engineering (alright, I’m biased!). But seriously, you need to think carefully of your career choice. It is something that you will be living with daily for the rest of your life. If you find that you hate medicine after so many years of study, you will lose more than just a couple of years.

And finally, do not let this little hurdle stop you from pursuing your dreams. There are many paths that can lead to your dream. Sometimes, it may actually be better to take the path less tread. So, do not think that your world has ended as a result of this rejection. Learn to handle rejection and to use it positively to improve yourself so that you will ultimately, still achieve your dreams.

PS: Do not stop dreaming!

with metta,
Shawn Tan.
(Still trying to achieve my dreams!)

Toying Around

At work today, I got to toy around with some equipment worth millions. I use the word ‘toy’ because I was literally fooling around with it to figure out how things worked. It is nice that we get to play with these kinds of toys at work because I would not be able to afford these kinds of toys at home.

Then, while this was happening, a co-worker and I were discussing about the cost of these expensive toys. You see, the actual cost of manufacturing these expensive toys is probably not very much, certainly nowhere near the millions that they are sold at.

However, the engineering world is filled with a lot of these high-margin toys. We engineers just love these toys to death and just cannot afford to live without them. They are our bread and butter in many many ways. Therefore, one should always treat toys with respect.

Which was exactly what I did when I was toying around with it.

We had to move it out from another place to ours, in order to fool around with it. It took 3 people to remove it and carry it all the way up to our lab. Then, we were a little worried that the table would not hold the weight. So, we ‘borrowed’ another piece of furniture to use.

Thing is, although I am currently not working in my comfort domain, I have been picking things up rather quickly. Basically, I just plunged myself into the deep-end from the very first day. I figure that that’s the best way to force myself to learn.

Good thing is that although it is not my comfort domain, I am not entirely n00b about it either. I do have some related knowledge that I can leverage on. Personally, I think that my co-workers have been quite nice. I have basically been bugging them with queries.

Hopefully, I will be able to finish my learning process soon and start working on the solution instead.

Day 5: Karen, Art and Shopping Malls

We started our day by visiting the tribal people – Karens. These are those famous long-necked women that depress their collar bones for beauty. The thing that interested me more during our visit was their use of local engineering and technology. I observed that their roofs were made with regular dried leaves and they used water power for their machines. Such things interest me because I’m a hardcore engineer but it will probably bore most of you to death. So, I’ll just skip it. However, it’s still interesting to note that these people are, by themselves, a tourist attraction. When they see me coming with my DSLR, they all move into position for me to take snap shots. How quaint – not having to get people to pose or ask them for permission.

After that, we went off to a few other tourist attractions including, a petting zoo for tigers (!!!), a snake show and an umbrella factory. It is at this umbrella factory that I witnessed more skilled craftsmanship. I told my family that if these artistes set up shop in Central Market, KL and charged between RM10 to RM20 for each drawing, they would make a fortune. Most of the teenage girls in KL would love to have these artistes customise their clothes and accessories for them. RM10 is nothing much to spend on getting some quality artwork rendered on your favourite bag, for example. Furthermore, these artistes worked so fast, it hardly took them 5 minutes to render this drawing on our clothes. Since they’re meant for umbrellas to begin with, it’s all water-proof!

At this point, I had grown rather weary of factories. We were of course, brought to a few others – leather, cotton and what nots. Since this was the end of our official tour, we asked that our tour guide drop us off at a local shopping mall so that we could pick up a few other items at local prices as opposed to tourist prices. Our guide told us that there were only two malls in ChiangMai, an older small one and a newer big one. So, we went to the big one. While exploring the big one, I learned a few more things. The cost of goods in ChiangMai is pretty much similar to that in Malaysia. Of course, this was limited to the things that I’m interested to buy – i.e. DVDs, books, electronic gadgets. The only cheap stuff in ChiangMai are the local crafts and of course sundries like rice and vegetables.

PS: As you can tell, I’ve grown rather weary of writing as well! But, I shall press on!

Day 3: Elephants, Chiang Rai

This day began with a visit to an elephant camp, where we went on three separate rides – elephant, bullock cart and raft. It was mainly a trip meant for the kids as they loved elephants (influenced by Horton Hears a Whoo). In my case, it was also an interesting experience as I cannot remember when it was that I went on one, last. While on the elephants, I had to rely a lot on luck to get any good shots off. It was extremely difficult to compose any photographs with such a bumpy ride. No amount of image stabilisation is going to help when an elephant takes a step! However, I still managed to get a large number of good photos in the end, particularly ones with the children in it.

Now, what particularly impressed me about these elephants was their drawing skills. When we first arrived at the camp, I saw lots of ‘artwork’ being sold for about 800 baht each. My first thought was that these things were tourist traps and the art was probably drawn by some person and peddled off as elephant-art for a premium. However, during the ensuing elephant show, a pair of elephants were given a blank sheet of paper and a white t-shirt to draw on and they took about 15 minutes to finish their works of art. So, my initial cynicism was wrong. According to the narrator, Asian elephants are smarter than their Indian cousins because they have a bigger head/brain, which is visible as they’ve got bumps on the forehead. So, they are capable of remembering procedures and steps even if they are colour blind. For that problem, they have a human assistant who hands out brushes to them with the right colour on it.

We went rafting down the river on bamboo rafts. I took this time to explain to my 7 year old nephew, why bamboo was chosen to build the raft (evil me, trying to incite some spark of engineering interest in him) – air pockets, structural strength, light weight. It was a 45 minute raft ride and mid-way, we were greeted by a small sampan floating on the river selling refreshments. How wonderfully entrepreneurial again! I guess that such things probably happen on the Rejang river as well, but it is certainly something strange to us peninsular folk. There were of course other sights to see along the way, but nothing was quite as interesting as this one. At the end of the trip, we were all hustled into our minivan for our journey to ChiangRai.

The journey itself was rather uneventful as I ended up sleeping most of the 4-5 hour drive up. However, our tour guide once more, told us about how different the northern Thai people were to their southern brethren. Seems that northern Thailand was once part of a different kingdom and they were only annexed by Siam from Burma at a much later point, around WWII. He also mentioned to us that because the northern people loved Thaksin so much (incidentally, he is from ChiangMai), they would have no problems seceding from Thailand, forming their own nation and installing Thaksin as their new president. However, they still love their king though. So, I think that if such a thing were to happen, they would still keep the Thai King as their constitutional monarch.

We arrived in ChiangRai in the evening and we requested to be taken to a local night market. It was much smaller than the one in ChiangMai but it was still interesting nonetheless. At one point, I was caught in the packed crowd and felt some hands groping me. I immediately shoved my hands into my pockets to make sure that my valuables were not stolen and then quickly exited the area. At this night market, I decided to buy everyone some ‘rotee’, which is what we call roti canai over here. The best one seems to be the one filled with egg and banana (roti telur pisang). However, the biggest difference is the amount of banana that actually goes in – it was densely packed with bananas and you could taste them in every slice, unlike the kind you get at the local mamak. The price of it was similar to that in Malaysia though, 25 baht each – but it tastes really good!

Day 1: Arrival

Okay, I thought that I should get this all written down while the memories are still fresh in my head. So, here goes.

We left for the LCCT at the wee hours of the morning and drove two cars there. Since this was my first experience with AirAsia at the LCCT, I would like to put on record that it is nothing like my experience with Stansted and Ryanair. The place was jam packed with people and as you can expect, the check-in counters were awash with humans. It was fairly chaotic and the staff were not very friendly either. Although our flight and group did not have any problems, I saw some rather disgruntled passengers at the counter next to ours who were told that they were at the wrong counter (after lining up) because the airport had displayed the wrong information on the notice board.

After checking in our luggage, we went through the rest of the usual airport processes without any hassle. Then, the time came for passenger boarding. While almost every other airline would allow babies and senior citizens to board first, AirAsia does not. It only allows people over the age of 65 to board first. Seeing that we had 4 senior citizens below 65 and 2 babies, it was rather cumbersome for us to find suitable seats on the plane. However, everyone got seated in the end and the flight took off and landed without incident (except for the rather bad landing with the plan touching down on one side).

The moment we arrived at ChiangMai International, things were rather a breeze. When we walked out of the arrival gates, we were promptly greeted by a bunch of cute looking girls with flower garlands whom immediately posed with us water fish for photographs. We will soon discover that this is not the last time that we will see this particular group of people. They seem to know exactly where we will be as they popped up during our welcome dinner at the restaurant and correctly brought our set of photographs to our dinner table, to sell it to us for 100 baht each. Wonderfully entrepreneurial!

Anyway, our family had opted for an extended tour. The typical tour was a 5D4N tour while we opted for a more relaxed 7D6N tour. So, our first day was a free and easy day and we decided to roam around the hotel area on our own. That was when I caught sight of my first engineering marvel in ChiangMai – the electrical poles by the road. It gives a whole new meaning to the word SNAFU (pardon the parlance). I have a whole lot of respect for the engineer who has to figure out which power line is causing the problem, when there is a fault in an area!

Another interesting thing that I came across while exploring, was the sale of foreign newspapers. While these are also available in Malaysia at certain news outlets, they are not always up-to-date. However, these entrepreneurial Thais have taken it upon themselves to actually print their own local copy of the papers, up-to-date. The papers are printed on quality white paper and sold at a premium. It is exactly the up-to-the-day version of the paper that is sold in newsprint all over the world. How wonderfully entrepreneurial again!

That night, after our welcome dinner, we explored the local pasar malam as well. Even this impressed me tremendously as it was extremely well organised for a night market. At about 5pm, the stalls began appearing and people were setting up. Unlike the night markets in Malaysia that inevitably end up hijacking the roads and blocking all vehicular traffic, these night markets were arranged in such a way as to face the pedestrian walkways. So, the vehicles were still able to pass along the main roads, albeit at a slower speed. While our experience at the ChiangRai night market was more similar to the ones in Malaysia, this one at ChiangMai was still pretty impressive to me.

After all the hassle of waking up early in the morning and flying over, we decided to call it a night and went to bed early. Oh, I forgot to mention that I decided to tailor myself a new suit and went to visit one of the local tailors to decide on the design and material. I’ve been meaning to tailor a very specific kind of suit for a while now. So, since the opportunity presented itself, I thought that I’d give it a try. These tourist tailors loved to display glowing letters of recommendation by foreign tourists but there was one particularly odd one, where a french tourist (wrote in French) telling other french tourists to go next door instead as the quality and service was better!

NVIDIA Tesla

The NVIDIA Tesla is a fairly interesting computer from NVIDIA, whom are famous for their graphics chips. The Tesla is a supercomputing workstation that combines a number of graphics chips and a regular processor. The result is a remarkable desktop machine with the total computational power of 933 GFlops at under US$ 10,000.

While the computer is being touted towards the scientific and engineering community who have to deal with complex simulations, the more exciting application for this computer is – games! As a comparison, the PS3′s Cell processor has a computational power of 204 GFlops while the Xbox360′s Xenon processor has a computational power of 115 GFlops. All these Flops are good for graphics, audio and physics processing.

The way that the Tesla is configured, it comes with a quad-core processor from either AMD or Intel, which serves as the main processor, just like the PPE on the Cell. This main processor will be in charge of running the operating system and allocating tasks to each graphical processing unit (GPU), just like the SPE on the Cell. There are up to 4 GPUs in each Tesla with 4Gb of memory each. You can think of it has a more powerful Cell computer.

Considering that it is based on a regular PC design, it should be fairly trivial to create games for the Tesla. If only it did not have the price tag that it has, it could fairly well be the most powerful gaming platform on the planet, but now it will just need to be satisfied with being the most expensive gaming platform on the planet.

I reckon that is why it is being touted as a scientific computing platform. Although there are efforts at bringing scientific computing to the PS3, for example, it is kind of a hack. The gaming consoles were not designed for scientific computing and the people who wish to use them for it will have to jump through a few hoops first. With the Tesla, the platform is ready for them.

Ultimately, this will be a niche product as Joe Blow will not be shedding ten grand for such a rig. Also, the power consumption of such a system is fairly high (at 1.2kW). However, it would still be interesting to see someone hook a bunch of these machines together into a compute farm. It would be interesting to see the Tesla enter the supercomputing Top 500 list.

A Pleasant Surprise

I had recently been contacted by a final year undergraduate at my previous university, where I finished by Bachelor’s degree. He was interested in continuing the work that I did there as an undergraduate and he would appreciate any heads-up that I could give him. He also had little knowledge in the specific area and asked me for recommendations on reading material.

Seeing that it was someone from my alma mater, I decided to be genial and gave the student some pointers. So, I gave him some pointers and some recommendations on what to read it. It is a wonder to me that I can still remember stuff from back then. Actually, I have come to realise the importance of good design, because it helps me to recall how the darn thing works years from now, simply because the design decisions flow beautifully from one to the next.

However, considering the number of years it has been since I had left, there was no possibility that he had ever met me in person. Furthermore, my final year project supervisor is presently furthering his studies in Japan. So, I was rather curious as to how he found out about my project, why he decided to work on it and how he found out my contact information.

This was when he mentioned to me that certain lecturers at the university, spoke fondly of me. He mentioned that one in particular, said that the university was fortunate to have had people like me during its early years. Now, this surprised me thoroughly as I had not parted on the best of terms with the university, but I guess they left out all the juicy bits and focused on my positive contributions.

I can understand why the university may think that it was lucky, that way. There are many of my fellow peers, who are doing all kinds of interesting things in this world. Several of us have furthered our studies to the PhD level at many of the best engineering universities in the world. Many of the rest are scattered around the world working for various multinational corporations. Considering that my graduating class had only about 300+ students across all disciplines, this is quite an achievement.

There is actually a reason for this as the first 3 batches from my alma mater, were almost all (95%) fully funded overseas scholars. We only ended up at the university due to the 1997 Asian economic crisis. One of the steps taken by the government to control the outflow of currency was to cut the scholars going overseas for education. So, our university was filled with students who are generally considered the cream of the country.

However, I cannot attribute our success to merely good students. On top of that, our university had a really ambitious vision and the necessary backing to achieve it. We were lucky enough to have had some really good lecturers teach us from the very first year, a well structured programme designed by the top educators of the world, as well as access to the best equipment that money could buy. There was also a genuine encouragement and push from the university, for the students to excel.

So, this is why I have always contended that my alma mater is the best university in the country (it was in the running for Apex University as well!).

Airport Drama

I successfully made it home in one piece, although there were several interesting things that happened along the way. I think that this is probably the most eventful flight that I had ever been on. So, I thought that I’d share a few of the things that had happened on that fateful day.

It all started with the coach ride to the airport. When we left Stansted, the coach driver informed us that all reports indicate that the traffic situation was fine and we should arrive at Heathrow by 7pm, which gave me 3 whole hours to get myself checked in, have a light dinner and then fly off home. However, fortune was not as kind and it rained heavily causing the M25 to jam up. Therefore, by the time the coach arrived at Heathrow, it was already well past 8pm.

So, I quickly rushed to the check in counter and had my luggage weighed. I was really unfortunate and got an extremely unhelpful person at the check in counter. He even asked that I weigh my hand luggage and he added all that to the total combined weight. This resulted in an additional 20kg and I had to go to the service counter at the other end of the terminal to check the price. When I was told that my excess luggage would cost almost £900, I balked. That was the price of two whole tickets!

I was hungry, tired, late and now this. So, I decided to dump all my clothes. I sat in the middle of the terminal and started tossing almost everything out except for my suit. I thought that for RM7,000 I could easily afford an entirely new wardrobe of clothes. So, I tossed everything out including the few nice barong shirts that I had. This got my weight reduced by about 7kg but it was still too heavy.

But I met the same unreasonable counter staff again. He told me that I was still over by 10kg but that I would have to pay 15kg of excess. I could not understand this logic and called his supervisor over to discuss this with. After some reasoning, the supervisor decided to raise my baggage allowance and only charge me for an extra 5kg, which came up to about £200. This I gladly paid as I could possibly get it reimbursed by my sponsor later.

After checking into the flight, I decided to go back to the place where I tossed my clothes to collect them and properly dispose of them. But by the time that I got there, the place had already been thoroughly cleared. I guess that passengers tossing their clothes must be a very common thing and the efficient airport staff and already disposed off it on my behalf. So, I went through security and got on my way.

While in the departure hall, an elderly Malay man came over to sit with me. So, I struck up a conversation with him which invariably led to the talk of Malaysian politics, which is quite interesting at the moment. But I noticed several people staring at me with an evil eye when I was chatting with the elderly chap. Then, I finally asked him what he did for a living and he told me that he was the MP for Bukit Gantang, one of our opposition politicians. He promised me that they would seize power by September 16 and I reminded him that it has to be done legally.

Then, as I boarded the plane, I ended up sitting next to a young girl that looked extremely familiar. So, I asked her if she was a Part II engineering student at Cambridge and she said that she was. So, I asked her what she was doing going to Malaysia and she said that she was going home. This kind of shocked me as I didn’t ever realise that she was Malaysian. I can chalk this up as another random Malaysian whom I know, that no one else knows. So, at the very least, I had someone else to talk to during the flight and it wasn’t as dull or boring a 12 hours as I thought it would be.

So, anyway, I’m back!

Dark Knight

posterA bunch of friends and I went to watch the Dark Knight last night. Although I lived closest to the cinema, I ended up arriving the earliest, a full 30 minutes before the show began. The cinema was packed full and we were lucky to get the seats that we managed to get.

Right after they had finished showing the trailers and we were eager to get going with the film, the lights in the cinema came on and the screen turned off. Then, a bunch of red lights turned on as well and a calm voice came over the sound system telling us that an “incident had arisen”, which required us to vacate the whole cinema. So, people began filing out using the nearest emergency exits.

At this point, I thought that the Joker might make an appearance in the cinema. Maybe the cinema had some extra plans to make this movie a memorable experience. We had even seen some of the staff members made up as clowns earlier. So, there was a basis for this thought. Maybe some of the staff would invade at that point and put up an act in front or something.

Then, a member of the cinema staff came in to tell us that it was a false alarm. So, everyone quickly returned to their seats while the staff members went to chase down those who had already left via the emergency exits. We waited for about 10 minutes for them to fill up the cinema again. Then, they restarted the film from where it stopped. And the show began.

Some things that I thought were interesting about the show. Neither the opening credits nor the end credits mentioned “Batman” anywhere. The opening credits merely showed a DC Comics and Warner Bros intro and the symbol of the Bat. This took all of about 60 seconds and the show started. It was only during the end credits that “The Dark Knight” appeared, as part of a monologue by Jim Gordon.

As for the show, I have to say that I didn’t realise that 3 hours had passed. That is good. It shows that the film kept me at the edge of my seat throughout. Good thing was that the whole cinema was silent as well. Although some friends complained that the first half was a bit slow, I felt that it was important as it had to introduce a whole bunch of new characters and also set the tone of how desperate the situation in Gotham had become.

It is a little unfortunate that Heath Ledger has passed away. His portrayal of The Joker was awesome and I think that anyone else who tries to fill his shoes is just going to suck. I don’t know how anyone could possibly better his performance, which made me feel like slapping him and afraid of him at the same time. I seriously think that they should award him a posthumous Oscar for it. For once, the villain carried the whole show through, instead of the hero. Batman felt like a supporting role, compared to The Joker.

One of the interesting moments in the show was when the Prisoner’s Dilemma made an appearance. That was an interesting 15 minutes of the show. I also loved the way that they portrayed Batman’s fall from grace and it sets the tone for the rest of the franchise. Now everyone can understand why Batman behaves the way that he does, seemingly without morals.

Maggie Gyllenhaal was also a much better Rachel Dawes than Katie Holmes was. Although I had never thought that Maggie was that hot, her first few minutes on screen were very much so.

At one point in the movie, they showed a piece of technology marvel that Fox had used in Hong Kong. And my engineering brain immediately began to think about how I might possibly build such a thing using the technology today. This is one of the reasons that I like the new Batman franchise. All the gadgets and toys used are very “realistic” and can actually be built using standard technology today.

Anyway, I think that I’ve talked enough about Batman. Go watch it! I might go watch it again in a couple of weeks time.

Strace to the Rescue!

For some unfathomable reason, a mailing list that I was running, decided to stop working last week. Whenever anyone sent an email to the mailing list, they would get a bounced error and fail. I was forced to reboot the server two weeks ago, but I had not changed any settings since. So, I was rather puzzled as to what was going on.

The first thing I did was to check the mail server logs and the error surprised me:

Jul 2 15:41:23 localhost postfix/pipe[10572]: 70CB7401A4: to=, orig_to=, relay=mlmmj, delay=1.5, delays=0.96/0.02/0/0.49, dsn=5.3.0, status=bounced (Command died with signal 11: "/usr/bin/mlmmj-recieve")

This did not make any sense to me. MLMMJ was segfaulting without any reason. I tried googling around for a solution but there was none. MLMMJ is not a very well documented mailing list manager either. So, I was left to find my own solution to the problem.

The usual causes for a segfault are usually memory related. So, I thought that the server might be running out of RAM. To test this, I stopped running some other services to free up RAM. Then, I sent a test email to the list to see the same segfault error. So, it’s not a case of “lack of memory”. Then, I thought that it might be a file permissions problem so I set the test mailing list to be world read-write-able. This didn’t work either.

So, time to dig deeper into the “mlmmj-receive” programme. Reading up on the man pages, I realised that it was only a front-end software that calls two other back-end programmes to do the dirty work. It calls “mlmmj-process” to process the email and “mlmmj-send” to send the email. So, it was possible that any one of these three things were failing.

The next thing that I tried was to create a blank mailing list with no subscribers and sent a test email to it. Surprisingly, the “mlmmj-receive” completed without much ado. So, this indicated to me that the problem was likely with the “send” stage. But, it got me no closer to an answer as I couldn’t think of any reason why this stage was failing at all as the main SMTP server was running perfectly.

So, it was time to roll up the sleeves and engage STRACE. I have only used it once for debugging purposes and now it was time for me to see what was going on behind the scenes. But to deploy this, I would first need to intercept all the messages being sent to and returned from MLMMJ. So, I wrote a wrapper script “/usr/bin/mlmmj-receive” to wrap around “/usr/bin/mlmmj-recieve” (note the spelling difference).

#!/bin/sh
cat - > /tmp/mlmmj.in
cat /tmp/mlmmj.in | strace -f -o /tmp/mlmmj.log /usr/bin/mlmmj-recieve $@ 1>/tmp/mlmmj.out
cat /tmp/mlmmj.out

This simple script first intercepts all the data piped to MLMMJ and saves it in “/tmp/mlmmj.in”. The next line is the magic that uses strace to trace the actual operations, which dumps all the system calls to “/tmp/mlmmj.log”. Studying this log revealed, the interesting inner workings of MLMMJ and also provided a clue as to what was going wrong.

socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 5
connect(5, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("xx.xx.xxx.xxx")}, 28) = 0
fcntl64(5, F_GETFL) = 0x2 (flags O_RDWR)
fcntl64(5, F_SETFL, O_RDWR|O_NONBLOCK) = 0
gettimeofday({1215041316, 932534}, NULL) = 0
poll([{fd=5, events=POLLOUT, revents=POLLOUT}], 1, 0) = 1
send(5, "\v\352\1\0\0\1\0\0\0\0\0\0\nlocalhost\t\0\0\1\0\1", 28, 0) = 28
poll([{fd=5, events=POLLIN, revents=POLLIN}], 1, 5000) = 1
ioctl(5, FIONREAD, [28]) = 0
recvfrom(5, "\v\352\205\203\0\1\0\0\0\0\0\0\nlocalhost\t\0\0\1\0\1", 1024, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("xx.xx.xxx.xxx")}, [16]) = 28
close(5) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++

This bit showed that just before segfaulting, the programme (in this case, mlmmj-send) was polling the DNS server for the IP address of “localhost”. This did not make sense as a computer should not be polling a DNS server for “localhost”, which is defined in “/etc/hosts”. In fact, at an earlier part of the programme, it actually opens up “/etc/hosts” and tries to find “localhost” in it.

Seems like there was a formatting problem with the file which I didn’t realise. But none of the other programmes seemed to have any problems connecting to localhost except MLMMJ. So, I fixed the problem and voila, the mailing list was working again.

Anyway, I now think that STRACE is a god-like tool. It gives me great insight into the inner workings of any software application. This would be very useful for reverse engineering purposes as well as debugging and optimisation tasks. It has an option to output timestamps, including how long each system call takes. I will look into this application more, and learn how to exploit it thoroughly. This tool is one to keep in the tool bag.