PhysicsMod icon indicating copy to clipboard operation
PhysicsMod copied to clipboard

Segmentation fault on linux [BUG]

Open RIvance opened this issue 2 years ago • 4 comments

Describe the bug

Log Before Crash

[20:28:09] [Render thread/INFO]: [STDERR]: error creating ragdoll for class net.minecraft.class_1613
[20:28:09] [Render thread/INFO]: [STDERR]: java.lang.IndexOutOfBoundsException: Index (17) is greater than or equal to list size (17)
[20:28:09] [Render thread/INFO]: [STDERR]: 	at it.unimi.dsi.fastutil.objects.ObjectArrayList.get(ObjectArrayList.java:411)
[20:28:09] [Render thread/INFO]: [STDERR]: 	at net.diebuddies.physics.ragdoll.Ragdoll.addConnection(Ragdoll.java:63)
[20:28:09] [Render thread/INFO]: [STDERR]: 	at net.diebuddies.physics.ragdoll.Ragdoll.addConnection(Ragdoll.java:101)
[20:28:09] [Render thread/INFO]: [STDERR]: 	at net.diebuddies.physics.ragdoll.Ragdoll.addConnection(Ragdoll.java:121)
[20:28:09] [Render thread/INFO]: [STDERR]: 	at net.diebuddies.physics.ragdoll.VanillaRagdollHook.map(VanillaRagdollHook.java:195)
[20:28:09] [Render thread/INFO]: [STDERR]: 	at net.diebuddies.physics.ragdoll.RagdollMapper.map(RagdollMapper.java:43)
[20:28:09] [Render thread/INFO]: [STDERR]: 	at net.diebuddies.physics.PhysicsMod.blockifyEntity(PhysicsMod.java:623)
[20:28:09] [Render thread/INFO]: [STDERR]: 	at net.minecraft.class_1309.handler$bbb000$onDeath(class_1309.java:6613)
[20:28:09] [Render thread/INFO]: [STDERR]: 	at net.minecraft.class_1309.method_6078(class_1309.java)
[20:28:09] [Render thread/INFO]: [STDERR]: 	at net.minecraft.class_1309.method_5711(class_1309.java:1799)
[20:28:09] [Render thread/INFO]: [STDERR]: 	at net.minecraft.class_1308.method_5711(class_1308.java:375)
[20:28:09] [Render thread/INFO]: [STDERR]: 	at net.minecraft.class_634.method_11148(class_634.java:958)
[20:28:09] [Render thread/INFO]: [STDERR]: 	at net.minecraft.class_2663.method_11471(class_2663.java:33)
[20:28:09] [Render thread/INFO]: [STDERR]: 	at net.minecraft.class_2663.method_11054(class_2663.java:11)
[20:28:09] [Render thread/INFO]: [STDERR]: 	at net.minecraft.class_2600.method_11072(class_2600.java:40)
[20:28:09] [Render thread/INFO]: [STDERR]: 	at net.optifine.util.PacketRunnable.run(PacketRunnable.java:28)
[20:28:09] [Render thread/INFO]: [STDERR]: 	at net.minecraft.class_1255.method_18859(class_1255.java:198)
[20:28:09] [Render thread/INFO]: [STDERR]: 	at net.minecraft.class_4093.method_18859(class_4093.java:23)
[20:28:09] [Render thread/INFO]: [STDERR]: 	at net.minecraft.class_1255.method_16075(class_1255.java:163)
[20:28:09] [Render thread/INFO]: [STDERR]: 	at net.minecraft.class_1255.method_5383(class_1255.java:140)
[20:28:09] [Render thread/INFO]: [STDERR]: 	at net.minecraft.class_310.method_1523(class_310.java:1129)
[20:28:09] [Render thread/INFO]: [STDERR]: 	at net.minecraft.class_310.method_1514(class_310.java:768)
[20:28:09] [Render thread/INFO]: [STDERR]: 	at net.minecraft.client.main.Main.method_44604(Main.java:244)
[20:28:09] [Render thread/INFO]: [STDERR]: 	at net.minecraft.client.main.Main.main(Main.java:51)
[20:28:09] [Render thread/INFO]: [STDERR]: 	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:461)
[20:28:09] [Render thread/INFO]: [STDERR]: 	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
[20:28:09] [Render thread/INFO]: [STDERR]: 	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)

