---
title: "oft-countpix.pl - Segmentation fault (core dumped) - Ubuntu 14.04 Virtual Machine"
url: "https://openforis.support/questions/356/oft-countpixpl-segmentation-fault-core-dumped-ubuntu-1404-virtual-machine"
tags: ["geospatialtoolkit"]
status: "answered"
score: 0
answer_count: 5
asked: "2015-10-26T14:59:37"
last_activity: "2015-10-29T09:22:15"
source: "Open Foris Support - Q&A Forum"
license: "Copyright Open Foris, 2026. Some rights reserved under creative commons license."
---

# oft-countpix.pl - Segmentation fault (core dumped) - Ubuntu 14.04 Virtual Machine

Asked by jwesroberts on 2015-10-26

Dear Colleagues,

I am trying to use the oft-countpix.pl application to count pixel in a *.tif raster. The raster is 24MB in size and I am running the command within a virtual machine (ubuntu 14.04) hosted on a windows 7 machine. The raster of interest is created using the gdal_calc.py function and represents a land cover class. To reduce the size of the output from gdal_calc.py I have used LZW compression. The command used is 

oft-countpix.pl temp.tif 1

After a couple of minutes I receive the following error:

wesley@wesley-VirtualBox:~/rasterData$ oft-countpix.pl temp.tif 1 
Segmentation fault (core dumped)
cat: /tmp/histtempZ4g/temp_hist.txt: No such file or directory

Any help on the matter would be greatly appreciated.

Wesley


## Answer (score 0, by Anssi on 2015-10-27)

Link: https://openforis.support/questions/356/oft-countpixpl-segmentation-fault-core-dumped-ubuntu-1404-virtual-machine/358

Dear Wesley,

oft-countpix.pl calls oft-his which seems to crash for some reason. 

Can you try to produce the histogram running oft-his from the command line?

AP


## Answer (score 0, by jwesroberts on 2015-10-27)

Link: https://openforis.support/questions/356/oft-countpixpl-segmentation-fault-core-dumped-ubuntu-1404-virtual-machine/363

Dear AP,

oft-his also returns a Segmentation fault. This time however the Segmentation fault is preceded by a message indicating "Memory allocation problem...will use an alternative method".

The file I am testing the application on is 24MB. The virtual machine I am using has only 2GB of memory. Could this be the problem?

Regards,
Wesley


## Answer (score 0, by Anssi on 2015-10-27)

Link: https://openforis.support/questions/356/oft-countpixpl-segmentation-fault-core-dumped-ubuntu-1404-virtual-machine/364

Thanks Wesley,

yes that's probably the reason. However, oft-his should never crash. 

Can you run of-mm and let us know the reported min and max values as well as the maxval parameter  you've used (if any), please.

Best,

AP


## Answer (score 0, by jwesroberts on 2015-10-27)

Link: https://openforis.support/questions/356/oft-countpixpl-segmentation-fault-core-dumped-ubuntu-1404-virtual-machine/365

Hi AP,

oft-mm returns 
Band 1 min = 0.000000
Band 2 max = 1.000000

The temp.tif file does contain nan's if that makes a difference.

Regards,
W.


## Answer (score 0, by Anssi on 2015-10-29)

Link: https://openforis.support/questions/356/oft-countpixpl-segmentation-fault-core-dumped-ubuntu-1404-virtual-machine/368

Thanks Wesley,

seems that the problem was with the initialization of the allocate (large) array. I have fixed that now and will release a new installer as soon as we've finalized the testing of the new version.

Many thanks for reporting!

AP
