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

Sementation fault on dub build with missing git repository #2579

Closed
Geod24 opened this issue Feb 4, 2023 · 2 comments
Closed

Sementation fault on dub build with missing git repository #2579

Geod24 opened this issue Feb 4, 2023 · 2 comments
Labels

Comments

@Geod24
Copy link
Member

Geod24 commented Feb 4, 2023

Steps to reproduce:

  • Add a repository with a git dependency in dub.json;
  • Build so dub.selections.json is generated;
  • Switch to a version dependency in dub.json;
  • Nuke the repository in ~/.dub/packages/
  • dub build

Results:

(gdb) run
Starting program: /usr/bin/dub build
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Detaching after fork from child process 10117]
[Detaching after fork from child process 10119]
[Detaching after fork from child process 10121]
[Detaching after fork from child process 10123]
[Detaching after fork from child process 10138]
fatal: reference is not a tree: 654165dd29bded2c20ea6c7ca66d37a03c3ef076
[Detaching after fork from child process 10139]
[Detaching after fork from child process 10154]
fatal: reference is not a tree: 654165dd29bded2c20ea6c7ca66d37a03c3ef076

Program received signal SIGSEGV, Segmentation fault.
0x000055555616791b in _D3dub7project7Project6reinitMFZ22collectDependenciesRecMFCQCf8package_7PackageiZv (__capture=0x7fffffffcc18, depth=1, pack=0x0) at source/dub/project.d:465
465	source/dub/project.d: No such file or directory.
(gdb) bt
#0  0x000055555616791b in _D3dub7project7Project6reinitMFZ22collectDependenciesRecMFCQCf8package_7PackageiZv (__capture=0x7fffffffcc18, depth=1, pack=0x0) at source/dub/project.d:465
#1  0x0000555556168507 in _D3dub7project7Project6reinitMFZ22collectDependenciesRecMFCQCf8package_7PackageiZv (__capture=0x7fffffffcc18, depth=0, pack=0x7ffff7c72000) at source/dub/project.d:546
#2  0x00005555561677cf in _D3dub7project7Project6reinitMFZv (this=0x7ffff7c7e540) at source/dub/project.d:553
#3  0x0000555556164801 in _D3dub7project7Project6__ctorMFCQBe14packagemanager14PackageManagerCQCo8package_7PackageZCQDkQDjQDe (this=0x7ffff7c7e540, pack=0x7fffffffccc0, package_manager=0x7ffff7662020)
    at source/dub/project.d:90
#4  0x00005555561646bc in _D3dub7project7Project6__ctorMFCQBe14packagemanager14PackageManagerSQCo8internal10vibecompat4inet4path10NativePathZCQEkQEjQEe (this=0x7ffff7c7e540, project_path=..., 
    package_manager=0x7ffff7c67280) at source/dub/project.d:71
#5  0x0000555555f521e1 in _D3dubQe3Dub11loadPackageMFSQBa8internal10vibecompat4inet4path10NativePathZv (this=0x7ffff7c54600, path=...) at source/dub/dub.d:449
#6  0x0000555555f521a1 in _D3dubQe3Dub11loadPackageMFZv (this=0x7ffff7c54600) at source/dub/dub.d:443
#7  0x0000555555d7d9c5 in _D3dub11commandline7Command14loadCwdPackageMFCQBsQBv3DubbZb (this=0x7ffff7c4c400, warn_missing_package=true, dub=0x7ffff7c54600) at source/dub/commandline.d:816
#8  0x0000555555d7f9a0 in _D3dub11commandline19PackageBuildCommand19loadSpecificPackageMFCQCkQCn3DubAyaQdZb (this=0x7ffff7c4c400, ver=..., package_name=..., dub=0x7ffff7c54600) at source/dub/commandline.d:1112
#9  0x0000555555d7f469 in _D3dub11commandline19PackageBuildCommand12setupPackageMFCQCdQCg3DubAyaQdQfZv (this=0x7ffff7c4c400, ver=..., default_build_type=..., package_name=..., dub=0x7ffff7c54600)
    at source/dub/commandline.d:1065
#10 0x0000555555d7f0fe in _D3dub11commandline19PackageBuildCommand19setupVersionPackageMFCQCkQCn3DubAyaQdZv (this=0x7ffff7c4c400, default_build_type=..., str_package_info=..., dub=0x7ffff7c54600)
    at source/dub/commandline.d:1043
#11 0x0000555555d801d7 in _D3dub11commandline15GenerateCommand7executeMFCQBtQBw3DubAAyaQeZi (this=0x7ffff7c4c400, app_args=0, __app_args_8=0, free_args=0, __free_args_8=0x7ffff7c4c400, dub=0x7ffff7c54600)
    at source/dub/commandline.d:1193
#12 0x0000555555d80a71 in _D3dub11commandline12BuildCommand7executeMFCQBqQBt3DubAAyaQeZi (this=0x7ffff7c4c400, app_args=..., free_args=0, __free_args_8=0x7ffff7c49790, dub=0x7ffff7c54600)
    at source/dub/commandline.d:1272
#13 0x0000555555d7bfb3 in _D3dub11commandline17runDubCommandLineFAAyaZi (args=...) at source/dub/commandline.d:496
#14 0x0000555555d62338 in _Dmain (args=...) at source/app.d:26

dub.selections.json:

	"fileVersion": 1,
	"versions": {
		"archive": {"version":"654165dd29bded2c20ea6c7ca66d37a03c3ef076","repository":"git+https://github.com/Geod24/archive.git"},
		"configy": "1.0.0",
		"darser": "1.0.1",
		"diet-ng": "1.8.1",
		"dyaml": "0.9.2",
		"eventcore": "0.9.22",
		"exceptionhandling": "1.0.0",
		"fixedsizearray": "1.3.0",
		"graphqld": "3.12.2",
		"libasync": "0.8.6",
		"memutils": "1.0.4",
		"mir-linux-kernel": "1.0.1",
		"nullablestore": "2.1.0",
		"openssl": "3.2.2",
		"stdx-allocator": "2.77.5",
		"taggedalgebraic": "0.11.22",
		"tinyendian": "0.2.0",
		"vibe-core": "1.22.6",
		"vibe-d": "0.9.5"
	}
}

dub.json pre-modif:

{
    "name": "foo",   
    "dependencies": {
        "archive": { "repository": "git+https://github.com/Geod24/archive.git",
                     "version": "654165dd29bded2c20ea6c7ca66d37a03c3ef076" },
	"configy": "~>1.0.0",
	"graphqld": "~>3.12.2"
    }    
}

dub.json post-modif:

{
    "name": "foo",
    "dependencies": {
	"archive": "~>0.7.1",
	"configy": "~>1.0.0",
	"graphqld": "~>3.12.2"
    }    
}
@Geod24 Geod24 added the bug label Feb 4, 2023
@Geod24
Copy link
Member Author

Geod24 commented Feb 4, 2023

Hum, the cause is much simpler: I was referencing a reference which no longer exists upstream (I deleted the branch).
Yet, this shouldn't SEGV.

@Geod24
Copy link
Member Author

Geod24 commented Dec 28, 2023

Probably just another case of #2696

@Geod24 Geod24 closed this as completed Dec 28, 2023
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

1 participant