astradele

Archive for September, 2005

G++ and GCC don’t mix

Posted by GJ on September 30, 2005

My boss recently volunteered me to work with another group having problems calling a library via JNI on a Solaris box. I know Linux, so I wasn’t totally out of my depth, but I’ve never done JNI, and the GNU commands on Solaris (SunOS 5.8) behaves a bit differently than what I’m used to. I was a bit surprised, but said I’d try my best - and found myself enjoying the return to actual code a great deal. Thank goodness they had bash in addition to the default ksh, though.

Running the Java program, the only information was an exception java.lang.UnsatisifiedLinkError with the method name. There was also a line above that stated that the library in question couldn’t be used. Not very helpful. The Solaris box wasn’t under my control, so no attaching a debugger or installing packages. The library being used had been generated on a different Solaris box (same SunOS version); the box I was using didn’t even have GCC installed.

I won’t go through everything I did (four hours, with lots of red herrings), but I’ll mention a few of the things that helped.

  • Ran the java app with jdb. jdb is pretty minimal, but the major debugger functions are there. In particular, narrowing down to the exact line where the exception was thrown (through a mixture of source code inspection, and trial and error) helped a lot. I accidentally picked up an earlier UnsatisifiedLinkException that was involved in the printing of that single line error message. It turned out that the code (auto-generated?) was swallowing an exception and printing to System.out without any information from the causal exception - important details disappeared.
  • Reproduced the problem by creating a test application that did something similar. In this case, a little searching revealed the System.loadLibrary(String) function, where it’s pretty clear that if used to load a native library, should reasonably reproduce such a fatal error. Interestingly, the exception message was quite a lot different, “symbol __gxx_personality_v0: referenced symbol not found“. Some searching revealed a conversation that suggested this had to do with a C++ symbol not being pulled in. This was the tidbit that triggered the discovery of the fatal flaw: the compilation instructions used g++ for the first two steps, and then gccfor the last. Using g++ throughout fixed the problem.
  • Walked through the Java runtime source code to enlighten me what was involved in loading a native library. Doing that, and some searches, helped me understand what the filename of the library on Solaris had to be, the way it was searched for, etc. Not totally necessary, but it helped me to understand the whole situation.
  • This may have been a red herring, but I add it for completeness. The original compilation process was done on SunOS 5.8, but with v3.2 of GCC. The libgcc_s.so.1 on the target box was v3.3. To address that, I went to this site that hosts many precompiled Solaris binaries and found v3.3 for Solaris 8. The site is incredibly slow, however, so a search on the package name turned up a Sunfreeware mirror that was many times faster. A quick trip to the newsgroups taught me that Solaris uses a pkg scheme, and that I had to use pkgtrns to extract the binaries out. Oh, and I also learned that IE can have trouble downloading a gzipped file, treating it like text and corrupting it for some odd reason.

To be honest, I had a lot of fun. There’s something about being able to call on heterogenous types and sources of information to find a proper solution that’s quite enjoyable for me.

Posted in techie | No Comments »

A birthday vacation?

Posted by GJ on September 30, 2005

Chatting with my chiropractor, the topic of my birthday came up. I realized that the day and my age matched this time around, and my chiropractor suggested that I should actually take some vacation for once - a kind of “champagne birthday”.1

I thought about it and I agree. I’m not one for numerology, but sometimes ideas and suggestions resonate logically and emotionally. I think this is one of those times. It wasn’t just a “why not” thought, but an actual, “yeah, I think I’d like to” internal consensus.

For those who are unaware, I typically don’t take vacations. Usually I take time off only to avoid having my accumulated time expire, and even then I usually skip work but don’t travel. The vacations that I have taken were invariably for the purpose of visiting or meeting up with people.

This time, however, I’m imagining flying somewhere for my own sake (or with friends, if any are interested). I haven’t decided if I want one, two, or three weeks. I also haven’t decided where, although I’m thinking I’d like to cross an ocean or a superpower at least. I don’t think I’ll sweat the monetary details much either; if I’m going to do this, I may as well “go for broke”. :)

