dlang / dub

Package and build management system for D
MIT License
678 stars 227 forks source link

Sementation fault on `dub build` with missing git repository #2579

Closed Geod24 closed 10 months ago

Geod24 commented 1 year ago

Steps to reproduce:

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 commented 1 year ago

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 commented 10 months ago

Probably just another case of #2696