Crash Info

---------------  S U M M A R Y ------------

Command Line: -Xss1M -Djava.library.path=/home/ivance/.minecraft/bin/848c91108cdae5f1545f0fd28fa300a20451ee3b -Dminecraft.launcher.brand=minecraft-launcher -Dminecraft.launcher.version=2.3.562 -DFabricMcEmu= net.minecraft.client.main.Main  -Xmx16G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M -Dlog4j.configurationFile=/home/ivance/.minecraft/assets/log_configs/client-1.12.xml net.fabricmc.loader.impl.launch.knot.KnotClient --username Ivance --version fabric-loader-0.14.12-1.19.2 --gameDir /home/ivance/.minecraft --assetsDir /home/ivance/.minecraft/assets --assetIndex 1.19 --uuid e3842e28e86b4f4eb01b2dbcaa7b3e4b --clientId 57uH+w0yOlbV8pQViydlT0lBfZ+W+bLhmGQa12+ZEiUgQAhyG3U14iJdF0GuG2Ff --xuid 2535415392500333 --userType msa --versionType release

Host: 13th Gen Intel(R) Core(TM) i7-13700KF, 24 cores, 62G, Arch Linux
Time: Wed Jan 18 20:44:04 2023 CST elapsed time: 314.904347 seconds (0d 0h 5m 14s)

---------------  T H R E A D  ---------------

Current thread is native thread

Stack: [0x00007f75bf7ff000,0x00007f75bf9fe000],  sp=0x00007f75bf9fc3c0,  free space=2036k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libPhysXJniBindings_64.so+0x5f6e70]  GuContactHullHull(physx::Gu::PolygonalData const&, physx::Gu::PolygonalData const&, physx::PxBounds3 const&, physx::PxBounds3 const&, physx::PxTransform const&, physx::PxTransform const&, physx::Gu::NarrowPhaseParams const&, physx::Gu::ContactBuffer&, physx::Cm::FastVertex2ShapeScaling const&, physx::Cm::FastVertex2ShapeScaling const&, bool, bool)+0x11c0
C  [libPhysXJniBindings_64.so+0x5f7d97]  physx::Gu::contactConvexConvex(physx::Gu::GeometryUnion const&, physx::Gu::GeometryUnion const&, physx::PxTransform const&, physx::PxTransform const&, physx::Gu::NarrowPhaseParams const&, physx::Gu::Cache&, physx::Gu::ContactBuffer&, physx::Cm::RenderOutput*)+0x117


siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x00007f8a35a51518

Registers:
RAX=0x0000000000000000, RBX=0x00007f75bf9fc8c8, RCX=0x0000000000000000, RDX=0x00007f8a35a5150c
RSP=0x00007f75bf9fc3c0, RBP=0x00007f75bf9fc790, RSI=0x000000000000000c, RDI=0x0000000000000019
R8 =0x00000000ffffffff, R9 =0x000000000000000c, R10=0x00007f7635a517d8, R11=0x00007f7635a51700
R12=0x00000004fffffffb, R13=0x00007f7635a51700, R14=0x0000000000000000, R15=0x00007f7635a51520
RIP=0x00007f771fddfe70, EFLAGS=0x0000000000010246, CSGSFS=0x002b000000000033, ERR=0x0000000000000004
  TRAPNO=0x000000000000000e

Top of Stack: (sp=0x00007f75bf9fc3c0)
0x00007f75bf9fc3c0:   000000007f7fffff 0000000000000000
0x00007f75bf9fc3d0:   0000000000000000 0000000000000000
0x00007f75bf9fc3e0:   0000000200000000 000000017f7fffff
0x00007f75bf9fc3f0:   0000000000000000 0000000000000000 