Any suggestions? Japan, Taiwan, Western/Central Europe, and Cancun have come to mind.

1. A “champagne birthday” is when the last two digits of the year and the age match.

Posted in everyday | Tagged: | No Comments »

Mimosa Grille

Posted by GJ on September 27, 2005

I couldn’t stray too far away from where I was, so with a sudden restaurant decision on my hands, I went to the old Redwood Grille, recently reborn as the Mimosa Cafe and Grille. The decor hasn’t changed much, but the menu has taken a different flavour.

It began with the Trio of Soups (I love samplers, C$8):
Trio of soups
From left to right, the soups are a butternut squash, potato leek (?), and a french onion. The french onion was quite terrible (so watery!), the potato leek was not memorable, and the butternut squash was quite good. I think I just like butternut squash soup in general.

After that came a tapa, Shrimp Fritter with Garlic Aioli (C$5):
Shrimp fritter
This was quite a surprise. The shrimp were thick, juicy, and tender, quite delectable throughout. I’ve often experienced a slightly funny taste with large shrimp, but this was a treat through and through. Didn’t much care for the dipping sauce, though.

Lastly, the entree was a Seafood Crepe - sauteed tiger shrimps, scallops, mussels, baby peas, mushrooms (C$19.50):
Seafood crepe
The shrimp was every bit as enjoyable as it was in the tapa. The mussels were pretty typical, but the the scallops were good. The peas and the mushrooms, combined with the cream sauce, were quite delicious atop the crepe, though the crepe took some unravelling to get proper exposure to the sauce.

Whatever the name, this restaurant is still pretty good. I’ll remember it for the excellent shrimp, and pass on the soups next time.

Posted in everyday | Tagged: | No Comments »

Cleaning out the pantry

Posted by GJ on September 26, 2005

I want to change my diet somewhat: less (no?) meat, more vegetables, organics, etc. It may not really be better for me, but it doesn’t hurt (much) to try it for awhile. However, I figured I’d better eat what’s in the freezer and pantry first, instead of just tossing it all out.

Well, two weeks later, I’m still eating those reserves. I hadn’t quite realized how many non-perishables and freezables I’d acquired. Granted, I eat out for lunch on work days, but lasting this long has been a real surprise.

Mind you, I’m not giving up my periodic restaurant sampling (and photography). I enjoy doing that too much - it’s, quite literally, entertainment via the taste senses.

Posted in everyday | No Comments »

Hibernate: Session.evict() and explicit saving

Posted by GJ on September 24, 2005

Hibernate does a neat trick where it tracks objects that have been changes since being loaded from the database. Once Hibernate provides an object, make a modification and flush the Session - Hibernate knows the object was changed and will propagate to the database accordingly.

I was trying to construct a more explicit system, where objects had to be explicitly marked for saving. Conveniently for my codebase, all the objects that come out of Hibernate go through a couple entry points that abstract Hibernate from the rest of the system. Using Session.evict() to dissociate the object from Hibernate’s tracking, then subsequently using Session.save() or Session.update() to reassociate, seemed workable.

Naturally, there’s a fly in this soup. Hibernate (v3) doesn’t like this pattern. It reports an assertion failure occurred (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session). From what I can see, I’m not the only one who’s seen this issue. I don’t remember where I got the hint from, but it turns out that if I call Session.flush() after the Session.evict(), most of the problems go away.

In the end, I tossed the idea out as a bad one: overthinking and not using the framework enough. Hibernate supports optimistic concurrency collision detection via versioning/timestamps. Since the purpose of this exercise was to limit the damage that accidental and parallel writes could do, Hibernate’s support was sufficient.

Posted in techie | No Comments »

Desert animals still need water…!

Posted by GJ on September 23, 2005

My poor, long-suffering cats. After getting back from the kitty hostel, I forgot to put out some water for them. They’ve been without for nearly 24 hours. Their absent-minded human didn’t pick up on the signals either: insistently following me into the kitchen, willingly braving a few steps into the sink, trying to open the washroom door, speaking to the human with unusual frequency…

Posted in everyday | No Comments »

Subversion and Ant: getting the current revision number

Posted by GJ on September 22, 2005

I was trying to improve our version numbering system, which was manually updated as a number in a file. Looking to make it part of the automated build process, I started looking into SvnAnt. Unfortunately, SvnAnt isn’t platform independent, and builds can occur on Linux or Windows, but JavaSVN is platform independent, and has instructions for integrating with Ant in place of SvnAnt.

Unfortunately, JavaSVN’s support for SVN commands isn’t quite as good as the regular Subversion client. I ended up having to run the equivalent of an “svn status -v” and run it through Ant (v1.6+) filterchains. Fortunately, the built-in filterchains support the equivalent of the GNU head, tail, and tr. All that was missing was a sort. It was pretty straightforward to write a simple Java program to sort stdin and do a little bit of awkwardness in the buildfile to put it all together.

So now every build scans for the latest revision in the repository it can, and extracts that number to use as the version number. Much more convenient for us when talking about which build we were using. Arguably a performance issue, but the repository isn’t that big, and Subversion’s smart enough to keep information like that locally anyway.

Updated 2006-11-16
Thanks to Scott Carlson for pointing out that the command svnversion produces a concise version number (or range) that is much easier to parse.

Posted in techie | No Comments »

Bymark for lunch

Posted by GJ on September 20, 2005

Bymark appears intriguing, with only a pair of darkened glass doors and the name of the restaurant visible from the Path. Partly out of whimsy, selfishness, and as a show of appreciation, I treated a coworker to lunch there.

It looks pretty much as one would expect: pretty and upscale. I was sorely tempted by the Bymark Burger, which I believe goes for C$37. Could such an expensive burger match its price in taste? In the end, some sense (only a little) prevailed, and I went with the Lobster Grilled Cheese instead (C$27!):
Lobster grilled cheese w/ aged brie
I found the grilled cheese quite delicious. The salad was unpleasant (I don’t understand why expensive salads need to be bitter). The lobster was a waste; while present and in reasonably substantial quantity, I found that it didn’t have much taste (lacking the butter sauce?). I enjoyed the single lobster tail segment I had at North 44 much more than what was in the sandwich.

Despite the bill rung up already, I decided to give another try and go for dessert. I went with the Ontario Strawberry Shortcake:
Ontario strawberry shortcake
Sadly, this wasn’t memorable at all, especially for the high price I’m sure it cost me. Nothing wrong with it, I simply don’t remember being overwhelmed.

Next time I consider Bymark, I think I’ll have to give it an extra moment. North 44 was more enjoyable, and there’s no dearth of other expensive restaurants that can serve both ambience and good food - and I only really care about the good food anyway.

Posted in everyday | Tagged: | No Comments »

U2 concert

Posted by GJ on September 20, 2005

After deliberation and indecisiveness in the upcoming months, I did go to the U2 concert after all (the doubt centring on who I was going with). I was hoping that it would be like the last time I was in such a dilemma, a Sarah Mclachlan concert which I enjoyed.

The seats were good, and even warranted different chair material that was quite comfortable. Wasted effort, unfortunately, since the crowed was usually excitedly standing. We got to sit behind the A/V control centre, which was neat:
Veiw of the A/V centre

The stands were packed, of course:
Crowd to the right
Crowd to the left

Then the show began:
136_3661
136_3672
136_3678
136_3684
136_3691
136_3698
137_3709
As you can see, special effects were heavily used, as well as various themes. Throught the show, Bono was pretty preachy on various admirable topics: peace, tolerance, etc. He certainly knows how to put on a show for the crowd.

