Hi,
I think that there is a problem with your categories in your database.
You must have a loop something where a child category is a parent of one of its parent categories.
You can try to add the code:
if($depth > 50)
return array($depth,$left);
after the line:
function rebuildTree($element,$depth,$left){
in the file administrator/components/com_hikashop/classes/category.php
That will avoid the infinite loop, and thus should not produce the error anymore if you click on the "rebuild" button of the categories listing.
Then, we can include the patch on our end too so that you can install the update without getting the error.
However, it still means that you have a problem with the data of your categories in the database. Ideally, you should review the child / parent structure of your categories to remove that infinite loop.