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 ARM devices #2823

Closed
KN4CK3R opened this issue Sep 10, 2019 · 4 comments · Fixed by #2827

Comments

@KN4CK3R
Copy link
Contributor

commented Sep 10, 2019

Drone fails on ARM devices with a segmentation fault (see https://discourse.drone.io/t/drone-1-3-0-silently-fails-on-armv7/5417/3 and https://discourse.drone.io/t/run-drone-linux-arm-on-raspberry-pi-3-with-error-exit-code-132/5590/ ) The last working version was 1.2.3. I compiled all commits since the v1.2.3 tag and it stops working after the merge of the pull request #2788 (@Lucretius). I got it working again after this change:

diff --git "a/cmd/drone-server/inject_store.go" "b/cmd/drone-server/inject_store.go"
index c34aebfb..8357b415 100644
--- "a/cmd/drone-server/inject_store.go"
+++ "b/cmd/drone-server/inject_store.go"
@@ -92,12 +92,12 @@ func provideLogStore(db *db.DB, config config.Config) core.LogStore {
 		return logs.NewCombined(p, s)
 	}
 	if config.AzureBlob.ContainerName != "" {
-		p := logs.NewAzureBlobEnv(
+		/*p := logs.NewAzureBlobEnv(
 			config.AzureBlob.ContainerName,
 			config.AzureBlob.StorageAccountName,
 			config.AzureBlob.StorageAccessKey,
 		)
-		return logs.NewCombined(p, s)
+		return logs.NewCombined(p, s)*/
 	}
 	return s
 }

I don't know why the if check doesn't work as expected but NewAzureBlobEnv gets called which causes the segmentation fault.

@Lucretius

This comment has been minimized.

Copy link
Contributor

commented Sep 11, 2019

Sorry to hear my PR is causing issues. Definitely did not test my code on a raspberry pi or an ARM device. Did you try logging out what exactly what it thinks the container name is? Since it’s appearing to skip the S3 check, I wonder if something is getting set somehow for AzureBlob?

@KN4CK3R

This comment has been minimized.

Copy link
Contributor Author

commented Sep 11, 2019

I tried to output the values with fmt.println but it didn't print the text. I haven't worked with Go until now so that may be wrong. If you could give me code for logging I can test it on a raspberry.

@Lucretius

This comment has been minimized.

Copy link
Contributor

commented Sep 11, 2019

I believe the project uses logrus for its logging, output via fmt.Println may be suppressed. Try also logging just outside of that if-statement. If nothing is being written out and it's simply ignoring the if-check maybe it comes down to how ARM process instructions from compiled Go code?

If the logging doesn't work see if changing the two if checks into an if-elseif-else checks has any effect.

I tried to do a bit of research last night and it sounds like people on occasion have strange behavior from ARM devices with compiled Go code due to how the ARM devices end up processing the compiled code, and I wonder if this is the case here. Bit of a shot in the dark on my end I am afraid but some things to try I suppose.

@KN4CK3R

This comment has been minimized.

Copy link
Contributor Author

commented Sep 11, 2019

I tried to compile it for armv6 because I remembered this Gitea issue (go-gitea/gitea#6700) but that doesn't work. Then I used Go 1.13.0 to compile Drone and the segmentation fault is gone! Looks like they fixed it in the runtime / compiler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.