1

通話時

tokens = g_regex_split (arv_gv_device_get_url_regex (), filename, 0);

私はこのエラーに遭遇しています

(process:15239): GLib-WARNING **: unknown option bit(s) set
(process:15239): GLib-CRITICAL **: g_regex_split_full: assertion 'regex != NULL' failed

g_regex_splitは glib の一部です。

オンラインで検索すると、エラーはコンパイラが間違った pcre (=Perl 互換正規表現ライブラリ) を参照していることに関連している可能性があると思われます。(ここで同様のエラーの議論を参照してください: https://groups.google.com/forum/#!topic/mu-discuss/cy_yKE6ivzM )

コンパイラが取得する pcre をどのように定義しますか? Makefile で設定するフラグは何ですか?


追加情報

$ locate libpcre.so
/lib/x86_64-linux-gnu/libpcre.so.3
/lib/x86_64-linux-gnu/libpcre.so.3.13.1
/usr/lib/x86_64-linux-gnu/libpcre.so

$ dpkg -s libpcre3
Package: libpcre3
Status: install ok installed
Priority: required
Section: libs
Installed-Size: 466
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Multi-Arch: same
Source: pcre3
Version: 1:8.31-2
Depends: libc6 (>= 2.14)
Pre-Depends: multiarch-support
Breaks: approx (<< 4.4-1~), cduce (<< 0.5.3-2~), cmigrep (<< 1.5-7~), galax (<< 1.1-7~), libpcre-ocaml (<< 6.0.1~), liquidsoap (<< 0.9.2-3~), ocsigen (<< 1.3.3-1~)
Conflicts: libpcre3-dev (<= 4.3-3)
Description: Perl 5 Compatible Regular Expression Library - runtime files
This is a library of functions to support regular expressions whose syntax
and semantics are as close as possible to those of the Perl 5 language.
.
This package contains the runtime libraries.
Original-Maintainer: Mark Baker <mark@mnb.org.uk>
4

1 に答える 1

0

NULL を渡すと、regex != NULLアサーションの失敗が発生しますg_regex_split。これは、あなたの場合、戻り値がarv_gv_device_get_url_regexisであることを意味しますNULL。実際に成功することを確認せずに正規表現を作成しているようです。

成功しない理由についてg_regex_newは、そのコードが含まれていないため回答が難しいですが、「不明なオプションビットが設定されている」という警告は間違いなく手がかりを提供します. どのフラグに渡しているかをよく見て、どのフラグがg_regex_newその警告を引き起こしているかを突き止めてください。これを修正すると、おそらくg_regex_newではなく実際のインスタンスが返されNULL、アサーションの失敗が修正されるはずです。もちろん、実行時に戻り値をチェックし、エラーをアサーションの失敗に変えるのではなく、適切に処理する必要があります…</p>

于 2014-03-28T20:04:11.423 に答える