Instructions: (pc=0x00007f771fddfe70)
0x00007f771fddfd70:   88 fe ff ff 4c 89 f7 48 8b 75 20 4c 89 ea ff d0
0x00007f771fddfd80:   44 0f 28 25 e8 8b 02 00 41 89 c4 8b 85 e0 fe ff
0x00007f771fddfd90:   ff 4d 8b 7e 18 44 89 a5 60 fe ff ff 44 89 e1 4c
0x00007f771fddfda0:   8d 24 89 4b 8d 14 a7 4c 8b 6b 18 89 45 d4 89 c1
0x00007f771fddfdb0:   4c 8d 34 89 43 0f 18 0c a7 43 0f 18 4c b5 00 f3
0x00007f771fddfdc0:   0f 10 85 08 ff ff ff 45 0f 57 ed f3 44 0f c2 e8
0x00007f771fddfdd0:   02 41 0f 57 c4 44 0f 55 e8 80 7d 30 00 0f 84 8d
0x00007f771fddfde0:   00 00 00 0f 10 02 0f 29 85 b0 fe ff ff f3 0f 10
0x00007f771fddfdf0:   02 44 0f 28 85 40 ff ff ff 44 0f 28 8d 50 ff ff
0x00007f771fddfe00:   ff 41 0f 28 c8 41 0f c6 c8 e5 f3 0f 59 c8 41 0f
0x00007f771fddfe10:   28 d8 66 41 0f 15 d8 f3 0f 59 d8 f3 41 0f 59 c0
0x00007f771fddfe20:   41 0f 28 e0 41 0f c6 e0 e7 f3 43 0f 10 74 a7 04
0x00007f771fddfe30:   f3 43 0f 10 54 a7 08 f3 0f 59 e6 f3 0f 58 e0 41
0x00007f771fddfe40:   0f 28 c1 41 0f c6 c1 e5 f3 0f 59 c6 f3 41 0f 59
0x00007f771fddfe50:   f1 f3 0f 58 f1 f3 0f 58 c3 41 0f 28 d9 66 41 0f
0x00007f771fddfe60:   15 d9 e9 98 01 00 00 66 0f 1f 84 00 00 00 00 00
0x00007f771fddfe70:   f3 47 0f 10 44 a7 0c f3 0f 10 0a f3 43 0f 10 44
0x00007f771fddfe80:   a7 04 f3 43 0f 10 7c a7 08 48 8b 45 20 f3 0f 10
0x00007f771fddfe90:   50 24 f3 0f 10 58 28 f3 0f 10 60 2c f3 0f 10 68
0x00007f771fddfea0:   30 0f 14 d1 0f 28 f1 0f 14 f5 0f 59 f2 0f 14 d8
0x00007f771fddfeb0:   f3 0f 10 50 34 0f 28 e8 0f 14 ea 0f 59 eb 0f 58
0x00007f771fddfec0:   ee 0f 14 e7 f3 0f 10 50 38 0f 28 df 0f 14 da 0f
0x00007f771fddfed0:   59 dc 0f 58 dd f3 0f 59 48 3c f3 0f 59 40 40 f3
0x00007f771fddfee0:   0f 58 c1 f3 0f 59 78 44 f3 0f 58 f8 0f 28 c3 f3
0x00007f771fddfef0:   0f 59 c3 0f 28 e3 0f c6 e3 e5 0f 28 cc f3 0f 59
0x00007f771fddff00:   cc f3 0f 58 c8 0f 28 c7 f3 0f 59 c7 f3 0f 58 c1
0x00007f771fddff10:   0f 2e 05 3d 8c 02 00 72 07 f3 0f 51 c0 eb 4c 90
0x00007f771fddff20:   44 0f 29 ad 30 ff ff ff 0f 29 7d a0 44 0f 29 45
0x00007f771fddff30:   c0 0f 29 9d f0 fe ff ff 0f 29 a5 70 fe ff ff e8
0x00007f771fddff40:   1c 30 c0 ff 0f 28 a5 70 fe ff ff 0f 28 9d f0 fe
0x00007f771fddff50:   ff ff 44 0f 28 45 c0 0f 28 7d a0 44 0f 28 ad 30
0x00007f771fddff60:   ff ff ff 44 0f 28 25 05 8a 02 00 f3 0f 10 15 dd 

To Reproduce

physics_animations_client_config.json

