BUG Community

Welcome! Log In

jconnolly's Blog

Friday afternoon remote debugging, remotely.

I had the opportunity to work on a nasty little defect from home this afternoon.  Some background:

Fast foward to yesterday where I've successfully been able to cross-compile and osgi-ify libbatthew , java-dbus , and bluecove.  With all that stuff built, I wanted to run a quick test and make sure all the build mojo was worked out (linking, cross compilation, bluez4 compatibility, openjdk-6 & classpath compaibility).  I planned to use the bluecove-tester-app.jar to test and make sure that java/jni/bluez interaction works at the basic device-scan level.  I stick all the jni libs in the right places and give it a whirl aaaand:


root@bug20:~# java -Djava.library.path=/usr/lib/jni/ -cp /usr/share/java/com.buglabs.bug.jni.bluecove.jar:/home/root/junit.jar:. -jar bluecove-tester-app.jar --console

BlueCove tester Console application (keyboard codes the same as in MIDP application) 2 - Start Client 3 - Stop Client 5 - Start Server 6 - Stop Server * - Run Discovery 7 - Services Search d - toggle BlueCove Debug T - Start TCK Agent q - Quit * error start error java.lang.UnsatisfiedLinkError: com.intel.bluetooth.BluetoothStackBlueZ.nativeGetDeviceID(IJ)I java.lang.UnsatisfiedLinkError: com.intel.bluetooth.BluetoothStackBlueZ.nativeGetDeviceID(IJ)I at com.intel.bluetooth.BluetoothStackBlueZ.nativeGetDeviceID(Native Method) at com.intel.bluetooth.BluetoothStackBlueZ.initialize(BluetoothStackBlueZ.java:136) at com.intel.bluetooth.BlueCoveImpl.setBluetoothStack(BlueCoveImpl.java:949) at com.intel.bluetooth.BlueCoveImpl.detectStack(BlueCoveImpl.java:482) at com.intel.bluetooth.BlueCoveImpl.access$500(BlueCoveImpl.java:65) at com.intel.bluetooth.BlueCoveImpl$1.run(BlueCoveImpl.java:1020) at java.security.AccessController.doPrivileged(Native Method) at com.intel.bluetooth.BlueCoveImpl.detectStackPrivileged(BlueCoveImpl.java:1018) at com.intel.bluetooth.BlueCoveImpl.getBluetoothStack(BlueCoveImpl.java:1011) at javax.bluetooth.LocalDevice.getLocalDeviceInstance(LocalDevice.java:75) at javax.bluetooth.LocalDevice.getLocalDevice(LocalDevice.java:95) at net.sf.bluecove.TestResponderCommon.initLocalDeviceConfig(TestResponderCommon.java:71) at net.sf.bluecove.TestResponderCommon.startLocalDevice(TestResponderCommon.java:66) at net.sf.bluecove.TestResponderClient.(TestResponderClient.java:124) at net.sf.bluecove.Switcher.createClient(Switcher.java:269) at net.sf.bluecove.Switcher.createClient(Switcher.java:262) at net.sf.bluecove.Switcher.startDiscovery(Switcher.java:326) at net.sf.bluecove.se.Console.main(Console.java:70) at net.sf.bluecove.se.Main.runConsole(Main.java:86) at net.sf.bluecove.se.Main.main(Main.java:54)


Ugly.  Looks exactly like my linker problem before.  Thankfully with the angstrom feeds being part of ipkg's config by default, it was easy enough to install ldd and determine if it linked correctly.  It didn't:

root@bug20:~# ldd libbluecove_arm.so         libc.so.6 => /lib/libc.so.6 (0x4000f000)         /lib/ld-linux.so.3 (0x2a000000) root@bug20:~#

Okay so recompile it and make sure it links with the appropriate -L flags to the cross compiler and now:


root@bug20:~# ldd libbluecove_arm.so         libbluetooth.so.3 => /usr/lib/libbluetooth.so.3 (0x4000f000)         libc.so.6 => /lib/libc.so.6 (0x4002a000)         /lib/ld-linux.so.3 (0x2a000000) root@bug20:~#

Looks good!  Except:

root@bug20:~# java -Djava.library.path=/usr/lib/jni/ -cp /usr/share/java/com.buglabs.bug.jni.bluecove.jar:/home/root/junit.jar:. -jar bluecove-tester-app.jar --console

BlueCove tester Console application (keyboard codes the same as in MIDP application) 2 - Start Client 3 - Stop Client 5 - Start Server 6 - Stop Server * - Run Discovery 7 - Services Search d - toggle BlueCove Debug T - Start TCK Agent q - Quit * error start error java.lang.UnsatisfiedLinkError: com.intel.bluetooth.BluetoothStackBlueZ.nativeGetDeviceID(IJ)I

WTF!!!  So I recheck everything and even recheck my knowledge of linking and gcc flags and am I even sure my parents are my parents?  You know, one of those kinds of afternoons.  I resigned to let it go and resume fixing it today, remotely.  Remotely remotely.  I mean using openjdk-6 built-in sweet sweet remote debugging capabilities.  The fact that this is BUILT IN to openjdk-6 (at least for the zero implementation) means you just follow the simple java remote debugging instructions for eclipse and that's it.  I can even do it via our VPN and access the BUG sitting on my desk in the office to test.  30 seconds of setup and you just start stepping through code.  It's beautiful.

One thing that perturbed me was that the exception stacktrace gave an UnsatisfiedLinkError and the last method in the stacktrace was BluetoothStackBlueZ.nativeGetDeviceID(IJ)I .  But as I step through the code,  I see:

    private int nativeGetDeviceID(int id, long findLocalDeviceBTAddress) throws BluetoothStateException {

No native declaration?  That means... it's uh, not native.  But wtf is going on here?  Who says it's native?

root@bug20:~# zipinfo bluecove-tester-app.jar | grep BlueZ.class -rw-r--r--  2.3 unx    20622 bx defN 25-Dec-08 17:55 com/intel/bluetooth/BluetoothStackBlueZ.class

Why you little sneaky jar you.  I see what's going on here.  In some old implementation of bluecove, this nativeGetDeviceID was uh, NATIVE.  In my newer (2.1.0) it's NOT native.  For backwards compatibility they kept the method name "nativeGetDeviceID" despite the fact that it's not a jni call anymore. 

But how can I be certain?  I mean, I demand satisfaction.  I need to know that this is indeed the cause of my problems.  Naturally, the jar is binary-only, meaning I can't just inspect the source for the godforsaken line.  But I need to know!  So I google around for a decompiler in linux and behold: JD-GUI for linux!   Sure enough:

created on: 07/30/10

ooh I so have you now.  You little defect you:

private native int nativeGetDeviceID(int paramInt, long paramLong) throws BluetoothStateException;  

Next time I'll uh, just download the tester jar without the mind-bendingly-subtle divergent API changes pre-bundled.  That could have saved me a lot of pain, but then it wouldn't have been so rewarding to figure out, now would it?

Post Comments

Add Your Comment!

Log in to leave a comment or Create an account

Glauben SIE , dass. DURCH this Weise k ? Nnen SIE Erwarten Wunder geschehen und Website- your Unter den Top - Suchergebnissen der michael kors handbags Suchmaschinen seins ? Nat��rlich Nicht . Your Webseite [linlei0929] sollte
ich sitzen durch eine weitere Mahlzeit Michael Kors crossbody bag mit diesem Yankeestepmother von ihr stehen kann ", michael kors hamilton tote " muss es nicht. zu schwer auf ihr, Michael Kors Handbags Stuart . Sie meint es gut . " michael kors outlet online sale store " Ich bin nicht schwer f��r sie . cheap Michael Kors bags Es
kam aus Virginia. Sie sagt Virginians wholesales michael kors bags online setquite ein Gesch?ft durch michael kors tote solche Dinge . " " Sie k?nnen 'em haben . Gebe

Welle von Frische und Dynamik Immermarkt auf Sich st ? Ndig ver ? Ndernden Welt , ?h E- Konkurrenten michael kors Steen NEBEN erforderlich Wir . Das Gesamte Geb?ude Web Image wholesale nba jerseys -��bung IST Eine feine mischung
Beruhigende Gewissheit , dass. nba jerseys Mit Dem Wissen Ihrer Familie sollte das. Nach Schlimmste Passiert Moncler Outlet Store WIRD betrachtet Werden Kommt . K ? Nnen SIE und new balance Ihre Familie ��berleben , WENN SIE NICHT MEHR
ungl��cklicherweise true religion outlet Ihre Familie . Life Insurance NZ Nur Wichtig IST , Louis Vuitton Outlet WENN Ihr Tod WIRD Markt auf Jemand Anderes finanziell auswirken [linlei] . Eine gute Lebensversicherung GIBT IHNEN sterben

deal could be the huge backpack with kate spade outlet little lunch bag and medium pencil case set You barbour outlet store can also have different kinds of finish on either side coach bags of paper for different effects
EMT training can supply you Louis Vuitton Outlet using the capabilities you are going to should aid preserve Kate Spade Bags life, your mindset also as comprehending are just as critical michael kors outlet because your understanding also as coachingWrite for a revenue sharing coach factory store sitesThis is a kind of new concept that a lot katespade.com of sites have taken into consideration This signifies that you kate spade new york do not have to spend a lot of money in chanel bags order to experience this sort of achievement for as long Michael Kors as you use your originality and utilise your resources to Louis Vuitton Sunglasses the best of its potentials the expert's job will be barbour online into

I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon. Máy tập cơ bụng fitness

Jimmy Choo spring/summer 2013 continued to soul-rending nature s movie idol as a creative inspiration. Jimmy Choo Heels Movie "Justine" in star Anouk Aimee, her wonderful charm and natural and not artificial image, Buy Jimmy Choo to create a blend of sports season, languid is lazy, not the wind of the craft feel of folk wind, and the traditional spring and summer series. Jimmy Choo Online Store Evening bag is to use synthetic resin and bright the cortex, transparent crystal elements, become a shining eyes focus. Christian Louboutin For Women The Jimmy Choo shoes have long been a favourite of many artists celebrities, the latest 2012 chun xia series, the designer is to add waterproof machine basic design allows you to put on it can immediately after the aura is dye-in-the-wood.

Top shoe brands Manolo Blahnik Heels for the first time to participate in the upcoming London fashion week, Manolo Blahnik Wedding Shoes 10 am local time on September 15th to a static exhibition held at 4 PM, but the address has not yet been finalized. Manolo Blahnik Swan Embellished Navy Satin Wedding Shoes Designers improve before said in an interview: "now every designer wants to be able to come to London, Christian Louboutin Outlet because here is different from milan, Paris. Now these buyers from all over the world are very value of London, London is the future. Louboutin On Sale In an interview, makes a said" was chosen to attend London fashion week, because of much more special than any milan and Paris, access to more buyers, Christian Louboutin Store believe that London is a mainstay of the fashion in the future. "

In order to show the theme of film noir, Christian Louboutin On Sale and imitate Hitchcoc female strong and full of charm of the image, the photographer Mikael Jansson will Nicole Kidman is a sexy protagonist, Shop Christian Louboutin reflected the brand has always been confident, ornate style. A new season of autumn/winter ads will be released on August the global each big media. Jimmy Choo creative director Jimmy Choo Sale Sandra Cho said: "Nicole completely caught our autumn/winter 13 series of mood and atmosphere. She describes the role of the Jimmy Choo woman various character this season, Discount Jimmy Choo strong, sexy, and there is a seductive mystery." "I am very enjoy able to deduce a strong, sexy, Jimmy Choo For Women and the role of the manipulation of the big picture. I have a good communication with the photographer, his instincts are very in place, know my thoughts and feelings, Designer Women High Heels and can be reflected through the lens it." Nicole Kidman says.

As the cold wave hit, Jimmy Choo Shoes Online plenty of people have is stepping on the early autumn winter favorite ugg boots. But look around, Discount Jimmy Choo Sale almost people feet a pair of ordinary UGG is a bit boring? Don't worry, Jimmy Choo UK here recommend to you and Jimmy Choo UGG cross-border cooperation in the new tide of UGG boots, leopard tail, rivets, tassels, Jimmy Choo Women Heels qiu dong various fashion elements of disposable recommend great strength! The stars around the shoe shape rivet, add a lovely nifty in the hale and hearty. Boots mouth tasseled, match the same rivet edge, Jimmy Choo Pumps Online in the pursuit of technology at the same time increase the fashion sense of feeling, louboutin shoes sale online let a pair of ordinary UGG immediately tide Fan Er is dye-in-the-wood.

"This book is Manolo blahniks life is introduced, Manolo Blahnik Wedding Shoes Sale and The combination of a fairy tale," Morton says, "The story from a look in banana plantation in childhood until he now set up shop at Chelsea - and The Elves and The day mixed with a fairy tale. Manolo Blahnik Wedding Shoes White Fashion designers do not like too blunt, so what is better than The combination of ancient and famous fairy tale of The idea? Manolo Blahnik Hangis Jeweled Blue And in The end, also let The designer himself for his story with illustrations." Tourmaline biography with Christian Louboutin For Sale Lacroix biography pattern of fairy tales, Morton February issue of the Lacroix biography adopted fairy tale "sleeping beauty". Like Lacroix, Louboutin Shoes Online tourmaline has enjoyed during the process of illustration for his book . Jimmy Choo Pumps

Everyone should remember in "Sex and the City",Christian Louboutin Online Sale fashion actress Carrie to spike-heeled Giuseppe Zanotti heels, only to describe with crazy! Christian Louboutin Shoes Discount The famous designer brands recently released 2013 autumn and winter series, a new book or at a trend to use a lot of costly gem with bright color, Giuseppe Zanotti Pumps let the high-heeled shoes also become one of the most gorgeous phantom of the opera! Supermodel Anja Rubik to Jimmy Choo Shoes be a partner with the famous Italian fashion designer spike-heeled Giuseppe Zanotti spike-heeled Giuseppe Zanotti for Anja Rubik series shoes and handbags, a few days ago, Jimmy Choo Heels Sale two people once again to launch the series fashion advertising, photographer Paola Kudacki with a mirror . jimmy choo shop

Summer sunshine glare, discount oakley sunglasses accompany you through time travel, is your holiday travel must-have products, both wild fashion and allow you to see the world clearly. Vacation time: more ultraviolet rays are blocked by effectively, let you enjoy this rare leisure time. Cheap oakley sunglasses are not only fashion people dress the perfect weapon, also protects the eyes and vision. Cool breaks modernist grandeur styling, smooth lines reveal the connotation you concise; surprise chic picture frame design, avant-garde modern; quality oakley sunglasses cheap lens, resist showing domineering light, care of your eyes. Decorative beautiful, shadowed eye defects, you can reduce the burden of regulation of the ciliary muscle of the eye in bright light, new oakley sunglasses block harmful rays, protect the eye from injury classic, simple designs, crosses between traditional and modern, perfect combination of mechanics and aesthetics.

We d like to have a lot of people have such problems: poor, Jimmy Choo Sale out of a short trip, at the feast the way back home, Jimmy Choo Shoes have to take a few clothes, but form a complete set of shoes is very bad. Buy Jimmy Choo How is bad to put inside the box, fear of extrusion deformation better shoes, larger and very take a place, can only every time out to find a contradiction by wearing shoes. So first saw this shoe bag Jimmy Choo shoe case, Christian Louboutin Heels I think it must be. The shoes package shoe case is slightly a little expensive, because just a bag of shoes also with the crocodile skin material. Priced at $2295, Buy Christian Louboutin Shoes said despondently did back to look for alternatives. Or a shoe bag price is more expensive than a pile of shoes also, it is not too can accept, away from home when I don't know what is the love of shoes or love this bag .
louboutin uk

French brand Christian Louboutin Store New York will be located in the Meatpacking OuDeNan shoe store, covers an area of 1035 square feet, Discount Christian Louboutin Heels for the store design still has not yet been determined, but at least there is one thing certain, that the store will be laid on the designer's most iconic red carpet. Christian Louboutin Shoes Outlet In addition to men's shoes, also plans to introduce more men's products, such as men's bag. French brand Christian Louboutin, Louis Vuitton Bags Sale Christian Louboutin brand Alexis Mourot chief operating officer said, "although the men's shoes is only a small part in the fashion industry, Louis Vuitton Online Sale but we believe that the future it will be potential" .

Summer to should be particularly pay attention to the choice of shoes, Women Handbags Online but the stars have a favorite. Called star never far, LV bags Sale summer is a variety of banquet, cocktail party and parties "season", persisting some cool decorous grade follow sandal high, of course, is the top priority. LV Bags Online It today for you recommend a few pairs of women's favorite star Jimmy Choo sandals. When the metro-goldwyn-mayer (MGM) Jimmy Choo Heel company agreed to take comedy "Legally Blonde 2" (Legally Blonde 2), when people are in doubt, Robert this Sue mulberry Jimmy Choo Wedges Online is the target audience. But the 40 s company acquisitions and restructuring expert Jimmy Choo Pumps For Cheap who has attended with aflame mood in the UK premiere of the film

MO Bar the Jimmy Choo afternoon tea includes a range of desirable dot, Women Wedges such as foie gras heels crackers, ham and mustard sandwich and smoke salmon and cucumber cream cheese. Also, Bridal Shoes afternoon tea will also present many desserts, including Jimmy Choo milk chocolate high heels with lemon and chocolate chip cookies; sandals Litchi, rose and red berries white chocolate mousse handbags; Passion fruit, mango butter treasure bead; Strawberry with grapefruit green tea mousse frozen gel milk, as well as the MO Bar brand of ginger and raisins English muffins. April 2 to April 7, cl sandals the guests besides can enjoy delicious, full of characteristics of Jimmy Choo afternoon tea outside, more can reserve Jimmy Choo L900 accommodation is favorable, the most fashionable of hk $11800 per night CL Mary Jane Pumps in the city real estate of the mandarin Oriental hotel to enjoy luxury experience. Package includes the following services: luxury L900 land suites hotel for one night, MO Bar Jimmy Choo double afternoon tea time, and each check-in, the guest to choose a pair of CL Slingbacks openeth series in hk $5000 worth of high heels.

Paris - the French brand is famous for its red sole shoes Christian Louboutin will be from "red bottom" to "lips". Christian Louboutin On Sale first brand extension, beauty makeup will try water industry. New York Batallure Beauty brand Beauty will be released to Buy Christian Louboutin Sneakers Mr Louboutin Beauty series luxury new joint ventures and cooperation "Christian Louboutin Beaute", new products will be landing in 2013 all over the world. Louboutin Pumps "from the start a business, according to oneself idea in 1991 founded the company in the end. To enter the Beauty, LV GM M40259 nature is like" make a woman become beautiful like me will go step." XieWang Christian Louboutin said. "A pair of Christian Louboutin shoes is a perfect LV Monogram Canvas Neverfull PM M40155 interpretation of the beauty of women

Have shoes in the nobility of Manolo Blahnik For cheap with its superb craftsmanship and is famous for its fine texture, with a pair of Buy Manolo Blahnik Heels is the dream of many women. 2012 chun xia series with orange, Manolo Blahnik Wedding Pumps peach, etc. A lot of bright candy color light girl of women. Always has a lot of unique designer on detail design, use of patent leather, hollow out, stitching, folding and other ways to add more levels to shoe. Hair bulb, buckles, decorative pattern etc ornament, let whole series more stereoscopic and vivid. Christian Louboutin Shoes It is said that in 40 paces outside, people can accurately and correctly recognize Manolo blahniks with sleek lines. Manolo blahniks heel generally in 10.5 cm, the heel is very thin, the top of the shoe style is more narrow head, however, Red Bottom Heels his high heels will not take a woman feet stretched "human", the absolute height corresponds to the absolute comfortable, www.clwomenheelsbd.net comfortable feel the existence of the shoes, don't say, is to run.

This is ms Diana li LAN Buddha actually told him in 1970, Manolo Blahnik Shoes but manolo seem more willing to take this as the call of god to him. When he left bare his card larry island, Buy Manolo Blahnik to abandon their studies at the university of Geneva, bound for Paris in the 1960 s, finally came to the United States fashion magazine editor fo ms li LAN's office. He carried a good friend ray parlour, Manolo Blahnik Wedding Heels Picasso references, and showed the Buddha li LAN he portrait of stage props (at that time he hopes to be a theatre designer). Christian Louboutin Heels Li LAN thought Buddha is at once noticed his shoes: a small pair of dean shoes, Edward belo market tao come back from the potter. Christian Louboutin Discount Shoes "Shoes are very tight, a little bunch of foot, it is a real pair of white deer leather shoes, very soft." He recalls. Christian Louboutin Sale

» All comments
» Comments RSS

Powered by Community Engine