IRC Log Viewer » #firebreath » 2010-12-11

IRC Nick Time (GMT-7) Message
Sinisa 07:12 hello everyonw
everyone
jshanab 07:12 Good Morning
Sinisa 07:12 how's things?
jshanab 07:12 Stuck on a bug for 2 days, crashes when plugin exits (but it does it to any browser :-) )
Sinisa 07:12 got question regarding Cocoa-CA drawing model - I've tried to add CAOpenGLLayer-based object to CALayer I get from FB's Cocoa-CA window, and added few OpenGL drawing instructions in drawInCGLContext function (just glClear with pure-red clear color), but I don't see it in neither Chrome nor Safari
for plugin exit - probably some memory cleanup
I've used FB on Win, works like a charm
and I got lot of things happening there , OpenGL drawing, face recognition, camera feed etc...
but I'm stuck with Mac port
I gave up supporting Firefox3.x since CG is so f**** slow in copying image from OpenGL buffer
anyway Firefox4 is on the way
but I have never used CoreAnimation before
jshanab 07:12 It is comically strange. After the desturctor it enters the firefox code, but then suddenly jumps back into thte code and runs the same line in the destructor again, but this time mutexes are hosed and it goes blah. I am playing the comment out code-build buinary search now.
Sinisa 07:12 so I'm confused a bit - I did used cocoa on iPhone projects, so I'm familiar with ObjC and I'm confident it's all initialized well - but still see nothing there
are you having multiple threads?
jshanab 07:12 I wish i could help with the mac stuff, I will have to work on that next. but i do not have the experiance. My code also works in FF and IE and used to work in Chrome and safari, for some reason, it just displays a grey square now. So there are differences in the browsers, (aka I feel your pain)
Sinisa 07:12 u're on Windows machine right?
if so, check out: http://ifoam.ponds.com.cn/game/index.html
it should ask you to download plugin (if agency did JS well) when you open it for first time
jshanab 07:12 thanks. Yeah windows after all these years. I was mostly linux B4
Sinisa 07:12 i'm curious if it will work properly on random machine (random being yours :-))
jshanab 07:12 loads flash
Sinisa 07:12 yeah flash is GUI
plugin will be loaded over as layer
once you get to the game screen
navigation is simple, although it's in Chinese
jshanab 07:12 I dunno, it is all in chinese. there are two littel webcams
Sinisa 07:12 u got webcam?
if so, click on the left one, if not, click on the right one
jshanab 07:12 there are webcam icons, one with a red button and one with a green but has a circle with red line thru it oon the camera
popup to open PondsFaceFoamSetup.rar
Sinisa 07:12 yup, left one is to play game with webcam, right one is if you don't have a webcam in your system
weird it's RAR, but ok
that's agency's decision
anyway it's installer
in it
(exe)
btw, done with NSIS if you ever need an installer wizard
real nice one
simple
free
jshanab 07:12 rar is not "recognised" as a plugin type I guess
Using NSIS now for my other code, trying the WiX for the plugin
Sinisa 07:12 haha, no, it's not. they just packed exe installer into rar, because most of office ppl here are connected through proxy, and proxy rejects any exe to be downloaded from the net
so you download rar, then unpack, you get exe installer - then you run it
I know it's weird, but that's how they do it here (in China)
just to check, when you run installer, it should say version 1.1
that's some recent update
jshanab 07:12 Actually, with all the trouble we have been having with windows activeX install loops becasue of security and peopel having to download in multiple browsers, It may be a good workaround
Sinisa 07:12 it is, but it requires users to know it's an archive, and that when they unpack it, they still need to run installer after that
but then most of networks here (not counting home computers of course) are having lot of restrictions, such as emails cannot have attachments other than images and pdf (basically you attach zip, smtp rejects it), or you cannot download any executable from the net etc.
Sinisa_ 08:12 ouch
jshanab - only webcam version is with plugin
no-cam version is still not set to be with plugin, but some old flash version
so select camera mode (left icon)
i just checked it, didn't know that only webcam mode is available
jshanab 08:12 good morning taxilian
taxilian 08:12 g'morning
MSI is really the best way to install plugins… less to go wrong than the other methods
but I've probably mentioned / preached about that to both of you already =]
jshanab 08:12 I have been using an MSI generated by the Wix and it works great
Ijust cannot get past this "crash on exit" bug
taxilian 08:12 I would really have to look at it; that's a tough one :-/
jshanab 08:12 Yeah, it must be order of destruction but every time it ends up calling a function twice. the "stop record function. The second time it is an invlaid call after returning to FF so it must still be on the stack somehow, the data is just off and it tries to re-loack a locked mutex.
taxilian 09:12 :-/
jshanab 09:12 But it uses boost shared pointer throuought, so it SHOULD be safe on order of shutdown
taxilian 09:12 aren't plugins fun?
jshanab 09:12 I am pulling my hair out with this one (and those who have seen me, know I can't keep that up for long :-) )
looks like a destructor is called twice.
taxilian 09:12 lol. well, like I said… it still sounds like a stack corruption issue to me :-/
jshanab 09:12 Agreed. I just cannot friggen find it!
taxilian 09:12 have you tried commenting things out to see if you can make it stop crashing?
jshanab 09:12 I am afraid i will ned to build FF in debug so I can follow it thru
taxilian 09:12 hmm. not a bad idea; it's actually not ridiculously hard, but it does take a little time
jshanab 09:12 Yes, If I comment out the player it of course doesn't crash, but with a producer-consumer pattern and threads it is unclear
taxilian 09:12 hmm
jshanab 09:12 Does the framework call destructors on registered functions when the plugin is destructed?
taxilian 09:12 registered functions?
the framework just lets things get destructed as they go out of scope (or in the case of shared_ptrs when the refcount hits 0)
we try really hard not to do any memory management directly (using new and delete, malloc and free) because those tend to lead to memory leaks
jshanab 09:12 in the JSAPI construcotr, we have all those register method calls. I thought those just added event entires into an event table, but wondering if there is a pending event caling a destructed object
taxilian 09:12 it's just a map of name -> functor
so when the map goes out of scope (with the object) it'll free all the functors inside it
but that won't call any destructors that you should care about
jshanab 09:12 Is there a "class diagram" and "Sequence chart" By any chance?
ok
taxilian 09:12 of which classes?
http://www.firebreath.org/display/documentation/Plugin+Lifecycle
I've tried to make a chart for that several times, but I can't seem to manage to make it clear
jshanab 09:12 thanks
taxilian 09:12 oooh… I think I figured out the problem I've been facing. if I can figure it out, I'll be really close to being able to support multiple MIME types on IE
jshanab 09:12 moving to new office , TTYL
taxilian 09:12 I have made major strides today on supporting multiple mimetypes in IE!
kalev 10:12 wohoo!
taxilian 10:12 now I just have to do crazy crazy cmake magic...
kylehuff 11:12 ugh... I cannot seem to statically include a library in my plugin on windows... no matter what I do it doesn't pack the .lib into the plugin and it looks for the dll
taxilian 11:12 umm
you know that .dll libraries have a .lib as well, right?
so if the .lib is for a .dll, it'll just tell your lib to use the dll?
kylehuff 11:12 hmm, no, I didn't know that.. it was months ago, but I am fairly certain I built the .lib without the dll.. I will rebuild the library and see if I get further. Thanks
taxilian 11:12 if it's including the .dll, then it was built as a dynamic library
kylehuff 11:12 well, I had built this library static, but there was another library that I didn't realize was linking to the shared version of that library.. /facepalm
taxilian 11:12 that would do it
jshanab 13:12 when i have an embed or an Object tag in my web page something that is <PARAM is obviously a param, what are all the other things like HEIGHT and WiDTH, PARAMS also? or arer those Properties
taxilian 13:12 don't use embed
well, those are treated like params on firefox
but I don't know how to get them in ie
jshanab 14:12 thanks. PS IE8 got them as params
taxilian 14:12 really? awesome
jshanab 16:12 grrr. I cannot believe this. estructor is called twice, std::deque destructed and a second attempt causes a rather nasty acess violation. But why? if there are two classes there would be 2 deques. it is valid enough to have a 3.7 gig size but getting an iterator crashes, no code to execute
taxilian 16:12 that definitely sounds strange
jshanab 17:12 taxilian. food for thought. My crazy crash is only iin FF,Safari, and chrome. all on the same wait for single object. Does this suggest anything?
In a rare twist of events, ie works
taxilian 17:12 hmm
not offhand
I'll think on it, though...
if you still haven't found it by Monday, I could probably find a little time that we could do a remote desktop and voice chat and I could try to help you with it
jshanab 17:12 thanks. in tracing it just arbitraily calls back from ff code into the destructor for the player, but with data scrambled. Code is there, instance data is not. freaky
taxilian 17:12 hmm
taxilian 18:12 yeah, that's really strange
last time I had a bug like that it took me three days to track it down
I just wrote the scariest (and yet in some ways coolest) cmake function of my life
it took me about 4 hours
jshanab 18:12 I AM on day4
taxilian 18:12 (for a cmake function, that's a lot)
jshanab 18:12 I just profiled the code, to see if that might tell me anything. The surprize is 77% time spent in a single function and it is spending all it's time in boost date from string!!!
taxilian 18:12 hmm. that's weird
I've never used the boost datetime stuff
but that seems a little excessive; is it really neccesary?
jshanab 18:12 a little! that is a lot
taxilian 18:12 =]
I am not often accused of exageration...
jshanab 18:12 The code (inherited) is storing timestamps as strings and convering them. apparently twice. First to fix when bug is found
taxilian 18:12 yeah; that does seem kinda… unoptimal
jshanab 18:12 Our software will have to display upwards to 40 cameras in one webpage at a low framerate and resolution. That would break that
taxilian 18:12 wow. that's a lot of images
yeah; I can definitely see how spending 77% of the time doing string processing would be a problem =]
jshanab 18:12 not bad at 6fps and qcif, which is 252x174
taxilian 18:12 not bad at all
impressive-ish, I mean
jshanab 18:12 Then the user will go into screens with larger images and higgher frame rates will always be less cameras
taxilian 18:12 I've done video in a browser; even 6fps, 40 cameras is a lot of data to throw around
cool
sounds like a good use of a plugin
I hope you'll show it to me when it's done
jshanab 18:12 the trick is to get the streams what you want from the camera and archive server and not some big high bandwith and letting the browser sscale it down (now)
http://events.jfs-tech.com/jshanab-1.1 is a test site of our web page
[email protected], admin
the existing plugins are there on the server but have awful install problems and i think the ie one is broken period
taxilian 18:12 cool; I'm on Mac right now, so I can't look at it
but I'll definitely do so next week
btw, I should mention that this chatroom is logged; do you want me to strip that username/password out of the logs?
jshanab 18:12 a better example is events.smartwire.com, but i would need to create an account
Well. I just "solved" my bug
taxilian 18:12 the 77% timestamp thing, or the one you've been fighting for 4 days
jshanab 18:12 removed the shared_ptr nad replaced it with a normal one.
taxilian 18:12 on what object?
jshanab 18:12 The one i have ben fighting for 4 days
taxilian 18:12 was that on your own object or on a FB object?
jshanab 18:12 Something wrong with boost shared pointer, MSVS and std::deque
(when in the FB framework.)
taxilian 18:12 what kind of object?
jshanab 18:12 The plugin instanitiates a cplayer that spawns a thread that pulls from a web service and displays. It has been a boost::shared_ptr<CPlayer>. and it's destructor was called twice, the second time the code was there, but the data section had already been destructed. The call came from the NPAPI some kind of re-bind
taxilian 18:12 hmm.
are you trying to use the shared_ptr from inside the constructor or destructor?
jshanab 18:12 but chrome and safari, which worked before just sit threr like a bump on a log, i can't win
taxilian 18:12 and how are you creating the CPlayer? with boost::make_shared?
jshanab 18:12 I haven't seen that. The just had a boost::shared_ptr in the class def and a m_player.reset(new CPlayer())
taxilian 18:12 hmm. would be better to assign m_player = boost::make_shared<CPlayer>()
don't know that that would cause your issue, though
I bet somewhere you're not using that shared_ptr correctly
jshanab 18:12 thanks for the heads up, i will try that
tomarrow... 12hours is enough for 1 day
taxilian 18:12 ooh… or maybe you're passing the CPlayer* instead of a shared_ptr<CPlayer>
that would totally do what you're seeing
if you then passed it into another function and then put it into a shared_ptr again
there would be two shared_ptrs both trying to point to the same object
so one goes out of scope, refcount hits 0 and destructs the object
then the other does the same
second destructor call, plugin go boom
jshanab 18:12 I would take tat bet. I am sure you are correct. I just can't find it and after a bit am wondering why i need it. At least this has confirmed that IS wheree the problem is!
taxilian 18:12 yeah; well, that gives you a better idea where to look
do a search for CPlayer*
or .get()
which is how you get the pointer out of the shared_ptr
or even shared_ptr<CPlayer>, since you'd have to call that to assign the CPlayer* to
FB_GitHubBot 18:12 FireBreath: master Richard Bateman * cb06136 (2 files in 1 dirs): Created configure_template cmake function which works like configure_file but supports @@foreach blocks - http://bit.ly/enw55a
jshanab 18:12 Time to read up on boost. Trick was it was existing code outside of FB that ran withuot issue if we could get it installed. It has ben flawless on the fF side, ie was the problem. just weird
taxilian 18:12 yeah; boost shared_ptr and weak_ptr are very very cool. they are actually in the c++0x spec
jshanab 18:12 TR1 baby, TR1
taxilian 18:12 ?
jshanab 18:12 the namespace for the boost stuff, not std:: but tr1:: "technical report 1"
Did they move it into std?
taxilian 18:12 not a clue
that's more than I know about it =]
jshanab 18:12 night
taxilian 18:12 g'night