Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Posts: 188
Registered: ‎07-19-2012
My Device: Z10 LE
My Carrier: Three

Tracing a segfault caused by a ListView


I'm currently having a number of problems with a custom ListItemManager, namely when I clear or replace the list's datamodel. In my application I need to dynamically sort a list based on a user's preference. The list is correctly rendered the first time, but when I try to remove items or clear the list entirely I get a SegFault error:


Process 14876877 (MyAppName) terminated SIGSEGV code=1 fltno=11 ip=78fde438(/base/usr/lib/qt4/lib/libQtCore.so.4.8.0@+0x12702c) mapaddr=0016c438. ref=00000010 bdslot=1

 I've followed the tutorial for ListItemManager and ListItemListener and have implemented the virtual methods. Here are the relevant sections of code from the screen.


// In the constructor
mChannelModel = new GroupDataModel(QStringList() << "channels");


 * Updates the list of channels in the dataModel
void MyScreen::updateList(QList<Channel*> channels) {
	qDebug() << "Channel size is " << channels.size();

	// Load the images if this is the first time
	if(!mImagesLoaded) {
		for(int i = 0; i < channels.size(); i++) {
		mImagesLoaded = true;
	else {
		// or if we're updating
		qDebug() << "Clearing list";

		mChannelModel->clear();             // CRASHES HERE

		qDebug() << "Datamodel has been cleared";
		for(int i = 0; i < channels.size(); i++) {
			qDebug() << "Appending model";


 The crash happens at mChannelModel->clear(), where the data model is emptied of data before the new data is re-inserted into it. 

Did this post help you? If so, please make sure to "like" it!
New Contributor
Posts: 3
Registered: ‎06-12-2013
My Device: BlackBerry Z10
My Carrier: Fido

Re: Tracing a segfault caused by a ListView

I am seeing a very similar issue with GrouDataModel. I am using a SegmentControl to populate the list with differnt items based on which Segment is highlighed. The List populated correctly for each segment the first time, but crashes as soon as you revisit a Segment. Here is my code:


void PlaylistsController::selectSegment(QString selected) {


	if (QString::compare(selected, "Owned") == STR_EQUAL) {
		QListIterator<Playlist*> subIt(*ownedPlaylists);

		while(subIt.hasNext()) {
	} else if (QString::compare(selected, "Collab") == STR_EQUAL) {
		QListIterator<Playlist*> collabIt(*collabPlaylists);

		while(collabIt.hasNext()) {
	} else if (QString::compare(selected, "Subscribed") == STR_EQUAL) {
		QListIterator<Playlist*> ownedIt(*subscribedPlaylists);

		while(ownedIt.hasNext()) {



Do you ever find a solution for this issue?