At one point, Bono invited the crowd to pull out their cell phones, for an etertaining effect:
137_3717
137_3720

Making a phone call to wish someone “happy birthday”:
137_3731

Lastly, having pulled some individuals out of the “pit”, they were set up as a “replacement band” to play instead of, and with, U2:
137_3734

Unfortunately, I’m not a really big fan of U2, and my enjoyment of the concert underscored that. Some parts I liked, but the preachiness was a little bit annoying after the first couple times. I can understand the reasoning, using one’s fame for the greater good, but do I really need to pay to be preached to? It was a good show, but for some reason didn’t entertain me as much as other concerts I’ve attended. Perhaps I was just in an irritable mood (which degenerated into a foul mood after the show on my way home). I’m only out some money though, and it was still interesting to see.

Posted in everyday | No Comments »

Zia Piera: unusual burger, unusual experience

Posted by GJ on September 15, 2005

It finally happened. I kind of wondered if it would eventually, but I didn’t dwell on it much.

I visited the old location of Gio’s (the “Nose”!), the famous Italian restaurant previously located on Yonge St. between Davisville and Eglinton. The location has an unusual restaurant design, where the kitchen is located at the front of the restaurant, exposed for all to see. I paused at the doorway to ask the cook and then waiter if it was okay if I just rolled in on my skates, since I had not brought a change of footwear. I’ve yet to be refused over that. After some discussion, it was deemed okay and I scooted in past the only other customers, a well dressed party near the front that were enjoying themselves greatly. Naturally, they gave me a few odd looks.

I had the soup of the day, a Butternut Squash. It was delicious, though in retrospect I should’ve passed on the pepper.
Butternut squash shoup

I also ordered the most unusual (and expensive, I admit) item on the menu: the Filet Burger Rossini, a Montreal smoked meat spiced “filet of beef” on a grilled veal patty sauteed in truffle butter, caramelized onions, topped with honey seared foie gras on crusty ciabatta. Before the picture, however, here’s the “meat” of this odd tale.

My wont is to take pictures of the food as it comes out with my camera and mini-tripod, disregarding any stares I may get from passerbys. I don’t really try to hide it. My first clue I was noticed when the waitress came back and asked if I would like some wine, a second time. I demurred, and was promptly informed that the owner (who I thought was the chef) was buying for me. Ha! I accepted a glass of red.

After the burger comes out, the owner drops by and takes a seat across from me. Introducing himself as Mike, it turns out that he was entertaining some close friends (the other dinner party!), since the restaurant had undergone renovations and reopened a few days ago. He asked if I was reporting. I smiled and indicated the negative. He asked why I had ordered the burger, and if I had had the Bymark burger (I wish I had!). He also explained that Zia Piera was his first high class restaurant, that his previous success was a chain of burger joints around Ontario, this particular burger was named after another world famous one, and that the recipe was twenty years in thought, not to mention several attempts in cooking! He insisted his friend come over to see the burger as he was explaining in detail the elaborate cooking process. He was quite enthusiastic.

Without further ado, here is the masterpiece:
Filet burger rossini
How was it? Very interesting (in the literal sense, not the polite sense). The meat was tender, the foie gras almost pureed in texture. The meat was piled so high that it’s hard to avoid toppling it over. I loved the effect the honey from the foie gras had on the meat. It was also incredibly filling - I barely touched the other bun or fries. An experience I’m glad for, being such a different spin on the commonplace burger.

The owner queried me on my experience, searching for a honest opinion. He noted that I found it quite filling. I should have also mentioned the fries were nowhere near as exotic next to the burger. I was also sent on my way with a small container of free pasta, which the owner said he was going to provide to anyone who ordered that burger. I haven’t had the pasta yet, but I’m sure it’s quite good.

I think I might go back again soon. While I typically don’t repeat a restaurant while trying to sample new places and new foods, as a new restaurant I expect the quality to be quite high for their other dishes, too.

Posted in everyday | Tagged: | No Comments »