Feed for discussion General in project Wind River® VxWorks® Migration. Posts for General post74423: Related API in QNX for repeat() harish kumar http://community.qnx.com/sf/go/post74423 2010-11-12T07:08:49Z 2010-11-12T07:08:49Z Can any one suggest an related API for repeat() (VxWorks API) in QNX. Or suggest me how to implement same in QNX. Thanks, harish kumar 2010-11-12T07:08:49Z post47094: Where are events? Mario Mastrodicasa http://community.qnx.com/sf/go/post47094 2010-02-11T09:02:47Z 2010-02-11T09:02:47Z Hi, I have seen the library but it lacks the eventLib feature. What about it? Mario. Mario Mastrodicasa 2010-02-11T09:02:47Z post43383: RE: Seg fault? Mike Medved http://community.qnx.com/sf/go/post43383 2009-12-08T19:10:34Z 2009-12-08T19:10:34Z 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 2009 Mike Medved 2009-12-08T19:10:34Z post43381: Re: Seg fault? Shiv Nagarajan(deleted) http://community.qnx.com/sf/go/post43381 2009-12-08T18:27:47Z 2009-12-08T18:27:47Z 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:47Z post43376: Re: headers? Mike Medved http://community.qnx.com/sf/go/post43376 2009-12-08T16:17:13Z 2009-12-08T16:17:13Z Answer: \src\lib\vx2qnx\public\vx2qnx Mike Medved 2009-12-08T16:17:13Z post43373: RE: Seg fault? Mike Medved http://community.qnx.com/sf/go/post43373 2009-12-08T16:06:33Z 2009-12-08T16:06:33Z 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 Mike Medved 2009-12-08T16:06:33Z post43372: Re: Seg fault? Shiv Nagarajan(deleted) http://community.qnx.com/sf/go/post43372 2009-12-08T16:03:31Z 2009-12-08T16:03:31Z 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:31Z post43371: RE: RE: Seg fault? Mike Medved http://community.qnx.com/sf/go/post43371 2009-12-08T16:03:20Z 2009-12-08T16:03:20Z 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/post43370 Mike Medved 2009-12-08T16:03:20Z post43370: Re: RE: Seg fault? Shiv Nagarajan(deleted) http://community.qnx.com/sf/go/post43370 2009-12-08T15:58:45Z 2009-12-08T15:58:45Z 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:45Z post43369: Re: RE: Seg fault? Mike Medved http://community.qnx.com/sf/go/post43369 2009-12-08T15:51:15Z 2009-12-08T15:51:15Z One initial guess - might this have something to do with static initialization, and static constructors in C++? Mike Medved 2009-12-08T15:51:15Z post43368: RE: Seg fault? Mike Medved http://community.qnx.com/sf/go/post43368 2009-12-08T15:45:21Z 2009-12-08T15:45:21Z 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 Mike Medved 2009-12-08T15:45:21Z post43366: Re: Seg fault? Shiv Nagarajan(deleted) http://community.qnx.com/sf/go/post43366 2009-12-08T15:37:58Z 2009-12-08T15:37:58Z 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 Shiv Nagarajan(deleted) 2009-12-08T15:37:58Z post43353: Forum questions Mike Medved http://community.qnx.com/sf/go/post43353 2009-12-08T14:28:12Z 2009-12-08T14:28:12Z 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. M Mike Medved 2009-12-08T14:28:12Z post43352: Seg fault? Mike Medved http://community.qnx.com/sf/go/post43352 2009-12-08T14:25:53Z 2009-12-08T14:25:53Z 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 Medved 2009-12-08T14:25:53Z post43234: headers? Mike Medved http://community.qnx.com/sf/go/post43234 2009-12-04T18:35:14Z 2009-12-04T18:35:14Z 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 Medved 2009-12-04T18:35:14Z