Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault on KX_Mesh.transformUV #955

Closed
vlad0337187 opened this issue Nov 29, 2018 · 7 comments
Closed

Segmentation fault on KX_Mesh.transformUV #955

vlad0337187 opened this issue Nov 29, 2018 · 7 comments
Labels

Comments

@vlad0337187
Copy link

vlad0337187 commented Nov 29, 2018

Just segmentation fault when calling that method.

code:

uv_offset = [0, 0]

def move_clouds ():
	global uv_offset
	import mathutils
	contr		= bge.logic.getCurrentController ()
	obj			= contr.owner

	SPEED_X = 0.1
	SPEED_Y = 0
	# Transform stored original values and write to first channel.
	uv_offset[0] += SPEED_X
	uv_offset[1] += SPEED_Y
	uv_mat = mathutils.Matrix.Translation((uv_offset[0], uv_offset[1], 0))
	obj.meshes[0].transformUV (-1, uv_mat, 0, 1)									# BUG HERE !!!!! <<<<

VIdeo with bug: https://www.youtube.com/watch?v=xM4UTPgwpyc

Steps to reproduce:

  • pull repository: hg clone https://vlad1777d@bitbucket.org/new_novel/oasis
  • move to bookmark with crash: hg update -r bug/upbge/KX_Mesh.transformUV
    (or checkout to that commit: "b47eda814a4b")
  • open scene in upbge: upbge ./scenes/dream_tower/dream_tower.blend
  • press P and see a crash

OS: LInux Mint 19 Cinnamon
Kernel: 4.15.0-39-generic
UPBGE: 0.2.4
GPU: Nvidia Geforce GT 840m

P.S. I met near 5 crashes, and some of them are in not often used functions.
I think, maybe not to waste time on fixing this and mark it as "low priority" ?

@lordloki
Copy link
Member

@vlad1777d thanks for reporting. We will check it.

@youle31 youle31 added the bug label Dec 11, 2018
@youle31
Copy link
Collaborator

youle31 commented Dec 11, 2018

hi, I propose this as a fix:
https://drive.google.com/file/d/1SZ3XY-OIPclPmVO5PhzFZx8pdNrCWFMq/view?usp=sharing

@youle31
Copy link
Collaborator

youle31 commented Dec 11, 2018

@youle31
Copy link
Collaborator

youle31 commented Dec 12, 2018

I think my fix is wrong in fact as i think we can have an uv in layer 2 and no uv in layer 0... maybe i'll do another fix later. Anyway this is a minor bug

@youle31
Copy link
Collaborator

youle31 commented Dec 12, 2018

Bool UvExist(int layer) if !m-vertexdata[layer].size() return false; then throw python error. Smthing like that

panzergame added a commit that referenced this issue Dec 18, 2018
This function can copy an uv layer to an other, but no check was proceeded
for the source layer and created invalid memory access.

To solve this issue and simplify the error checking for uv layers, the function
uvExist is created as adviced by youle. This function check if the layer passed
is between 0 and format.uvSize.

Fix issue: #955.
@youle31
Copy link
Collaborator

youle31 commented Jan 12, 2019

This has been fixed by panzergame in last master. Thanks panzergame!

@youle31 youle31 closed this as completed Jan 12, 2019
@vlad0337187
Copy link
Author

Thank you very much!

youle31 pushed a commit that referenced this issue May 26, 2019
This function can copy an uv layer to an other, but no check was proceeded
for the source layer and created invalid memory access.

To solve this issue and simplify the error checking for uv layers, the function
uvExist is created as adviced by youle. This function check if the layer passed
is between 0 and format.uvSize.

Fix issue: #955.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants