crystal-sqlite3 icon indicating copy to clipboard operation
crystal-sqlite3 copied to clipboard

Invalid memory access (signal 11) at address 0x0

Open zw963 opened this issue 1 year ago • 0 comments
trafficstars

Invalid memory access (signal 11) at address 0x0
[0x55eb4f123e66] *Exception::CallStack::print_backtrace:Nil +118 in bin/translater
[0x55eb4f1048e6] ~procProc(Int32, Pointer(LibC::SiginfoT), Pointer(Void), Nil) +310 in bin/translater
[0x7f828811c770] ?? +140198605342576 in /usr/lib/libc.so.6
[0x0] ???

I can reproduce this on my recent version translater. it is an simple app with infrequent access to SQL.

reproduce

  1. clone https://github.com/crystal-china/translater and switch to sqlite3_exception branch.
  2. shards install
  3. shards build
  4. run bin/translater -e baidu,bing 'hello world'

As you can see, it raise Invalid memory access this time, but it work on next time.

image

the broken code is here, when insert into two table in same db file in a times loop.

Anyway, i thiought whatever happen don't should cause a Invalid memory access.

Add a sleep 0.1 after this line, seem like fix this issue.

BTW: same issue happen both on use DB.connect or DB.open.

Test on Crystal 1.12.0

Thanks

zw963 avatar Apr 11 '24 11:04 zw963