active objects problem

by shadow » Tue, 18 Aug 2009 11:11:23 GMT


Sponsored Links
 Hi All,

   I'm facing a problem with creating active objects inside open core
node, i've a crash during constructing one and on AddToScheduler()
call inside ThreadLogon(). Here is a code example:

class Cmynode : public OsclTimerObject,
                         public PVMFNodeInterface,
                         public OsclTimerObserver,
                         ........
{
public:
Cmynode( int32 &aPriority )
: OsclTimerObject(aPriority, "MyNode")
{
    int32 err;
    OSCL_TRY(err,
                      m_pMyTimer = OSCL_NEW
( OsclTimer<OsclMemAllocator>,
                      ("MyTimer") );            // crash on
constructing

               // timer initialization
    );
}

~Cmynode() {
    //destructor code
}
        // PVMFNodeInterface implementation
public:
        virtual PVMFStatus ThreadLogon() {

                         if ( !IsAdded() ) {
                AddToScheduler();   // crash in this call
                 }

                     return PVMFSuccess;
                }

        virtual PVMFStatus ThreadLogoff() {

                 if ( IsAdded() ) {

                                Cancel();
                        RemoveFromScheduler();
                 }

                     return PVMFSuccess;
                }

// OsclTimerObject implementation
protected:
    virtual void Run() {
    }

private:
   OsclTimer<OsclMemAllocator> *m_pMyTimer;
};

--
 Best regards.

--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



active objects problem

by RaviY » Tue, 18 Aug 2009 11:35:14 GMT


 Can you try

