Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - ApCreateModule Segmentation fault: (9 Items)
   
ApCreateModule Segmentation fault  
Dear all,

I'm having a serious problem with binding the application builder (PhAB) resources. This is what I do 

Within the PhAB (as part of the IDE):
        - Generate UI
        - Save 
or the other way around. I assume that both action will generate new resource files (including header files) when 
something has changed. Notice that in the error situation nothing actually has changed.

From the IDE
Compile all the source files (the post build binds all the resources into the executable using phabbind). 

Now the following happens for some (not all) of the dialogs that are part of the GUI. Whenever I try to create them I 
get a segmentation fault. This looks as if there is a mismatch between the generated header files and the position of 
the resources in the executable. I can only avoid this type of behaviour when modifying the respective dialog by e.g. 
move the button one pixel and then saving the project again from within PhAB. After recompiling the whole project the 
dialog will pop-up as expected. But the error will still occur on other dialogs within the project. I can only avoid all
 the errors by editing all the dialogs and stuff from within phAB. This is however tedious and error prone. I also does 
not give me any confidence that this will always work.

The question is how this can happen and what to do about it. Is there a way to regenerate all the phAB generated files 
every time I build the project from within the IDE? More important I don't understand why there is a mismatch in the 
first place. Is this because the generated phAB files are corrupt or has it something to do with the phabbind program?

Hope someone can help!

By the way I'm using:
     Momentics IDE version 4.7.0
     PhAB version version 2.03
     Target (x86), version 6.5.0

I'm using a windows 7  machine as host

Best regards,
Wim

 
Re: ApCreateModule Segmentation fault  
Hello, Wim.

We are trying to reproduce problem for the moment. If we have additional questions, we'll ask you.

Regards, Renat. 
Re: ApCreateModule Segmentation fault  
Problem solved!!!!

Did the following test:
     kept the binary resource files as is (running version)
     copied the original text oriented resource files into the project
     rebuild the project and got a crash
     
Turned out that some of the original resource files were in UNIX format (CR) and some in Windows format (CRLF). After 
converting them all to UNIX format the problems disappeared !!

Thanks for the help 

Regards,
Wim
      
RE: ApCreateModule Segmentation fault  
Nice! Thanks for letting us know!

Cheers,
Thomas

-----Original Message-----
From: Wim Hellenthal [mailto:community-noreply@qnx.com] 
Sent: Dienstag, 22. Juli 2014 09:28
To: photon-graphics
Subject: Re: ApCreateModule Segmentation fault

Problem solved!!!!

Did the following test:
     kept the binary resource files as is (running version)
     copied the original text oriented resource files into the project
     rebuild the project and got a crash
     
Turned out that some of the original resource files were in UNIX format (CR) and some in Windows format (CRLF). After 
converting them all to UNIX format the problems disappeared !!

Thanks for the help 

Regards,
Wim
      



_______________________________________________

Photon microGUI
http://community.qnx.com/sf/go/post111149
To cancel your subscription to this discussion, please e-mail photon-graphics-unsubscribe@community.qnx.com
RE: ApCreateModule Segmentation fault  
Hi Wim,

this sounds odd enough. First, saving alone will not generate the files that "Generate UI" will. The former will mostly 
affect the *.wgt? files in your project's wgt/ directory, whereas the latter creates (or updates) a series of source 
files in the src/ directory. Most of those will have names beginning with "ab":
  Usemsg
  abLfiles
  abWfiles
  abdefine.h
  abevents.h
  abimport.h
  ablibs.h
  ablinks.h
  abmain.c
  abplatform
  abvars.h
  abwidgets.h
  indLfiles
  proto.h

Additionally, this process may create or update source files which were explicitly specified in your widget's callbacks 
etc.

You can delete all of the "src/ab*" files to force a re-generation of those upon "Generate UI", but PhAB will never re-
generate or update existing code. E.g., a callback routine already existing in one of your source files will never be 
touched by PhAB. Consequently, you might add a pre-build action to your IDE project that could remove all those fully 
generated "ab*" files. But again, that will not cover everything. 