{ "customizedAnimations": [ { "identifier": 0, "Name": "default", "Animation Curve": 0, "Despawn Speed": 0.5, "Type": 0, "Particle Spawn": [] }, { "identifier": 5, "Name": "portal", "Animation Curve": 0, "Despawn Speed": 0.0, "Type": 0, "Particle Spawn": [ { "Type": "minecraft:reverse_portal", "Amount": 16, "Spread Radius": 0.8, "Spawn Chance": 1.0, "Velocity X": 0.0, "Velocity Y": 0.0, "Velocity Z": 0.0, "Sound Volume": 0.1, "Sound": "minecraft:block.portal.ambient" } ] }, { "identifier": 6, "Name": "splash", "Animation Curve": 0, "Despawn Speed": 0.0, "Type": 0, "Particle Spawn": [ { "Type": "minecraft:splash", "Amount": 16, "Spread Radius": 0.7, "Spawn Chance": 1.0, "Velocity X": 0.0, "Velocity Y": 0.0, "Velocity Z": 0.0, "Sound Volume": 0.1, "Sound": "minecraft:entity.dolphin.splash" } ] }, { "identifier": 1, "Name": "vanish", "Animation Curve": 2, "Despawn Speed": 0.5, "Type": 1, "Particle Spawn": [] }, { "identifier": 3, "Name": "explosion", "Animation Curve": 1, "Despawn Speed": 0.5, "Type": 2, "Particle Spawn": [ { "Type": "minecraft:lava", "Amount": 4, "Spread Radius": 0.5, "Spawn Chance": 1.0, "Velocity X": 0.0, "Velocity Y": 0.0, "Velocity Z": 0.0, "Sound Volume": 0.1, "Sound": "minecraft:block.lava.extinguish" }, { "Type": "minecraft:poof", "Amount": 7, "Spread Radius": 0.5, "Spawn Chance": 1.0, "Velocity X": 0.0, "Velocity Y": 0.0, "Velocity Z": 0.0, "Sound Volume": 0.1 } ] }, { "identifier": 4, "Name": "poof", "Animation Curve": 0, "Despawn Speed": 0.0, "Type": 0, "Particle Spawn": [ { "Type": "minecraft:poof", "Amount": 6, "Spread Radius": 0.8, "Spawn Chance": 1.0, "Velocity X": 0.0, "Velocity Y": 0.0, "Velocity Z": 0.0, "Sound Volume": 0.2, "Sound": "minecraft:entity.fox.sniff" } ] }, { "identifier": 2, "Name": "bounce", "Animation Curve": 3, "Despawn Speed": 0.6, "Type": 0, "Particle Spawn": [] } ] }

physics_client_config.json

