IRC Log Viewer » #firebreath » 2012-12-19

IRC Nick Time (GMT-7) Message
KevinXi 05:12 Hi guys
Any body around, available for a short chat?
KevinXi 05:12 hmmm....
ConfusedDev 09:12 Any other suggestions for things I could try when compiling to get my plugin to work on Chrome? I feel like I've tried everything and it still is having a hissy fit
taxilian 10:12 ConfusedDev: did you ever check the console for error messages? or a crash dump?
ConfusedDev 10:12 I checked the console and everything was clear. Everything was loading and echoing (is that what its called?) correctly but it just suddenly stops. I compiled the old code into the plugin and the same issues occurred so im convinced it is an issue with how I am compiling the plugin
taxilian 10:12 oh, so it does start working initially, but then it crashes?
ConfusedDev 10:12 It starts exchanging information with the hardware for a bit, then it stops and the crash banner pops up
taxilian 10:12 okay
two things to do, then
first, in the Console app, look on the left under UserDiagnostic Reports
see if there are any Chrome entries
it could be your crash dump
second, try attaching a debugger to the plugin before that happens and you should be able to catch the crash in your debugger and see what is happening
ConfusedDev 10:12 There are Google Chrome Helper entries in the user diagnostic reports?
taxilian 10:12 there could be
some plugin crashes wind up there
others don't
I don't actually know what the difference is
ConfusedDev 11:12 So I actually do get an error in the middle of the hardware handshake, but the handshake continues. The error says" Uncaught Error: Error calling method on NPObject. read_all (anonymous function)
taxilian 11:12 Error calling method on NPObject usually means that an exception was thrown when calling a method on your JSAPI. the browsers don't report the exception message anymore, though
easiest way to track that down is either to add lots of logging or to attach a debugger
taxilian 11:12 Just finished a new screencast: Debugging FireBreath Plugins in Google Chrome on Mac
ConfusedDev 11:12 nice! Where can I access that?
taxilian 11:12 it's still loading on youtube, but it's http://www.youtube.com/watch?v=FFh5iMBqOkk
ConfusedDev 11:12 Great! Thanks!
jshanab 11:12 I have just found someone to test my MAC version of my plugin here in the office. Runs in my macbook air but not on their macbook pro. I do not know enough about the differences to guess what may be wrong. Should I be looking for missing libraries or are there considerable differences between them? Do I need to worry about what OS version is on them?
taxilian 12:12 I'd check OS version first
http://www.firebreath.org/display/documentation/Debugging+Plugins+on+Mac+with+Google+Chrome
jshanab 12:12 ok. What version should I "target" ? I am not going to have to worry about the 32/64 bit also am I (FF and safari only)
thanks.
taxilian 12:12 that's up to you; I target 10.5 and later for my plugins, but that's more than a bit of a pain. I'd probably target 10.6 and later if you can get away with it
to do that properly you'll probably need to use the 10.6 SDK
jshanab 12:12 ok, I targeted 10.7 64bit
I don't even have 10.6 on my machine
taxilian 12:12 depending on what the macbook pro is running he might even have a 32 bit browser
heh. I should get another clock to put on the wall and I'll have two of them. "GradeCam Standard" and "Local Time"
my work is an hour off of me
jshanab 12:12 Love timezones and DST. Always worth a day long meeting when combined with database discussions
Well the macbook pro's are lion 10.7.5 same as the air.
taxilian 12:12 hmm. then I don't know
jshanab 12:12 differnt graphics card though
My installer is probably incomplete. Is there a depends.exe equivelent? Can I use LDD on the .so
taxilian 12:12 you can use ldd, I would think
or otool
jshanab 12:12 otool forgot about that one
taxilian 12:12 heh. youtube is tweeting about my new videos in Russian… now I gotta figure out how to make it change my language back to English
oh, there it is
jshanab 12:12 LOL. First 2 weeks of my employment here was translating comment from russian to english to get into existing codebase.
taxilian 12:12 Why translate it? I can read it just fine :-P
jshanab 12:12 OMG. not me
taxilian 12:12 =] try living in Russia for a couple of years with very very few other english speakers around
you'll pick it up if you try
jshanab 12:12 Plus. the character set was not on my machine so it was gibberish until babelfish had a go at it
How do I safely get at the .so in an installed env? it is a "bundle" Which I am guessing is some kind of zip
ConfusedDev 12:12 So I followed along in the webcast and got the example working, but the video (not the audio) doesn't change after 5:06?
taxilian 12:12 ? the bundle is just a directory
go at it from the console is easiest
jshanab 12:12 oh
taxilian 12:12 ConfusedDev that's not good; let me go look
ConfusedDev 12:12 thanks!
jshanab 12:12 I am on the console and it says "not a directory" do I need to mount bind it?
taxilian 12:12 weird
jshanab: sorry, tell me exactly what you're looking at?
jshanab 12:12 I have CDed into /Library/Internet Plug-Ins/MVSArchivePlayer.plugin/Contents/MacOS and there is a MVSArchivePlayer in there which file says is Mach-O 64-bit bundle
taxilian 12:12 ConfusedDev: ooh, that's annoying. So the video didn't record correctly. I went through the beginning but didn't watch to the end
the video is bad, I'll have to redo it
that's really frustrating =]
jshanab: that's the dylib
that's what you're looking for
it isn't an archive
jshanab 12:12 That does suck.
taxilian 12:12 that's your binary
jshanab 12:12 To bad you don't have an analog source backup
taxilian 12:12 jshanab: I have the original file, but it didn't record correctly, so there is nothing in the source to recover
jshanab 12:12 Well, It will be perfect this time ;-)
5 min used to be the limit on JIVE when the license was not updated, right?
taxilian 12:12 right
jshanab 12:12 I think I see my problem (remember, I thought it was small) All the libs it depends on are being found in my development machines /usr/local/lib and such. I have 2 problems. Looking in the wrong place and maybe not packaed
taxilian 12:12 yeah, that's always fun
you might have to use install_name_tool to adjust that
jshanab 12:12 In the normal flow of dmg packaging, I must of missed the steps where I have to explictly package the libs I need, and not just the images
taxilian 12:12 ahh
so I think I'm going to try to make this tutorial much more succinct; I rambled too much in the last one
ConfusedDev 12:12 I liked the rambling
jshanab 12:12 "good philosophy, see good in bad"
I think ConfusedDev may have a point. If it is so succint that it flies by to fast, it won't sink in LOL
Do I use the "Working with bundles" technique to add the libraries to the dmg/bundle
taxilian 12:12 well, this is still me. it's still rambling =]
but it's about a minute shorter
ConfusedDev 12:12 yess! Thanks!
taxilian 12:12 ConfusedDev: thanks, btw, for telling me the video was broken
new one is exporting and uploading
should be about 10 minutes
ConfusedDev 12:12 great! Thanks so much for helping me out the past few days
taxilian 13:12 here is the new video: http://www.youtube.com/watch?v=JdY8ycdpAO8
kylehuff 13:12 taxilian: the issue I am having with chrome memory corruption occurs even when no firebreath plugin is loaded -- so I'd say it is unrelated to the changes in firebreath.
taxilian 13:12 oh, good
kylehuff 13:12 I think I am missing something fundamental in C... I just don't understand instances of structs and how to modify/alter them
jshanab 13:12 They are like anything else, can be created on the stack or the heap. If on the stack, they will dissapear at end of scope, If on heap, they stick around until you free them.
Pointer to struct is what you will get back form the new (or malloc, is this C or C++?) I assume since you are in FireBreath, you are really talking C++ in which "structs are classes with all members public" is another way to look at them.
kylehuff 14:12 yeah, I get that part... I have sat here and tried to type out what I don't understand, and I can't explain it. I think I have to give an example in order to articulate what I'm struggling with.
jshanab 14:12 I am a bit confused on the library issue with my Mac plugin. I have them in my own location but when I run otool -L on the installed package it shows where one might of installed it on the system. Is this encoded in the library? Or encoded into the plugin during linking? Is it just doing the normal look in system locations first like most *nix's do? How do I tell the plugin to look in it's...
...directory first like it does on windows and linux
oh. yuck -rpath
ConfusedDev 14:12 So I followed the video and got the example to work and debug ect, Did the same thing with my plugin and it didn't work
jshanab 14:12 Here is a technique I use. In firefox with single process mode set, I got to google and attach with xcode open in my project. I place a breakpoint on static initalize and load the the FBControl.htm
It should stop at that point and you can step from thre until it segfaults or whatever. If it does not make it that far, then it failed to load dependent libraries and you need to track that down outside the debugger
taxilian. I saw the wiki pages that mention the install_name_tool. I'd like to automate and would like to know where do I put those functions and function calls.
kylehuff. Sorry, missed the reply. Feel free to pastebin a snipit and an error if you got it
ConfusedDev_ 14:12 I am so confused.. and Im not even a real web dev...
kylehuff 14:12 jshanab: I forgot my own reply. lol. I was reading through a C book trying to make sense of this. here is an example of what I am trying to do, and where I am confused: http://pastebin.com/raw.php?i=HMEMBV9n
ConfusedDev_: still fighting with loading your plugin in Chrome on OSX?
ConfusedDev_ 14:12 Yessir.
kylehuff 14:12 have you been able to get the debugging going that [email protected] had referenced?
jshanab 14:12 kylehuff. Ok I think I see the overall arch (a bit hard in black and white) First of all it will be really really critical on this to zero out structs on allocation so the next pointers are detectec null or segfaulkts will be generated. Also there may be some fun in the deep copy vs shallow copy where the char* ends up with two structs pointing to the same actual value memory.
ConfusedDev_ 14:12 @kylehuff I have not been able to get the debugging working, but I am 90% sure its not my code; its the way in which I am compiling that I am screwing up. I ran old versions of the code from our SVN that have been tagged as working and I had the same problem with all of them
kylehuff 14:12 jshanab: sorry, I have a habit of using the raw version of pastebin, the colors confuse me; I mostly only use vi.
taxilian 15:12 okay, I am back
jshanab 15:12 taxilian. Welcome back ;-) I have been working on that install_name_tool usage but I have not figured out exactly where to put the cmake commands illustrated on the wiki. I assume in mac/ProjectDef.cmake. Functions at the top, the rest a bit furthor down.
taxilian 15:12 basically you're going to want to make it a post-build step
which means it has to be after your add_mac_plugin line
jshanab 15:12 ah ha. I made a bad guess
How do we handle in directory version symlinks
jshanab 15:12 While the owner is ok, I get a permission error. I think because libs are "read only"
taxilian. Do you run xcode as root?
taxilian 15:12 nope
you don't ever want to change the actual installed libs
if you're going to distribute the libs with your plugin then you should copy them into your bundle and then modify the copies
jshanab 15:12 I am trying the automation on the wiki and it stops after the copy in the function calling install_name_tool. It throws write permission error. I already have a copy of these libs in my source control, should I make them writeable there?
taxilian 15:12 I would never modify the originals
always copy them into the .plugin/ bundle with the cmake post-build step and then change it there
jshanab 15:12 ok so add another post command to change the write permissions
taxilian 15:12 could be
ConfusedDev 16:12 So I ran the FBControl.htm that the Mac video described and it said my plugin was loaded correctly and everything in Chrome and it worked? But it isnt happy on our site
jshanab 16:12 "isn't happy on our site" ? what does this mean, same plugin? differnt web site or differnt plugin
ok,ok, sorry same plugin different site
So do you have params passed to your plugin from the html? if so now you should place a breakpoint on onPluginReady and step thru making sure you get the proper values
ConfusedDev 16:12 I have parameters passing from JS?
jshanab 16:12 I do not know, I am asking. You seem to be indicating that the plugin loads with the HTML provided and not with the HTML from your company site. We need to comapre the two HTML's
taxilian 16:12 find out what is different
are you using an embed tag on your company page?
ConfusedDev 16:12 so apparently we are doing everything in javascript, no html
taxilian 16:12 oksy
okay
but you're still injecting it into the html using javascript
how are you doing that?
ConfusedDev 16:12 Ok, Ihab is here and he developed the JS. The last question, Ihab, was "but you're still injecting it into the html using javascript how are you doing that?"
ihab 16:12 no the hole website is javascript and i am injecting html into the javascript when i want to display things
taxilian 16:12 right; what is the html
?
ihab 16:12 i am not sure that i am getting the question
what do u mean by what is the html ?? sorry
taxilian 16:12 what html do you inject into the page?
what does it look like?
or pastebin (fpaste.org) the javascript code that does the injection if that's easier
ihab 16:12 just regular divs
taxilian 16:12 nope, try again
(plugins don't work with regular divs, you are putting in an object or embed tag)
ihab 16:12 yes there is an object to call the plugin
taxilian 16:12 good good. when it is put into the page, how is that done? text, or createObject, etc?
ihab 16:12 <object id="x" type="application/x--x" width="1" height="1">' + '<param name="onload" value="' + id + '" /></object>
taxilian 16:12 … and I guess id is the name of a global javascript function?
(that's exactly what I was looking for, btw, thanks)
ihab 17:12 yes
taxilian 17:12 okay. ConfusedDev, my guess then is that your problem is caused by whatever other calls are made to the plugin on your real site that weren't made to the plugin in the raw FBControl.htm
ConfusedDev 17:12 Make a test site that tries one call at a time till one fails?
taxilian 17:12 you could try that, yes
you could also try adding logging
where was the breakpoint you set when you tried debugging?
did you actually reproduce the crash while connected with the debugger?
ConfusedDev 17:12 onPluginReady
I was unable to reproduce the crash
taxilian 17:12 you know you can debug with your real page, right?
ConfusedDev 17:12 yea, just trying to get that working
taxilian 17:12 put the breakpoint elsewhere
maybe in the constructor
could be that function isn't called
jshanab 17:12 taxilian. I learned 2 things as I managed to get most my libraries connected. Wrapping the install_name_tool withn chmod +w and chmod -w works well and there are problems building twicw in a row, files already exist and cause fatal errors. So me tweaking to those functions will be needed to get around that.
taxilian 17:12 if you're only changing files you copied, why do you need to chmod -w?
and you can just tell it to delete them if they exist already and replace them
jshanab 17:12 libraries are readonly, copying them is also readonly
the chmod IS changing the copied file
taxilian 17:12 great
so don't bother doing a -w
'cause who cares?
then you can overwrite it
jshanab 17:12 oh, duh. The -w. The -w is just cause readonly is the convention. Clean up after myself
The delete if already exist is the tweak I was talking about wanting to add to those cmake functions
I think I have one more library to add, but all people with macs have gone home so testing is done for the night ;-) I was just wondering if you'd like me to comment or adjsut the wiki
taxilian 17:12 hehe. if you feel it needs it
jshanab 17:12 It won't run in most cases without it
At least I am pretty sure, here is all I did http://pastebin.com/iwn63bBS
taxilian 17:12 none of the libraries I have used it on were −w
jshanab 17:12 Ok, I will hold off of updateing the wiki unless others find this also. Maybe it was just learning pains.
taxilian 17:12 ok
jshanab 17:12 Heading home....
taxilian 17:12 g'night
ConfusedDev 17:12 Goodnight! Thanks!
ConfusedDev_ 17:12 I also noticed that in a video, you said your plugin was about 500k. Mine is 10.6MB. is that weird?
taxilian 17:12 couple of possibilities:
1) you may have a lot more libraries than I do included
2) you could be building the debug version and looking at that
3) I'm talking about the installer size, which is compressed
anyway, I gotta run. might be back on tonight.