OSCL_TRY(err,
         m_pMyTimer = OSCL_NEW ( OsclTimer<OsclMemAllocator>,
("MyTimer", 1000) );

-Ravi



--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---


Sponsored Links


active objects problem

by RaviY » Tue, 18 Aug 2009 11:49:14 GMT


 Nevermind, that will probably not help. Can you get a stack trace of
your crash? Did you try allocating something else? Say, a char buffer.
Does that work?

-Ravi




--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



active objects problem

by shadow » Tue, 18 Aug 2009 11:59:15 GMT


 i RaviY,

Thanks for the fast response, i've tried what you suggested, but
crash is the same here is a tracelog:

08-18 03:43:29.678: INFO/DEBUG(551): *** *** *** *** *** *** *** ***
*** *** *** *** *** *** *** ***
08-18 03:43:29.678: INFO/DEBUG(551): Build fingerprint: 'generic/
generic/generic/:1.5/CUPCAKE/eng.shadow.20090526.233815:eng/test-keys'
08-18 03:43:29.678: INFO/DEBUG(551): pid: 556, tid: 779 >>> /system/
bin/mediaserver <<<
08-18 03:43:29.688: INFO/DEBUG(551): signal 11 (SIGSEGV), fault addr
deadbaad
08-18 03:43:29.688: INFO/DEBUG(551): r0 00000003 r1 deadbaad r2
00000027 r3 ffff6150
08-18 03:43:29.688: INFO/DEBUG(551): r4 ffff6128 r5 afe2fef8 r6
afe39dd0 r7 000432b0
08-18 03:43:29.688: INFO/DEBUG(551): r8 40307b24 r9 afe39dd0 10
a9d2856d fp 405073fc
08-18 03:43:29.688: INFO/DEBUG(551): ip 0000001a sp 40507370 lr
afe1ff33 pc afe1066a cpsr 20000030
08-18 03:43:29.746: INFO/DEBUG(551): #00 pc 0001066a /
system/lib/libc.so
08-18 03:43:29.746: INFO/DEBUG(551): #01 pc 00027f10 /
system/lib/libopencoremkvsplitter.so
08-18 03:43:29.746: INFO/DEBUG(551): #02 pc 00027c98 /
system/lib/libopencoremkvsplitter.so
08-18 03:43:29.756: INFO/DEBUG(551): #03 pc 000295c0 /
system/lib/libopencoremkvsplitter.so
08-18 03:43:29.756: INFO/DEBUG(551): #04 pc 00028dcc /
system/lib/libopencoremkvsplitter.so
08-18 03:43:29.756: INFO/DEBUG(551): #05 pc 00028754 /
system/lib/libopencoremkvsplitter.so
08-18 03:43:29.768: INFO/DEBUG(551): #06 pc 0001facc /
system/lib/libopencoremkvsplitter.so
08-18 03:43:29.768: INFO/DEBUG(551): #07 pc 00020080 /
system/lib/libopencoremkvsplitter.so
08-18 03:43:29.778: INFO/DEBUG(551): #08 pc 00020dec /
system/lib/libopencoremkvsplitter.so
08-18 03:43:29.778: INFO/DEBUG(551): #09 pc 00014be0 /
system/lib/libopencoremkvsplitter.so
08-18 03:43:29.778: INFO/DEBUG(551): #10 pc 0001bad4 /
system/lib/libopencoremkvrecognizer.so
08-18 03:43:29.787: INFO/DEBUG(551): #11 pc 000ec4bc /
system/lib/libopencore_player.so
08-18 03:43:29.787: INFO/DEBUG(551): #12 pc 000d75ee /
system/lib/libopencore_player.so
08-18 03:43:29.797: INFO/DEBUG(551): #13 pc 000e0238 /
system/lib/libopencore_player.so
08-18 03:43:29.797: INFO/DEBUG(551): #14 pc 000ecdc0 /
system/lib/libopencore_player.so
08-18 03:43:29.807: INFO/DEBUG(551): #15 pc 000594b2 /
system/lib/libopencore_common.so
08-18 03:43:29.807: INFO/DEBUG(551): #16 pc 00059568 /
system/lib/libopencore_common.so
08-18 03:43:29.807: INFO/DEBUG(551): #17 pc 0005961e /
system/lib/libopencore_common.so
08-18 03:43:29.817: INFO/DEBUG(551): #18 pc 000f04fc /
system/lib/libopencore_player.so
08-18 03:43:29.817: INFO/DEBUG(551): #19 pc 000f05c4 /
system/lib/libopencore_player.so
08-18 03:43:29.826: INFO/DEBUG(551): #20 pc 000285d4 /
system/lib/libutils.so
08-18 03:43:29.826: INFO/DEBUG(551): #21 pc 0000f880 /
system/lib/libc.so
08-18 03:43:29.826: INFO/DEBUG(551): #22 pc 0000f3f4 /
system/lib/libc.so
08-18 03:43:29.836: INFO/DEBUG(551): stack:
08-18 03:43:29.836: INFO/DEBUG(551): 40507330 00044e08 [heap]
08-18 03:43:29.836: INFO/DEBUG(551): 40507334 afe0e940 /system/
lib/libc.so
08-18 03:43:29.846: INFO/DEBUG(551): 40507338 afe3c



active objects problem

by shadow » Tue, 18 Aug 2009 11:59:58 GMT


 Yes, other allocation of arrays or/and objects work.

--
 Best regards.





--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



active objects problem

by RaviY » Tue, 18 Aug 2009 12:36:34 GMT


 And, how does your test code look like? Did you make sure you have
initialized OsclBase, Error, Memory, and Scheduler?

-Ravi






--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



active objects problem

by shadow » Tue, 18 Aug 2009 12:48:16 GMT


 y test application is a simple Java based media player.

What does it mean: "Did you make sure you have initialized OsclBase,
Error, Memory, and Scheduler."?
How can i be sure that is for example, Scheduler has been initialized?
can you give me some advise?

--
Best regards.

On 18 , 11:36, RaviY <yend...@pv.com> wrote:
--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



active objects problem

by shadow » Tue, 18 Aug 2009 15:13:35 GMT


 t seems that node' thread doesn't have scheduler, because even i if
call OsclExecScheduler *pCurrentScheduler = OsclExecScheduler::Current
(); i've a crash. Do you have any ideas? why scheduler isn't created?
Thread context is valid... i've been checking it like this:

fprintf( m_pLogFile, "CMyMkvNode::CMKVNode( int32 &aPriority ):
iThreadContext = 0x%08x;\tThread's ID: %d\n", &iThreadContext,
iThreadContext.Id() );
fflush( m_pLogFile );

the following call causes a crash too:
fprintf( m_pLogFile, "CMyMkvNode::CMyMkvNode( int32 &aPriority ):
ThreadHasScheduler = %d\n", iThreadContext.ThreadHasScheduler() );
fflush( m_pLogFile );

--
Best regards.

On 18 , 11:36, RaviY <yend...@pv.com> wrote:
--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



active objects problem

by RaviY » Tue, 18 Aug 2009 22:12:35 GMT


 an you explain in more detail about the changes that you are making?
a. Are you using the existing java MediaPlayer APIs to create the
underlying player?
b. If your code does go through playerdriver, can you enable the
"debug" logs in playerdriver.cpp
c. Where did you modify the native code to add this new AO?

-Ravi

On Aug 18, 2:12am, shadow <yuri.bul...@gmail.com> wrote:
--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



active objects problem

by fadden » Wed, 19 Aug 2009 03:48:11 GMT


 

  ...
  ...

0xdeadbaad is currently used when somebody calls abort().  If this
trace is correct, the code in libopencoremkvsplitter is deliberately
aborting.

--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



active objects problem

by shadow » Wed, 19 Aug 2009 17:41:41 GMT


 hanks a lot for the help... the reason of crash was in not correct
linked libraries.

--
Best regards.

On 18 , 21:12, RaviY <yend...@pv.com> wrote:
--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Other Threads

1. Inserting a contact / Android architecture

I have a question on inserting a contact, but it's the general
principle I'm most interested in.  I'd really love to hear from one of
the Android Engineers on this, because currently I find some of the
design decisions in Android perplexing, and I'd like to understand why
it is as it is.

The most direct way to insert a contact seems to be to use
Contacts.People.createPersonInMyContactsGroup(...).  Something like
this:

        ContentValues values = new ContentValues();
        values.put(People.NAME, "Bernie");

        Contacts.People.createPersonInMyContactsGroup(
                        getContentResolver(),
                        values);

We're constructing the person entity as a map.  This brings up a few
potential problems:
1. How do we know what the keys should be?  By convention Android's
own classes (such as People) declare static constants to tell us what
those keys should be, but this is only a convention.
2. How do we know what datatype is appropriate for a given key?
There's nothing to stop you or warn you when you push the wrong type
of data in.
3. How do we know what combination of keys is valid?  If a given
entity has mandatory properties, there's nothing to stop you or warn
you if you forget to set some of those mandatory properties.
4. We're potentially allocating two objects for every value - one for
the value itself and one for the key.  Where we use static constants,
this is less of an issue.

Why does the API not provide a Person object that we can populate and
then pass in to be persisted?  Perhaps something like this:

        Person p = new Person("Bernie");
        p.addGroupMembership("My Contacts");

        getContentResolver().insert(Person.CONTENT_URI, p);

The Person class tells clearly us:
1. What values can be set (by the existence of bean properties)
2. What datatype each property is
3. What values are are mandatory (probably by virtue of them being
required in constructor calls)

Is it a classloading issue?  I'm guessing no because we could easily
overcome that by making Person Serializable or Parcelable, splitting
it out into a JAR to be linked into whatever app needs it.

So what then is the philosophy that has driven the architecture to be
this way?


brnzn

--~--~---------~--~----~------------~-------~--~----~

2. Charging for Apps

How are the 3rd party companies that let you charge for your apps.

Do they work well?  Is it a pain for the users to pay?

Any comments would be appreciated,

Thanks

--~--~---------~--~----~------------~-------~--~----~

3. Why does my init file can not work?

4. Kalman Filters for the GPS data

5. SharedPreferences are getting erased

6. Rotation Redux: how to MAKE it auto-rotate!

7. To Play .mp3 from host machine filesystem