In theory, the source of your problems could be either the _code_ generated by PhAB, or it could be the widget 
definitions (in wgt/*) that are bound into your application by 'phabbind'. Hard to tell which one is the actual culprit.


Can you come up with a reduced test case for this issue? If so, it would be good to have the source - and perhaps the 
binary and a core file as well.

Regards,
Thomas


-----Original Message-----
From: Wim Hellenthal [mailto:community-noreply@qnx.com] 
Sent: Donnerstag, 17. Juli 2014 15:27
To: photon-graphics
Subject: ApCreateModule Segmentation fault

Dear all,

I'm having a serious problem with binding the application builder (PhAB) resources. This is what I do 

Within the PhAB (as part of the IDE):
        - Generate UI
        - Save 
or the other way around. I assume that both action will generate new resource files (including header files) when 
something has changed. Notice that in the error situation nothing actually has changed.

From the IDE
Compile all the source files (the post build binds all the resources into the executable using phabbind). 

Now the following happens for some (not all) of the dialogs that are part of the GUI. Whenever I try to create them I 
get a segmentation fault. This looks as if there is a mismatch between the generated header files and the position of 
the resources in the executable. I can only avoid this type of behaviour when modifying the respective dialog by e.g. 
move the button one pixel and then saving the project again from within PhAB. After recompiling the whole project the 
dialog will pop-up as expected. But the error will still occur on other dialogs within the project. I can only avoid all
 the errors by editing all the dialogs and stuff from within phAB. This is however tedious and error prone. I also does 
not give me any confidence that this will always work.

The question is how this can happen and what to do about it. Is there a way to regenerate all the phAB generated files 
every time I build the project from within the IDE? More important I don't understand why there is a mismatch in the 
first place. Is this because the generated phAB files are corrupt or has it something to do with the phabbind program?

Hope someone can help!

By the way I'm using:
     Momentics IDE version 4.7.0
     PhAB version version 2.03
     Target (x86), version 6.5.0

I'm using a windows 7  machine as host

Best regards,
Wim

 



_______________________________________________

Photon microGUI
http://community.qnx.com/sf/go/post111087
To cancel your subscription to this discussion, please e-mail photon-graphics-unsubscribe@community.qnx.com
Re: ApCreateModule Segmentation fault  
Dear all,

First of all, thanks for the support. 

I think it is not so easy to come up with a reduced test case. The code is proprietary and developed by a third party. 
It involves quite a lot of code. I could try to create another project for testing but most likely that code will work 
as expected.

I now wonder if it could have something to do with the fact that the complete source was originally designed and build 
on a different system. After modifying the resources I can build again and again without any problem running the 
executable (at least not the problems I've found so-far) .  Note that I came across a related issue where no 
segmentation fault occurred but where one of the dialog s did not show up.  

Regards,
Wim
RE: ApCreateModule Segmentation fault  
Hi Wim,

as you describe the situation, I agree that it probably isn't worthwhile to try creating a test case.

Could it be that the code was originally built using a significantly older PhAB/Photon/ap version? In that case, it 
should be sufficient to once slightly modify all PhAB modules, save, and generate. 

If we wanted to find out what exactly is happening, you might also (after updating the application as lined out above) 
perform a "diff" between the new and old versions of the wgt/*- and the src/ab* files. That might give us some 
indication if e.g. a changed resource format is causing your troubles.

Regards,
Thomas


-----Original Message-----
From: Wim Hellenthal [mailto:community-noreply@qnx.com] 
Sent: Montag, 21. Juli 2014 11:37
To: photon-graphics
Subject: Re: ApCreateModule Segmentation fault

Dear all,

First of all, thanks for the support. 

I think it is not so easy to come up with a reduced test case. The code is proprietary and developed by a third party. 
It involves quite a lot of code. I could try to create another project for testing but most likely that code will work 
as expected.

I now wonder if it could have something to do with the fact that the complete source was originally designed and build 
on a different system. After modifying the resources I can build again and again without any problem running the 
executable (at least not the problems I've found so-far) .  Note that I came across a related issue where no 
segmentation fault occurred but where one of the dialog s did not show up.  

Regards,
Wim



_______________________________________________

Photon microGUI
http://community.qnx.com/sf/go/post111139
To cancel your subscription to this discussion, please e-mail photon-graphics-unsubscribe@community.qnx.com
Re: RE: ApCreateModule Segmentation fault  
Hello, Wim.

I tried to reproduce the problem you described. But I couldn't get your results.
If there is a problem to get an example of sources ore test case, can you describe which widgets PhAB  you used and make
 step-by-step instruction to reproduce the issue.
May be using header files from target system in your Momentics project will help.

Regards, Renat.
Re: RE: ApCreateModule Segmentation fault  
I think I have found the cause of the problems thanks to the suggestion given by Thomas. After doing a diff on the WGT 
files I noticed a difference with respect to the the end-of-line delimiter handling in some of the .wgtd files. Some of 
the files used CRLF while others didn't. I'm almost certain that this is the cause. Tomorrow I will do a test and let 
you know if the problem is solved converting one of the  text related resource files to windows format and vice versa. 

Again, thanks for the support!

Regards,
Wim