go-qml / qml

QML support for the Go language
Other
1.96k stars 189 forks source link

Crashes when genqrc attempts to add large file (font) #107

Closed svkior closed 9 years ago

svkior commented 9 years ago

I try to add font inside the qrc.go

MacBook-Air:imconsole svkior$ genqrc ./qml
panic: runtime error: index out of range

goroutine 16 [running]:
runtime.panic(0x41b09c0, 0x42b52dc)
    /usr/local/go/src/pkg/runtime/panic.c:279 +0xf5
gopkg.in/qml%2ev1.newResourcesWriter(0xc20801a3c0, 0x5)
    /Users/svkior/go/src/gopkg.in/qml.v1/resources.go:180 +0x296
gopkg.in/qml%2ev1.(*ResourcesPacker).Pack(0xc20801a3c0, 0x5)
    /Users/svkior/go/src/gopkg.in/qml.v1/resources.go:91 +0x27
main.run(0x0, 0x0)
    /Users/svkior/go/src/gopkg.in/qml.v1/cmd/genqrc/main.go:128 +0x23a
main.main()
    /Users/svkior/go/src/gopkg.in/qml.v1/cmd/genqrc/main.go:94 +0x38

goroutine 19 [finalizer wait]:
runtime.park(0x40671c0, 0x42c3498, 0x42b7989)
    /usr/local/go/src/pkg/runtime/proc.c:1369 +0x89
runtime.parkunlock(0x42c3498, 0x42b7989)
    /usr/local/go/src/pkg/runtime/proc.c:1385 +0x3b
runfinq()
    /usr/local/go/src/pkg/runtime/mgc0.c:2644 +0xcf
runtime.goexit()
    /usr/local/go/src/pkg/runtime/proc.c:1445

goroutine 17 [syscall]:
runtime.goexit()
    /usr/local/go/src/pkg/runtime/proc.c:1445
svkior commented 9 years ago

tree

MacBook-Air:imconsole svkior$ tree qml
qml
├── main.qml
└── resources
    ├── boot
    │   ├── Boot.qml
    │   ├── BootLogo.qml
    │   └── PasswordKeyboard.qml
    ├── fonts
    │   └── lcd.ttf
    ├── misc
    │   ├── BigButton.qml
    │   ├── DefText.qml
    │   ├── Sketch.qml
    │   └── TouchKey.qml
    ├── or
    │   └── CommonManual.qml
    ├── sys
    │   ├── Clock.qml
    │   ├── StatusPad.qml
    │   ├── StatusWindow.qml
    │   ├── SysLogo.qml
    │   └── SystemPad.qml
    └── users
        ├── UserModel.qml
        └── UsersList.qml

7 directories, 17 files
svkior commented 9 years ago

When I exclude ttf - everything is ok.

Here is result of ls

MacBook-Air:imconsole svkior$ ls -la ./qml/resources/fonts/
total 24
drwxr-xr-x  3 svkior  staff   102 Oct  1 01:40 .
drwxr-xr-x  8 svkior  staff   272 Oct  1 01:39 ..
-rw-r--r--  1 svkior  staff  9532 Dec 16  2004 lcd.ttf
niemeyer commented 9 years ago

This doesn't look related to the file size. Would you be able to provide the content of your resources directory somewhere?

niemeyer commented 9 years ago

Actually, I see the problem. Fix coming.