{ "maxPhysicsObjects": 10000, "particleLifetimeVines": 4.0, "particleLifetimeItems": 3.0, "particleLifetimeParticles": 0.1, "particleLifetimeLiquids": 6.0, "particleLifetimeSmoke": 60.0, "particleDespawnTimeSmoke": 3.0, "particleLifetimeVarianceVines": 3.0, "particleLifetimeVarianceItems": 3.0, "particleLifetimeVarianceParticles": 3.0, "particleLifetimeVarianceLiquids": 3.0, "particleLifetimeVarianceSmoke": 15.0, "particleDespawnTimeVarianceSmoke": 12.0, "cpuThreads": 6, "itemPhysics": true, "minecraftBlockBreakParticles": false, "vinePhysics": true, "capePhysics": true, "fishingRodPhysics": true, "leashPhysics": true, "bannerPhysics": true, "clothSmoothShading": false, "physicsModCape": true, "selectedPhysicsCape": "Physics Mod Cape.dae", "showUpdateNotifications": true, "clothThreads": 3, "leashLength": 3.0, "fishingLineLength": 12.0, "pvpServerCompatibility": false, "snowballModel": 0, "snowballImpact": 0, "snowballShade": false, "enderpearlModel": 0, "enderpearlImpact": 0, "enderpearlShade": false, "eggModel": 0, "eggImpact": 0, "eggShade": false, "crackPhysicsParticles": true, "liquidPhysics": true, "liquidSourceDistance": 6.0, "liquidThreads": 2, "bannerPhysicsRange": 48.0, "soundVolume": 1.0, "blockPhysicsRange": 48.0, "vineRange": 32.0, "waterDensity": 3, "snowPhysics": true, "snowTracks": true, "snowTrackEntities": 6, "snowTrackDistance": 48.0, "snowThickness": 0.0, "grassSnowy": true, "snowType": 0, "snowSmoothShading": true, "snowChunkSize": 0, "guiPhysicsKey": 295, "blockSettings": { "Physics Type": 0, "Lifetime": 1.0, "Lifetime Variance": 3.0, "Scale": 0.29999998211860657, "Animation": -1 }, "mobSettings": { "Physics Type": 0, "Lifetime": 3.0, "Lifetime Variance": 3.0, "Animation": 0 }, "sprintingPhysicsParticles": true, "eatingPhysicsParticles": true, "serverBlockPhysicsParticles": true, "smokePhysics": true, "smokeParticleLimit": 6000, "verificationCode": "", "smokeColorRed": 0.56, "smokeColorGreen": 0.56, "smokeColorBlue": 0.56, "smokeDenseColorRed": 0.364, "smokeDenseColorGreen": 0.364, "smokeDenseColorBlue": 0.364, "smokeDensity": 0.9, "smokePhysicsRange": 100.0, "smokeBlaze": 0.05, "smokeCampfire": 0.3, "smokeFire": 0.3, "smokeOther": 1.0, "smokeShadowTransformer": 0, "maxLoadedDynamicBlocks": 20, "windPhysics": true, "weatherParticles": true, "weatherClearStrength": 0.1, "weatherRainStrength": 1.0, "weatherThunderStrength": 1.4, "windVolume": 1.0, "weatherRainParticleAmount": 5, "weatherThunderParticleAmount": 2, "customizedGravities": [ "minecraft:the_nether", 0.0, -9.81, 0.0, "minecraft:overworld", 0.0, -9.81, 0.0, "minecraft:the_end", 0.0, -9.81, 0.0 ], "customizedBuoyancies": [ "minecraft:the_nether", 0.0, 2.0, 0.0, "minecraft:overworld", 0.0, 2.0, 0.0, "minecraft:the_end", 0.0, 2.0, 0.0 ], "customizedCapes": [] }

Minecraft Version: 1.19.2 Physics Mod Version: 2.9.4

RIvance avatar Jan 18 '23 13:01 RIvance

Seems like your Linux build is not supported (just a wild guess). Once I switch to PhysX 5.1 this might be fixed.

haubna avatar Jan 18 '23 13:01 haubna

Thanks for the reply!

I updated the mod to version 2.9.7 and the problem still exists. After a period of trying, I think I found the reason (isn't related to the Linux OS):

This problem only occurs when OptiFabric and resource packs with custom entity model are enabled. The actual problem is in net.diebuddies.physics.ragdoll.Ragdoll.addConnection method (sorry for decompiling your code):

Vector3d localPos1 = ((Model)((PhysicsEntity)this.bodies.get(from)).models.get(0)).mesh.offset;
Vector3d localPos2 = ((Model)((PhysicsEntity)this.bodies.get(connectedTo)).models.get(0)).mesh.offset;
Vector3d pivotPoint = ((PhysicsEntity)this.bodies.get(from)).pivot;
Vector3d scaleFrom = ((PhysicsEntity)this.bodies.get(from)).getTransformation().getScale(new Vector3d());
Vector3d scaleTo = ((PhysicsEntity)this.bodies.get(connectedTo)).getTransformation().getScale(new Vector3d());
((Model)((PhysicsEntity)this.bodies.get(from)).models.get(0)).onlyVisual = onlyVisual;

With custom entity model resource packs enabled, the number of elements that the bodies list contains is differs as it is without the resource packs. Therefore, an IndexOutOfBoundsException is thrown. And if I'm not mistaken, the segmentation fault occurred because the invalid index value was passed into the native lib libPhysXJniBindings_64.so.

RIvance avatar Jan 18 '23 14:01 RIvance

That error has nothing to do with it. I just print the error to check for ragdoll bugs. Basically whenever it prints that stack trace in the log it wasn't able to create a proper ragdoll so it doesn't add it as physics and falls back to the blocky mob death type.

haubna avatar Jan 18 '23 15:01 haubna

Thanks again, I got it. Maybe I should have a try with the same config on Windows.

RIvance avatar Jan 18 '23 15:01 RIvance