mojo icon indicating copy to clipboard operation
mojo copied to clipboard

[BUG] Segmentation Fault

Open TheAbhilash23 opened this issue 10 months ago • 2 comments

Bug description

Code where this issue could be...

from lightbug_http.http import HTTPRequest, HTTPResponse, OK
from lightbug_http.service import HTTPService

@value
struct MyAppService(HTTPService):
    fn func(self, req: HTTPRequest) raises -> HTTPResponse:
        var body = req.body_raw
        var uri = req.uri()
        if uri.path() == "/":
            print("I'm on the index path!")
        print(req.host()) # This Line was added by me....... req.host() returns String type
        return OK(String("Hello, world").as_bytes(), "text/plain")

Command i ran

mojo lightbug.(fireemoji)

from

https://github.com/saviorand/lightbug_http

i got

Please submit a bug report to https://github.com/modularml/mojo/issues and include the crash backtrace along with all the relevant source codes.
Stack dump:
0.      Program arguments: mojo lightbug.\360\237\224\245
[2246846:2246847:20240402,190044.392765:ERROR directory_reader_posix.cc:42] opendir /home/abhilash/.modular/crashdb/attachments/d29d1020-e2ac-4ba6-98b1-002382ba6cfb: No such file or directory (2)
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  mojo      0x00005e7555ed5e47
1  mojo      0x00005e7555ed3a1e
2  mojo      0x00005e7555ed651f
3  libc.so.6 0x000074d7a7fa3520
4  libc.so.6 0x000074d70402e2a1
Segmentation fault (core dumped)

Steps to reproduce

  • Include relevant code snippet or link to code that did not work as expected.
  • If applicable, add screenshots to help explain the problem.
  • If using the Playground, name the pre-existing notebook that failed and the steps that led to failure.
  • Include anything else that might help us debug the issue.

System information

- What OS did you do install Mojo on ?
Linux Ubuntu 22 LTS
- Provide version information for Mojo by pasting the output of `mojo -v`
mojo 24.1.1 (0ab415f7)
- Provide Modular CLI version by pasting the output of `modular -v`
modular 0.5.1 (1b608e3d)

TheAbhilash23 avatar Apr 02 '24 13:04 TheAbhilash23