Feed for discussion General in project Wind River® VxWorks® Migration.
http://community.qnx.com/sf/discussion/do/listTopics/projects.proj1116/discussion.general
Posts for Generalpost74423: Related API in QNX for repeat()
http://community.qnx.com/sf/go/post74423
Can any one suggest an related API for repeat() (VxWorks API) in QNX.
Or suggest me how to implement same in QNX.
Thanks,harish kumar2010-11-12T07:08:49Zpost47094: Where are events?
http://community.qnx.com/sf/go/post47094
Hi,
I have seen the library but it lacks the eventLib feature.
What about it?
Mario.Mario Mastrodicasa2010-02-11T09:02:47Zpost43383: RE: Seg fault?
http://community.qnx.com/sf/go/post43383
So, yeah, what I had to do was call usrInit from my QNX main task, then
use spawnTask to spin off a VxWorks task and get that stuff rolling.
Appears to have fixed the problem...
M
-----Original Message-----
From: Shiv Nagarajan [mailto:community-noreply@qnx.com]
Sent: Tuesday, December 08, 2009 1:28 PM
To: general-proj1116
Subject: Re: Seg fault?
just curious do you create any tasks?
or do u call kernelInit or usrInit any where in your code?
the only way I see the tcb being null, is if it is called from a qnx
thread, that is not a "vx works task"
shiv
Tue Dec 8 13:33:50 EST 2009Mike Medved2009-12-08T19:10:34Zpost43381: Re: Seg fault?
http://community.qnx.com/sf/go/post43381
just curious do you create any tasks?
or do u call kernelInit or usrInit any where in your code?
the only way I see the tcb being null, is if it is called from a qnx
thread, that is not a "vx works task"
shiv
Tue Dec 8 13:33:50 EST 2009
--> According to Mike Medved <--
I statically linked the library, I'm not sure what a core file is... if
you explain, I'm sure I've got it/ can get it.
M
-----Original Message-----
From: Shiv Nagarajan [mailto:community-noreply@qnx.com]
Sent: Tuesday, December 08, 2009 11:04 AM
To: general-proj1116
Subject: Re: Seg fault?
In the crash, do we know what the values of my_tcb was? (its the
argument to the function, __vx2qnx_sched_lockout
Would you be able to provide a core file, with statically linked
executable with symbols?.. so I can look at it in the debugger?
shiv
Tue Dec 8 11:09:21 EST 2009
--> According to Mike Medved <--
Lots of header changes to the VxWorks stuff. It was pretty
nasty, which
is why I posted my question on the forum - if there were clean
ones that
everyone knows would work, I'd use those.
Here is an example - this is the code that is causing the
segfault:
STATUS MTelemetryHandler::registerHandler( MTelemetryHandler *
This )
{
MTelemetryHandler* cur = first;
// Create the mutex semaphore if this is the first handler
taskLock();
if (first == NULL)
protect = semMCreate (SEM_Q_PRIORITY |
SEM_DELETE_SAFE
| SEM_INVERSION_SAFE);
taskUnlock();
// Take the mutex
semTake (protect, WAIT_FOREVER);
// Go until we find an entry point
This->prev = NULL;
This->next = first;
while ((cur != NULL) && (cur->this_rank <=
This->this_rank))
{
This->prev = cur;
cur = cur->next;
This->next = cur;
}
....
The first call to taskLock() is what gives the seg fault. I
compiled
the vx2qnx lib with the source that came in the archive with
debug
symbols, where the error is occurring in the library is shown in
the
following screen cap.
As you can see in the call stack, I'm a couple of calls deep in
the init
stuff of my application.
This help?
M
-----Original Message-----
From: Shiv Nagarajan [mailto:community-noreply@qnx.com]
Sent: Tuesday, December 08, 2009 10:38 AM
To: general-proj1116
Subject: Re: Seg fault?
Sorry for the delayed response,
these functions are functions inside (com_* etc) the vx works to
qnx
lib. Can you post some more of the code that is linking against
the
vx2qnx lib? What sort of header changes did you need to make to
get to
this point?
shiv
_______________________________________________
General
http://community.qnx.com/sf/go/post43366
_______________________________________________
General
http://community.qnx.com/sf/go/post43368
--
****
Shiv Nagarajan,
Kernel Developer, QNX Software Systems,
Ottawa, Canada
****
_______________________________________________
General
http://community.qnx.com/sf/go/post43372
_______________________________________________
General
http://community.qnx.com/sf/go/post43373
--
****
Shiv Nagarajan,
Kernel Developer, QNX Software Systems,
Ottawa, Canada
****Shiv Nagarajan(deleted)2009-12-08T18:27:47Zpost43376: Re: headers?
http://community.qnx.com/sf/go/post43376
Answer:
\src\lib\vx2qnx\public\vx2qnxMike Medved2009-12-08T16:17:13Zpost43373: RE: Seg fault?
http://community.qnx.com/sf/go/post43373
I statically linked the library, I'm not sure what a core file is... if
you explain, I'm sure I've got it/ can get it.
M
-----Original Message-----
From: Shiv Nagarajan [mailto:community-noreply@qnx.com]
Sent: Tuesday, December 08, 2009 11:04 AM
To: general-proj1116
Subject: Re: Seg fault?
In the crash, do we know what the values of my_tcb was? (its the
argument to the function, __vx2qnx_sched_lockout
Would you be able to provide a core file, with statically linked
executable with symbols?.. so I can look at it in the debugger?
shiv
Tue Dec 8 11:09:21 EST 2009
--> According to Mike Medved <--
Lots of header changes to the VxWorks stuff. It was pretty
nasty, which
is why I posted my question on the forum - if there were clean
ones that
everyone knows would work, I'd use those.
Here is an example - this is the code that is causing the
segfault:
STATUS MTelemetryHandler::registerHandler( MTelemetryHandler *
This )
{
MTelemetryHandler* cur = first;
// Create the mutex semaphore if this is the first handler
taskLock();
if (first == NULL)
protect = semMCreate (SEM_Q_PRIORITY |
SEM_DELETE_SAFE
| SEM_INVERSION_SAFE);
taskUnlock();
// Take the mutex
semTake (protect, WAIT_FOREVER);
// Go until we find an entry point
This->prev = NULL;
This->next = first;
while ((cur != NULL) && (cur->this_rank <=
This->this_rank))
{
This->prev = cur;
cur = cur->next;
This->next = cur;
}
....
The first call to taskLock() is what gives the seg fault. I
compiled
the vx2qnx lib with the source that came in the archive with
debug
symbols, where the error is occurring in the library is shown in
the
following screen cap.
As you can see in the call stack, I'm a couple of calls deep in
the init
stuff of my application.
This help?
M
-----Original Message-----
From: Shiv Nagarajan [mailto:community-noreply@qnx.com]
Sent: Tuesday, December 08, 2009 10:38 AM
To: general-proj1116
Subject: Re: Seg fault?
Sorry for the delayed response,
these functions are functions inside (com_* etc) the vx works to
qnx
lib. Can you post some more of the code that is linking against
the
vx2qnx lib? What sort of header changes did you need to make to
get to
this point?
shiv
_______________________________________________
General
http://community.qnx.com/sf/go/post43366
_______________________________________________
General
http://community.qnx.com/sf/go/post43368
--
****
Shiv Nagarajan,
Kernel Developer, QNX Software Systems,
Ottawa, Canada
****
_______________________________________________
General
http://community.qnx.com/sf/go/post43372Mike Medved2009-12-08T16:06:33Zpost43372: Re: Seg fault?
http://community.qnx.com/sf/go/post43372
In the crash, do we know what the values of my_tcb was? (its the
argument to the function, __vx2qnx_sched_lockout
Would you be able to provide a core file, with statically linked
executable with symbols?.. so I can look at it in the debugger?
shiv
Tue Dec 8 11:09:21 EST 2009
--> According to Mike Medved <--
Lots of header changes to the VxWorks stuff. It was pretty nasty, which
is why I posted my question on the forum - if there were clean ones that
everyone knows would work, I'd use those.
Here is an example - this is the code that is causing the segfault:
STATUS MTelemetryHandler::registerHandler( MTelemetryHandler * This )
{
MTelemetryHandler* cur = first;
// Create the mutex semaphore if this is the first handler
taskLock();
if (first == NULL)
protect = semMCreate (SEM_Q_PRIORITY | SEM_DELETE_SAFE
| SEM_INVERSION_SAFE);
taskUnlock();
// Take the mutex
semTake (protect, WAIT_FOREVER);
// Go until we find an entry point
This->prev = NULL;
This->next = first;
while ((cur != NULL) && (cur->this_rank <= This->this_rank))
{
This->prev = cur;
cur = cur->next;
This->next = cur;
}
....
The first call to taskLock() is what gives the seg fault. I compiled
the vx2qnx lib with the source that came in the archive with debug
symbols, where the error is occurring in the library is shown in the
following screen cap.
As you can see in the call stack, I'm a couple of calls deep in the init
stuff of my application.
This help?
M
-----Original Message-----
From: Shiv Nagarajan [mailto:community-noreply@qnx.com]
Sent: Tuesday, December 08, 2009 10:38 AM
To: general-proj1116
Subject: Re: Seg fault?
Sorry for the delayed response,
these functions are functions inside (com_* etc) the vx works to qnx
lib. Can you post some more of the code that is linking against the
vx2qnx lib? What sort of header changes did you need to make to get to
this point?
shiv
_______________________________________________
General
http://community.qnx.com/sf/go/post43366
_______________________________________________
General
http://community.qnx.com/sf/go/post43368
--
****
Shiv Nagarajan,
Kernel Developer, QNX Software Systems,
Ottawa, Canada
****Shiv Nagarajan(deleted)2009-12-08T16:03:31Zpost43371: RE: RE: Seg fault?
http://community.qnx.com/sf/go/post43371
It is pretty early - I instantiate an ACME in main, and that is when it
happens:
int main(int argc, char* argv[]) {
int status = 0;
if(OXF::initialize(argc, argv, 6423, "192.168.132.1"))
{
Acme * p_Acme;
p_Acme = new Acme;
p_Acme->startBehavior();
//#[ configuration DefaultComponent::DefaultConfig
//#]
OXF::start();
delete p_Acme;
status = 0;
}
Else
....
But, by then, I would guess that statically constructed stuff would be
there already.
What is causing the seg fault is that my_tcb is null. So, obviously when
it derefs it, we are going to have problems. The function taskLock()
which calls the __vx... func looks like this:
STATUS taskLock(void) {
WIND_TCB *tcb = GET_OUR_WIND_TCB();
__vx2qnx_schedlockout(tcb, 0);
return OK;
}
And GET_OUR_WIND_TCB is :
#define GET_OUR_WIND_TCB() \
(WIND_TCB *)pthread_getspecific(__vx2qnx_tcb_key)
In vx2qnx_common.h. so the tcb pointer is null... thoughts?
-----Original Message-----
From: Shiv Nagarajan [mailto:community-noreply@qnx.com]
Sent: Tuesday, December 08, 2009 10:59 AM
To: general-proj1116
Subject: Re: RE: Seg fault?
Its possible. How early does this taskLock get invoked? Since it fails
on the first call to taskLock, does this first call occur very early
during program start?
thanks
shiv
Tue Dec 8 11:04:45 EST 2009
--> According to Mike Medved <--
One initial guess - might this have something to do with static
initialization, and static constructors in C++?
_______________________________________________
General
http://community.qnx.com/sf/go/post43369
--
****
Shiv Nagarajan,
Kernel Developer, QNX Software Systems,
Ottawa, Canada
****
_______________________________________________
General
http://community.qnx.com/sf/go/post43370Mike Medved2009-12-08T16:03:20Zpost43370: Re: RE: Seg fault?
http://community.qnx.com/sf/go/post43370
Its possible. How early does this taskLock get invoked? Since it fails
on the first call to taskLock, does this first call occur very early
during program start?
thanks
shiv
Tue Dec 8 11:04:45 EST 2009
--> According to Mike Medved <--
One initial guess - might this have something to do with static
initialization, and static constructors in C++?
_______________________________________________
General
http://community.qnx.com/sf/go/post43369
--
****
Shiv Nagarajan,
Kernel Developer, QNX Software Systems,
Ottawa, Canada
****Shiv Nagarajan(deleted)2009-12-08T15:58:45Zpost43369: Re: RE: Seg fault?
http://community.qnx.com/sf/go/post43369
One initial guess - might this have something to do with static initialization, and static constructors in C++?Mike Medved2009-12-08T15:51:15Zpost43368: RE: Seg fault?
http://community.qnx.com/sf/go/post43368
Lots of header changes to the VxWorks stuff. It was pretty nasty, which
is why I posted my question on the forum - if there were clean ones that
everyone knows would work, I'd use those.
Here is an example - this is the code that is causing the segfault:
STATUS MTelemetryHandler::registerHandler( MTelemetryHandler * This )
{
MTelemetryHandler* cur = first;
// Create the mutex semaphore if this is the first handler
taskLock();
if (first == NULL)
protect = semMCreate (SEM_Q_PRIORITY | SEM_DELETE_SAFE
| SEM_INVERSION_SAFE);
taskUnlock();
// Take the mutex
semTake (protect, WAIT_FOREVER);
// Go until we find an entry point
This->prev = NULL;
This->next = first;
while ((cur != NULL) && (cur->this_rank <= This->this_rank))
{
This->prev = cur;
cur = cur->next;
This->next = cur;
}
....
The first call to taskLock() is what gives the seg fault. I compiled
the vx2qnx lib with the source that came in the archive with debug
symbols, where the error is occurring in the library is shown in the
following screen cap.
As you can see in the call stack, I'm a couple of calls deep in the init
stuff of my application.
This help?
M
-----Original Message-----
From: Shiv Nagarajan [mailto:community-noreply@qnx.com]
Sent: Tuesday, December 08, 2009 10:38 AM
To: general-proj1116
Subject: Re: Seg fault?
Sorry for the delayed response,
these functions are functions inside (com_* etc) the vx works to qnx
lib. Can you post some more of the code that is linking against the
vx2qnx lib? What sort of header changes did you need to make to get to
this point?
shiv
_______________________________________________
General
http://community.qnx.com/sf/go/post43366Mike Medved2009-12-08T15:45:21Zpost43366: Re: Seg fault?
http://community.qnx.com/sf/go/post43366
Sorry for the delayed response,
these functions are functions inside (com_* etc) the vx works to qnx lib. Can you post some more of the code that is linking against the vx2qnx lib? What sort of header changes did you need to make to get to this point?
shivShiv Nagarajan(deleted)2009-12-08T15:37:58Zpost43353: Forum questions
http://community.qnx.com/sf/go/post43353
Hey - is there anyone out there monitoring the VxWorks migration forum
from QNX? I would like to make this work and have posted a few
questions... I see people have viewed the post, but no replies.
MMike Medved2009-12-08T14:28:12Zpost43352: Seg fault?
http://community.qnx.com/sf/go/post43352
Ok, so I hacked a set of VxWorks headers together and got the application library I want compiled. I have linked the library and the vx2qnx library into an executable which I am now running on a QNX machine.
The problem is that I am getting seg faults on weird function calls. I'm attaching a screen shot. Any ideas? This one is on a simple semaphore call.Mike Medved2009-12-08T14:25:53Zpost43234: headers?
http://community.qnx.com/sf/go/post43234
So dumb question - what do you do for the headers your old VxWorks prog needs? Does anyone have a bunch of shell header files?Mike Medved2009-12-04T18:35:14Z